]> git.ipfire.org Git - thirdparty/git.git/blobdiff - tempfile.h
register_tempfile(): new function to handle an existing temporary file
[thirdparty/git.git] / tempfile.h
index a30e12c7e5c386d66aeb7a347e8476f9e3bb6d21..4219fe41bd3e2ad16f0b1caf55eedca0b2d9986e 100644 (file)
@@ -92,6 +92,14 @@ struct tempfile {
  */
 extern int create_tempfile(struct tempfile *tempfile, const char *path);
 
+/*
+ * Register an existing file as a tempfile, meaning that it will be
+ * deleted when the program exits. The tempfile is considered closed,
+ * but it can be worked with like any other closed tempfile (for
+ * example, it can be opened using reopen_tempfile()).
+ */
+extern void register_tempfile(struct tempfile *tempfile, const char *path);
+
 
 /*
  * mks_tempfile functions