aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-11-17 04:39:44 +0000
committerGuy Harris <guy@alum.mit.edu>2013-11-17 04:39:44 +0000
commiteee9b9ddd30be0b11593a31ecf67672522d7e5ed (patch)
treea192462f2b3ff017b879d449c007c6d496a7046a /wsutil
parent74647a318b93d780cae2eabe70ce45b55e4e94a7 (diff)
Move get_tempfile_path() from filesystem.[ch] to tempfile.[ch].
svn path=/trunk/; revision=53379
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/filesystem.c9
-rw-r--r--wsutil/filesystem.h8
-rw-r--r--wsutil/tempfile.c12
-rw-r--r--wsutil/tempfile.h9
4 files changed, 18 insertions, 20 deletions
diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c
index fa292da4ce..e394858bd9 100644
--- a/wsutil/filesystem.c
+++ b/wsutil/filesystem.c
@@ -1896,15 +1896,6 @@ deletefile(const char *path)
}
/*
- * Construct and return the path name of a file in the
- * appropriate temporary file directory.
- */
-char *get_tempfile_path(const char *filename)
-{
- return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename);
-}
-
-/*
* Return an error message for UNIX-style errno indications on open or
* create operations.
*/
diff --git a/wsutil/filesystem.h b/wsutil/filesystem.h
index 6b76bab4fc..642ddf9797 100644
--- a/wsutil/filesystem.h
+++ b/wsutil/filesystem.h
@@ -205,14 +205,6 @@ WS_DLL_PUBLIC char *get_persconffile_path(const char *filename, gboolean from_pr
WS_DLL_PUBLIC const char *get_persdatafile_dir(void);
/*
- * Construct the path name of a file in $TMP/%TEMP% directory.
- * Or "/tmp/<filename>" (C:\<filename>) if that fails.
- *
- * Return value is g_malloced so the caller should g_free it.
- */
-WS_DLL_PUBLIC char *get_tempfile_path(const char *filename);
-
-/*
* process command line option belonging to the filesystem settings
*/
WS_DLL_PUBLIC int filesystem_opt(int opt, const char *optstr);
diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c
index 2fab0df257..9993a0ea4f 100644
--- a/wsutil/tempfile.c
+++ b/wsutil/tempfile.c
@@ -146,6 +146,15 @@ mkdtemp (char *template)
#endif /* HAVE_MKDTEMP */
+/*
+ * Construct and return the path name of a file in the
+ * appropriate temporary file directory.
+ */
+char *get_tempfile_path(const char *filename)
+{
+ return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", g_get_tmp_dir(), filename);
+}
+
#define MAX_TEMPFILES 3
/**
@@ -200,9 +209,6 @@ create_tempfile(char **namebuf, const char *pfx)
tf[idx].path = (char *)g_malloc(tf[idx].len);
}
- /*
- * We can't use get_tempfile_path here because we're called from dumpcap.c.
- */
tmp_dir = g_get_tmp_dir();
#ifdef _WIN32
diff --git a/wsutil/tempfile.h b/wsutil/tempfile.h
index 4f9492ed87..f58419f581 100644
--- a/wsutil/tempfile.h
+++ b/wsutil/tempfile.h
@@ -35,6 +35,15 @@ extern "C" {
* Convenience function for temporary file creation.
*/
+/**
+ * Construct the path name of a file in the appropriate temporary
+ * file directory.
+ *
+ * @param filename the file name to be given to the file.
+ * @return the pathname of the file, g_malloced so the caller
+ * should g_free it.
+ */
+WS_DLL_PUBLIC char *get_tempfile_path(const char *filename);
/**
* Create a tempfile with the given prefix (e.g. "wireshark"). The path