aboutsummaryrefslogtreecommitdiffstats
path: root/epan/filesystem.h
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2007-01-14 22:25:22 +0000
committerUlf Lamping <ulf.lamping@web.de>2007-01-14 22:25:22 +0000
commit47aaf7d9b79f18f9856433aa64f3972910bf2434 (patch)
treea7d259cfa2ab45190cace3313c4ca95cc2561176 /epan/filesystem.h
parentd1db2cb464ff12532d1d7cf242d8bd805d4e7b38 (diff)
on my way to fix #301:
add a function get_persdatafile_dir() that will return the users personal default data dir Win32:"My Documents" UNIX:"" (for the current dir) svn path=/trunk/; revision=20431
Diffstat (limited to 'epan/filesystem.h')
-rw-r--r--epan/filesystem.h102
1 files changed, 55 insertions, 47 deletions
diff --git a/epan/filesystem.h b/epan/filesystem.h
index 9f5356a39c..47e6b95d34 100644
--- a/epan/filesystem.h
+++ b/epan/filesystem.h
@@ -26,44 +26,6 @@
#define FILESYSTEM_H
/*
- * Given a pathname, return the last component.
- */
-extern const char *get_basename(const char *);
-
-/*
- * Given a pathname, return a string containing everything but the
- * last component. NOTE: this overwrites the pathname handed into
- * it....
- */
-extern char *get_dirname(char *);
-
-/*
- * Given a pathname, return:
- *
- * the errno, if an attempt to "stat()" the file fails;
- *
- * EISDIR, if the attempt succeeded and the file turned out
- * to be a directory;
- *
- * 0, if the attempt succeeded and the file turned out not
- * to be a directory.
- */
-extern int test_for_directory(const char *);
-
-/*
- * Given a pathname, return:
- *
- * the errno, if an attempt to "stat()" the file fails;
- *
- * ESPIPE, if the attempt succeeded and the file turned out
- * to be a FIFO;
- *
- * 0, if the attempt succeeded and the file turned out not
- * to be a FIFO.
- */
-extern int test_for_fifo(const char *);
-
-/*
* Get the pathname of the directory from which the executable came,
* and save it for future use. Returns NULL on success, and a
* g_mallocated string containing an error on failure.
@@ -76,12 +38,6 @@ extern char *init_progfile_dir(const char *arg0);
extern const char *get_progfile_dir(void);
/*
- * Get the directory in which global configuration and data files are
- * stored.
- */
-extern const char *get_datafile_dir(void);
-
-/*
* Find the directory in which plugins are stored; this must be called
* after init_progfile_dir() is called.
*/
@@ -99,6 +55,12 @@ extern const char *get_plugin_dir(void);
extern gboolean running_in_build_directory(void);
/*
+ * Get the directory in which global configuration files are
+ * stored.
+ */
+extern const char *get_datafile_dir(void);
+
+/*
* Construct the path name of a global configuration file, given the
* file name.
*/
@@ -134,6 +96,14 @@ extern int create_persconffile_dir(char **pf_dir_path_return);
extern char *get_persconffile_path(const char *filename, gboolean for_writing);
/*
+ * Get the (default) directory in which personal data is stored.
+ *
+ * On Win32, this is the "My Documents" folder in the personal profile.
+ * On UNIX this is simply the current directory.
+ */
+extern char *get_persdatafile_dir(void);
+
+/*
* Construct the path name of a file in $TMP/%TEMP% directory.
* Or "/tmp/<filename>" (C:\<filename>) if that fails.
*
@@ -141,9 +111,6 @@ extern char *get_persconffile_path(const char *filename, gboolean for_writing);
*/
extern char *get_tempfile_path(const char *filename);
-/* Delete a file */
-extern gboolean deletefile (const char *path);
-
/*
* Return an error message for UNIX-style errno indications on open or
* create operations.
@@ -157,6 +124,47 @@ extern const char *file_open_error_message(int err, gboolean for_writing);
extern const char *file_write_error_message(int err);
/*
+ * Given a pathname, return the last component.
+ */
+extern const char *get_basename(const char *);
+
+/*
+ * Given a pathname, return a string containing everything but the
+ * last component. NOTE: this overwrites the pathname handed into
+ * it....
+ */
+extern char *get_dirname(char *);
+
+/*
+ * Given a pathname, return:
+ *
+ * the errno, if an attempt to "stat()" the file fails;
+ *
+ * EISDIR, if the attempt succeeded and the file turned out
+ * to be a directory;
+ *
+ * 0, if the attempt succeeded and the file turned out not
+ * to be a directory.
+ */
+extern int test_for_directory(const char *);
+
+/*
+ * Given a pathname, return:
+ *
+ * the errno, if an attempt to "stat()" the file fails;
+ *
+ * ESPIPE, if the attempt succeeded and the file turned out
+ * to be a FIFO;
+ *
+ * 0, if the attempt succeeded and the file turned out not
+ * to be a FIFO.
+ */
+extern int test_for_fifo(const char *);
+
+/* Delete a file */
+extern gboolean deletefile (const char *path);
+
+/*
* Check, if file is existing.
*/
extern gboolean file_exists(const char *fname);