aboutsummaryrefslogtreecommitdiffstats
path: root/tempfile.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2009-07-02 17:20:27 +0000
committerGerald Combs <gerald@wireshark.org>2009-07-02 17:20:27 +0000
commit72a20c1695d963755190c2975ecdab05ad67c0f3 (patch)
treef0d1a8503bfebe75fcb95ebbfc905154f58b21de /tempfile.h
parent9952ce524f3b196be80b175f6784438e856f7980 (diff)
Pull mkstemp() into tempfile.c. That's the only place we use it now, and
it's arguably the only place we _should_ use it. Add create_tempdir() to tempfile.c and use it to create a temp directory for IP maps. This should fix bug 3530. (This still doesn't work on IE 8 / Vista here. IE gives an access denied error in OpenLayers.js, but this is a separate issue). svn path=/trunk/; revision=28920
Diffstat (limited to 'tempfile.h')
-rw-r--r--tempfile.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/tempfile.h b/tempfile.h
index 95a03794a6..2a7fc5148c 100644
--- a/tempfile.h
+++ b/tempfile.h
@@ -39,12 +39,24 @@ extern "C" {
* is created using g_get_tmp_dir and mkstemp.
*
* @param namebuf If not NULL, receives the full path of the temp file.
- * Should NOT be freed.
+ * Must NOT be freed.
* @param pfx A prefix for the temporary file.
* @return The file descriptor of the new tempfile, from mkstemp().
*/
int create_tempfile(char **namebuf, const char *pfx);
+/**
+ * Create a directory with the given prefix (e.g. "wireshark"). The path
+ * is created using g_get_tmp_dir and mkdtemp.
+ *
+ * @param namebuf If not NULL, receives the full path of the temp directory.
+ * Must NOT be freed.
+ * @param pfx A prefix for the temporary directory.
+ * @return The temporary directory path on success, or NULL on failure.
+ * Must NOT be freed.
+ */
+const char *create_tempdir(char **namebuf, const char *pfx);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */