diff options
author | Gerald Combs <gerald@wireshark.org> | 2022-02-20 12:09:34 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2022-04-04 09:39:27 -0700 |
commit | 3086774fa69b1732ccc737951e87d68c81fef108 (patch) | |
tree | c7afb76cb90072cad685d6e465e80d290960dc89 /wsutil/filesystem.h | |
parent | 6d2ab6900ff68726e1b59fe3c2056f814f386f9c (diff) |
wsutil: Add configuration namespaces.
Rename init_progfile_dir to configuration_init. Add an argument which
specifies our configuration namespace, which can be "Wireshark"
(default) or "Logwolf".
Diffstat (limited to 'wsutil/filesystem.h')
-rw-r--r-- | wsutil/filesystem.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/wsutil/filesystem.h b/wsutil/filesystem.h index b3acd76807..8d276f3d99 100644 --- a/wsutil/filesystem.h +++ b/wsutil/filesystem.h @@ -22,13 +22,22 @@ extern "C" { */ #define DEFAULT_PROFILE "Default" - -/* +/** + * Initialize our configuration environment. + * * 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. + * and save it for future use. + * + * Set our configuration namespace, which determines the top-level + * configuration directory name and environment variable prefixes. + * Default is "Wireshark". + * + * @param arg0 Executable name hint. Should be argv[0]. + * @param namespace_name The namespace to use. "Wireshark" or NULL uses + * the Wireshark namespace. "Logwolf" uses the Logwolf namespace. + * @return NULL on success, and a g_mallocated string containing an error on failure. */ -WS_DLL_PUBLIC char *init_progfile_dir(const char *arg0); +WS_DLL_PUBLIC char *configuration_init(const char *arg0, const char *namespace_name); /* * Get the directory in which the program resides. @@ -37,7 +46,7 @@ WS_DLL_PUBLIC const char *get_progfile_dir(void); /* * Get the directory in which plugins are stored; this must not be called - * before init_progfile_dir() is called, as they might be stored in a + * before configuration_init() is called, as they might be stored in a * subdirectory of the program file directory. */ WS_DLL_PUBLIC const char *get_plugins_dir(void); @@ -59,7 +68,7 @@ WS_DLL_PUBLIC const char *get_plugins_pers_dir_with_version(void); /* * Get the directory in which extcap hooks are stored; this must not be called - * before init_progfile_dir() is called, as they might be stored in a + * before configuration_init() is called, as they might be stored in a * subdirectory of the program file directory. */ WS_DLL_PUBLIC const char *get_extcap_dir(void); |