#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>
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.
*/
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
*/
#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
/**
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
* 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