aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/m4/lib/tempname.h
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-10-20 14:48:12 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-10-20 15:00:29 +0300
commitb6f802fe434163ffe6f81843780906ae25ac4755 (patch)
treee63ee2665b40183135d1e04756f2fe091f031209 /contrib/tools/m4/lib/tempname.h
parent694f58a5c020bfe1028af0fd2d4947d07e2a7080 (diff)
downloadydb-b6f802fe434163ffe6f81843780906ae25ac4755.tar.gz
Update contrib/tools/m4 to 1.4.18
commit_hash:dab43d0051ce5656201a6f031d378c04dceefa2c
Diffstat (limited to 'contrib/tools/m4/lib/tempname.h')
-rw-r--r--contrib/tools/m4/lib/tempname.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/tools/m4/lib/tempname.h b/contrib/tools/m4/lib/tempname.h
index 333267dfd0..be01c51436 100644
--- a/contrib/tools/m4/lib/tempname.h
+++ b/contrib/tools/m4/lib/tempname.h
@@ -1,6 +1,6 @@
/* Create a temporary file or directory.
- Copyright (C) 2006, 2009-2013 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 */