summaryrefslogtreecommitdiff
path: root/epan/filesystem.h
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2008-01-14 16:40:23 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2008-01-14 16:40:23 +0000
commita2d1e9005dc447486e14903f5d53d5ee8d6d725f (patch)
tree78bc861dc4a2907a73ee807f8893914875221a25 /epan/filesystem.h
parente189eb88870cf39f5785918b56d2284e14f36f0c (diff)
downloadwireshark-a2d1e9005dc447486e14903f5d53d5ee8d6d725f.tar.gz
This patch adds support for configuration profiles, which can be used to
configure and use more than one set of preferences and configuration files. This can be found in the "Configuration Profiles..." menu item from the Edit menu, or by pressing Shift-Ctrl-A. It's also possible to start wireshark and tshark with a named profile by using the "-C ProfileName" option. A new status pane in the main window will show the current profile. The configuration files currently stored in the Profiles are: - Preferences - Capture Filters - Display Filters - Coloring Rules - Disabled Protocols - User Accessible Tables The recent data are by design not added to the profile. Planned future enhancements: - make a more convenient function to switch between profiles - add a "clone profile" button to copy an existing profile - make the profiles list active and accept return as OK - save users "Decode as" in the profile - make new, clone and deletion of profiles more secure - make some of the recent values available in the profile This patch also fixes: - setting default status pane sizes - a bug setting status pane for packets when not having main lower pane. svn path=/trunk/; revision=24089
Diffstat (limited to 'epan/filesystem.h')
-rw-r--r--epan/filesystem.h55
1 files changed, 53 insertions, 2 deletions
diff --git a/epan/filesystem.h b/epan/filesystem.h
index d667ea4b68..9a762c18fc 100644
--- a/epan/filesystem.h
+++ b/epan/filesystem.h
@@ -71,6 +71,55 @@ extern char *get_datafile_path(const char *filename);
extern const char *get_systemfile_dir(void);
/*
+ * Set the configuration profile name to be used for storing
+ * personal configuration files.
+ */
+extern void set_profile_name(const gchar *profilename);
+
+/*
+ * Get the current configuration profile name used for storing
+ * personal configuration files.
+ */
+extern const char *get_profile_name(void);
+
+/*
+ * Get the directory used to store configuration profile directories.
+ */
+extern const char *get_profiles_dir(void);
+
+/*
+ * Check if given configuration profile exists.
+ */
+extern gboolean profile_exists(const gchar *profilename);
+
+/*
+ * Create a directory for the given configuration profile.
+ * If we attempted to create it, and failed, return -1 and
+ * set "*pf_dir_path_return" to the pathname of the directory we failed
+ * to create (it's g_mallocated, so our caller should free it); otherwise,
+ * return 0.
+ */
+extern int create_persconffile_profile(const char *profilename,
+ char **pf_dir_path_return);
+
+/*
+ * Delete the directory for the given configuration profile.
+ * If we attempted to delete it, and failed, return -1 and
+ * set "*pf_dir_path_return" to the pathname of the directory we failed
+ * to delete (it's g_mallocated, so our caller should free it); otherwise,
+ * return 0.
+ */
+extern int delete_persconffile_profile(const char *profilename,
+ char **pf_dir_path_return);
+
+/*
+ * Rename the directory for the given confinguration profile.
+ */
+extern int rename_persconffile_profile(const char *fromname, const char *toname,
+ char **pf_from_dir_path_return,
+ char **pf_to_dir_path_return);
+
+/*
* Create the directory that holds personal configuration files, if
* necessary. If we attempted to create it, and failed, return -1 and
* set "*pf_dir_path_return" to the pathname of the directory we failed
@@ -81,7 +130,8 @@ extern int create_persconffile_dir(char **pf_dir_path_return);
/*
* Construct the path name of a personal configuration file, given the
- * file name.
+ * file name. If using configuration profiles this directory will be
+ * used if "from_profile" is TRUE.
*
* On Win32, if "for_writing" is FALSE, we check whether the file exists
* and, if not, construct a path name relative to the ".wireshark"
@@ -89,7 +139,8 @@ extern int create_persconffile_dir(char **pf_dir_path_return);
* exists; if it does, we return that, so that configuration files
* from earlier versions can be read.
*/
-extern char *get_persconffile_path(const char *filename, gboolean for_writing);
+extern char *get_persconffile_path(const char *filename, gboolean from_profile,
+ gboolean for_writing);
/*
* Get the (default) directory in which personal data is stored.