X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fclean-temp.h;h=6e7c3e6c9179fd691fdfbda279ebe1db00a8cfaa;hb=a6e1a4f043426844c43f4a2967c019d3ff3b1917;hp=aa5e8d3d597cebacd4ee0af2c3647f0ebc2c12fe;hpb=bd63935b8ac05a50706b7b56540cd0396b528c77;p=gnulib.git diff --git a/lib/clean-temp.h b/lib/clean-temp.h index aa5e8d3d5..6e7c3e6c9 100644 --- a/lib/clean-temp.h +++ b/lib/clean-temp.h @@ -36,7 +36,7 @@ extern "C" { Also, open file descriptors need to be closed before the temporary files and the temporary directories can be removed, because only on Unix - (excluding Cygwin) one can remove directories containing open files. + (excluding Cygwin) can one remove directories containing open files. This module provides support for temporary directories and temporary files inside these temporary directories. Temporary files without temporary @@ -89,20 +89,24 @@ extern void register_temp_subdir (struct temp_dir *dir, extern void unregister_temp_subdir (struct temp_dir *dir, const char *absolute_dir_name); -/* Remove the given ABSOLUTE_FILE_NAME and unregister it. */ -extern void cleanup_temp_file (struct temp_dir *dir, - const char *absolute_file_name); +/* Remove the given ABSOLUTE_FILE_NAME and unregister it. + Return 0 upon success, or -1 if there was some problem. */ +extern int cleanup_temp_file (struct temp_dir *dir, + const char *absolute_file_name); -/* Remove the given ABSOLUTE_DIR_NAME and unregister it. */ -extern void cleanup_temp_subdir (struct temp_dir *dir, - const char *absolute_dir_name); +/* Remove the given ABSOLUTE_DIR_NAME and unregister it. + Return 0 upon success, or -1 if there was some problem. */ +extern int cleanup_temp_subdir (struct temp_dir *dir, + const char *absolute_dir_name); -/* Remove all registered files and subdirectories inside DIR. */ -extern void cleanup_temp_dir_contents (struct temp_dir *dir); +/* Remove all registered files and subdirectories inside DIR. + Return 0 upon success, or -1 if there was some problem. */ +extern int cleanup_temp_dir_contents (struct temp_dir *dir); /* Remove all registered files and subdirectories inside DIR and DIR itself. - DIR cannot be used any more after this call. */ -extern void cleanup_temp_dir (struct temp_dir *dir); + DIR cannot be used any more after this call. + Return 0 upon success, or -1 if there was some problem. */ +extern int cleanup_temp_dir (struct temp_dir *dir); /* Open a temporary file in a temporary directory. Registers the resulting file descriptor to be closed. */ @@ -118,6 +122,10 @@ extern int fclose_temp (FILE *fp); Unregisters the previously registered file descriptor. */ extern int fwriteerror_temp (FILE *fp); +/* Like close_stream. + Unregisters the previously registered file descriptor. */ +extern int close_stream_temp (FILE *fp); + #ifdef __cplusplus }