Blame


1 511a516b 2018-05-19 stsp /*
2 511a516b 2018-05-19 stsp * Copyright (c) 2018 Stefan Sperling <stsp@openbsd.org>
3 511a516b 2018-05-19 stsp *
4 511a516b 2018-05-19 stsp * Permission to use, copy, modify, and distribute this software for any
5 511a516b 2018-05-19 stsp * purpose with or without fee is hereby granted, provided that the above
6 511a516b 2018-05-19 stsp * copyright notice and this permission notice appear in all copies.
7 511a516b 2018-05-19 stsp *
8 511a516b 2018-05-19 stsp * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 511a516b 2018-05-19 stsp * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 511a516b 2018-05-19 stsp * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 511a516b 2018-05-19 stsp * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 511a516b 2018-05-19 stsp * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 511a516b 2018-05-19 stsp * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 511a516b 2018-05-19 stsp * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 511a516b 2018-05-19 stsp */
16 511a516b 2018-05-19 stsp
17 511a516b 2018-05-19 stsp /* Utilities for opening temporary files. */
18 511a516b 2018-05-19 stsp
19 511a516b 2018-05-19 stsp /* Open a file descriptor to a new temporary file for writing.
20 511a516b 2018-05-19 stsp * The file is not visible in the filesystem. */
21 511a516b 2018-05-19 stsp int got_opentempfd(void);
22 511a516b 2018-05-19 stsp
23 511a516b 2018-05-19 stsp /* Open a new temporary file for writing.
24 511a516b 2018-05-19 stsp * The file is not visible in the filesystem. */
25 511a516b 2018-05-19 stsp FILE *got_opentemp(void);
26 511a516b 2018-05-19 stsp
27 511a516b 2018-05-19 stsp /* Open a new temporary file for writing.
28 511a516b 2018-05-19 stsp * The file is visible in the filesystem. */
29 511a516b 2018-05-19 stsp const struct got_error *got_opentemp_named(char **, FILE **, const char *);
30 507dc3bb 2018-12-29 stsp
31 507dc3bb 2018-12-29 stsp /* Like got_opentemp_named() but returns a file descriptor instead of a FILE. */
32 507dc3bb 2018-12-29 stsp const struct got_error *got_opentemp_named_fd(char **, int *, const char *);