aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/asn1/packet-asn1.c3
-rw-r--r--wsutil/filesystem.c9
-rw-r--r--wsutil/filesystem.h8
-rw-r--r--wsutil/tempfile.c12
-rw-r--r--wsutil/tempfile.h9
5 files changed, 20 insertions, 21 deletions
diff --git a/plugins/asn1/packet-asn1.c b/plugins/asn1/packet-asn1.c
index 8e3af9dd58..b18f1e7552 100644
--- a/plugins/asn1/packet-asn1.c
+++ b/plugins/asn1/packet-asn1.c
@@ -71,12 +71,13 @@
#include <wsutil/report_err.h>
#include <wsutil/file_util.h>
+#include <wsutil/filesystem.h>
+#include <wsutil/tempfile.h>
#include <epan/packet.h>
#include <epan/exceptions.h>
#include <epan/addr_resolv.h>
#include <epan/prefs.h>
-#include <wsutil/filesystem.h>
#include <epan/dissectors/packet-tcp.h>
#include <epan/oids.h>
#include <epan/emem.h>
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