summaryrefslogtreecommitdiff
path: root/lib/tempname.h
diff options
context:
space:
mode:
authorClint Adams <clint@debian.org>2017-01-04 20:39:58 -0500
committerClint Adams <clint@debian.org>2017-01-04 20:39:58 -0500
commit29d3f78df4630dbee0a141e2be8e77275724b3a8 (patch)
tree89a97129c5b799046be2af10bde88ea035b59bd1 /lib/tempname.h
parentd75f3c567505ad7acd2c1943207b367593652739 (diff)
New upstream version 4.3
Diffstat (limited to 'lib/tempname.h')
-rw-r--r--lib/tempname.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/tempname.h b/lib/tempname.h
index 7972562..be01c51 100644
--- a/lib/tempname.h
+++ b/lib/tempname.h
@@ -1,6 +1,6 @@
/* Create a temporary file or directory.
- Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -32,6 +32,10 @@
# define GT_NOCREATE 2
# endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Generate a temporary file name based on TMPL. TMPL must match the
rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix).
The name constructed does not exist at the time of the call to
@@ -47,4 +51,15 @@
We use a clever algorithm to get hard-to-predict names. */
extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind);
+/* Similar to gen_tempname, but TRYFUNC is called for each temporary
+ name to try. If TRYFUNC returns a non-negative number, TRY_GEN_TEMPNAME
+ returns with this value. Otherwise, if errno is set to EEXIST, another
+ name is tried, or else TRY_GEN_TEMPNAME returns -1. */
+extern int try_tempname (char *tmpl, int suffixlen, void *args,
+ int (*tryfunc) (char *, void *));
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* GL_TEMPNAME_H */