Move get_tempfile_path() from filesystem.[ch] to tempfile.[ch].
authorGuy Harris <guy@alum.mit.edu>
Sun, 17 Nov 2013 04:39:44 +0000 (04:39 -0000)
committerGuy Harris <guy@alum.mit.edu>
Sun, 17 Nov 2013 04:39:44 +0000 (04:39 -0000)
svn path=/trunk/; revision=53379

plugins/asn1/packet-asn1.c
wsutil/filesystem.c
wsutil/filesystem.h
wsutil/tempfile.c
wsutil/tempfile.h

index 8e3af9dd58890d67abeeb55e36c2bce56a4ae843..b18f1e7552eda9fb51bb1b88c9f919bae94a85ed 100644 (file)
 
 #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>
index fa292da4ce664add96df5e7beed129ad2fc97603..e394858bd92e7705d634f71b7a2d9c3ef3fa8a37 100644 (file)
@@ -1895,15 +1895,6 @@ deletefile(const char *path)
     return ws_unlink(path) == 0;
 }
 
-/*
- * 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.
index 6b76bab4fc59a2ba8c91af0ae3246a64170e9d82..642ddf9797a6cfd3984a51a6bce91fc774c6a733 100644 (file)
@@ -204,14 +204,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
  */
index 2fab0df2574ff77b262cb009b9dd10ecf9534591..9993a0ea4f86783d705af4d2453295f1d8c28307 100644 (file)
@@ -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
index 4f9492ed8746e85969c6fa224f06c5897c0151b0..f58419f581c823a32b5ccba1f04c5e7ee9395079 100644 (file)
@@ -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