23#define DEFAULT_PROFILE "Default"
76WS_DLL_PUBLIC
const char *
get_plugins_dir(
const char* app_env_var_prefix);
121WS_DLL_PUBLIC
const char *
get_extcap_dir(
const char* app_env_var_prefix,
const char* dir_extcap);
168WS_DLL_PUBLIC
char *
get_datafile_path(
const char *filename,
const char* app_env_var_prefix);
179WS_DLL_PUBLIC
const char *
get_doc_dir(
const char* app_env_var_prefix);
194WS_DLL_PUBLIC
char *
get_docfile_path(
const char *filename,
const char* app_env_var_prefix);
209WS_DLL_PUBLIC
char *
doc_file_url(
const char *filename,
const char* app_env_var_prefix);
289WS_DLL_PUBLIC
char *
get_profile_dir(
const char* app_env_var_prefix,
const char *profilename,
bool is_global);
305WS_DLL_PUBLIC
int create_profiles_dir(
const char* app_env_var_prefix,
char **pf_dir_path_return);
350WS_DLL_PUBLIC
bool profile_exists(
const char* app_env_var_prefix,
const char *profilename,
bool global);
367 char **pf_dir_path_return);
396 char **pf_dir_path_return);
416 char **pf_from_dir_path_return,
417 char **pf_to_dir_path_return);
439 char **pf_filename_return,
440 char **pf_to_dir_path_return,
441 char **pf_from_dir_path_return);
472WS_DLL_PUBLIC
char *
get_persconffile_path(
const char *filename,
bool from_profile,
const char* app_env_var_prefix);
548WS_DLL_PUBLIC
const char *
get_basename(
const char *path);
654WS_DLL_PUBLIC
bool files_identical(
const char *fname1,
const char *fname2);
686 const void *content,
size_t content_len);
703 const char *to_filename);
718WS_DLL_PUBLIC
char*
data_file_url(
const char *filename,
const char* app_env_var_prefix);
WS_DLL_PUBLIC char * doc_file_url(const char *filename, const char *app_env_var_prefix)
Constructs the URL path to a global documentation file.
Definition filesystem.c:2695
WS_DLL_PUBLIC char * get_profiles_dir(const char *app_env_var_prefix)
Gets the directory used to store configuration profile directories.
Definition filesystem.c:1656
WS_DLL_PUBLIC const char * get_basename(const char *path)
Returns the last component of a pathname.
Definition filesystem.c:106
WS_DLL_PUBLIC int test_for_fifo(const char *path)
Tests whether a given pathname refers to a FIFO (named pipe).
Definition filesystem.c:187
WS_DLL_PUBLIC const char * get_persdatafile_dir(void)
Gets the default directory in which personal data is stored.
Definition filesystem.c:2090
WS_DLL_PUBLIC char * get_dirname(char *path)
Returns the directory portion of a pathname.
Definition filesystem.c:133
WS_DLL_PUBLIC const char * get_profile_name(void)
Gets the current configuration profile name used for storing personal configuration files.
Definition filesystem.c:1438
WS_DLL_PUBLIC int copy_persconffile_profile(const char *app_env_var_prefix, const char *toname, const char *fromname, bool from_global, char **pf_filename_return, char **pf_to_dir_path_return, char **pf_from_dir_path_return)
Copies configuration files from one profile to another.
Definition filesystem.c:2030
WS_DLL_PUBLIC char * configuration_init(const char *arg0, const char *app_flavor_lower)
Initialize our configuration environment.
Definition filesystem.c:901
WS_DLL_PUBLIC int delete_persconffile_profile(const char *app_env_var_prefix, const char *profilename, char **pf_dir_path_return)
Deletes the directory for the given configuration profile.
Definition filesystem.c:1881
WS_DLL_PUBLIC void set_profile_name(const char *profilename)
Sets the configuration profile name for storing personal configuration files.
Definition filesystem.c:1424
WS_DLL_PUBLIC char * get_docfile_path(const char *filename, const char *app_env_var_prefix)
Constructs the full path to a global documentation file.
Definition filesystem.c:2201
WS_DLL_PUBLIC void set_persconffile_dir(const char *p)
Sets the path of the personal configuration file directory.
Definition filesystem.c:1649
WS_DLL_PUBLIC void set_persdatafile_dir(const char *p)
Sets the path of the directory in which personal data is stored.
Definition filesystem.c:2133
WS_DLL_PUBLIC const char * get_plugins_dir_with_version(const char *app_env_var_prefix)
Append VERSION_MAJOR.VERSION_MINOR to the plugin dir.
Definition filesystem.c:1247
WS_DLL_PUBLIC char * get_global_profiles_dir(const char *app_env_var_prefix)
Gets the directory used to store global configuration profile directories.
Definition filesystem.c:1702
WS_DLL_PUBLIC bool has_global_profiles(const char *app_env_var_prefix)
Checks whether global configuration profiles are available.
Definition filesystem.c:1454
WS_DLL_PUBLIC const char * get_progfile_dir(void)
Get the directory in which the main (Wireshark, TShark, Stratoshark, etc) program resides.
Definition filesystem.c:914
WS_DLL_PUBLIC bool copy_file_binary_mode(const char *from_filename, const char *to_filename)
Copies a file using binary mode.
Definition filesystem.c:2611
WS_DLL_PUBLIC const char * get_doc_dir(const char *app_env_var_prefix)
Gets the directory in which global documentation files are stored.
WS_DLL_PUBLIC bool config_file_exists_with_entries(const char *fname, char comment_char)
Checks if a configuration file exists and contains non-comment entries.
Definition filesystem.c:2369
WS_DLL_PUBLIC const char * get_plugins_dir(const char *app_env_var_prefix)
Get the directory in which plugins are stored.
Definition filesystem.c:1239
WS_DLL_PUBLIC bool files_identical(const char *fname1, const char *fname2)
Checks whether two filenames refer to the same file.
Definition filesystem.c:2407
WS_DLL_PUBLIC char * data_file_url(const char *filename, const char *app_env_var_prefix)
Constructs a filesystem URL from a given filename.
Definition filesystem.c:2674
WS_DLL_PUBLIC bool file_exists(const char *fname)
Checks whether a file exists.
Definition filesystem.c:2354
WS_DLL_PUBLIC WS_RETNONNULL const char * get_current_working_dir(void)
Gets the current working directory.
Definition filesystem.c:920
WS_DLL_PUBLIC const char * get_extcap_pers_dir(const char *app_env_var_prefix)
Gets the personal extcap directory.
Definition filesystem.c:1390
WS_DLL_PUBLIC char * get_executable_path(const char *filename)
Given the program name, construct the path name of a non-extcap Wireshark executable file.
Definition filesystem.c:530
WS_DLL_PUBLIC int create_persconffile_profile(const char *app_env_var_prefix, const char *profilename, char **pf_dir_path_return)
Creates a directory for the given configuration profile.
Definition filesystem.c:1927
WS_DLL_PUBLIC int rename_persconffile_profile(const char *app_env_var_prefix, const char *fromname, const char *toname, char **pf_from_dir_path_return, char **pf_to_dir_path_return)
Renames the directory for the given configuration profile.
Definition filesystem.c:1899
WS_DLL_PUBLIC void free_progdirs(void)
Frees internal program directory structures.
Definition filesystem.c:2716
WS_DLL_PUBLIC const char * get_extcap_dir(const char *app_env_var_prefix, const char *dir_extcap)
Gets the directory in which extcap hooks are stored.
Definition filesystem.c:1381
WS_DLL_PUBLIC int create_persconffile_dir(const char *app_env_var_prefix, char **pf_dir_path_return)
Creates the directory that holds personal configuration files, if necessary.
Definition filesystem.c:2024
WS_DLL_PUBLIC bool file_needs_reopen(int fd, const char *filename)
Checks whether a file has been recreated since it was opened.
Definition filesystem.c:2480
WS_DLL_PUBLIC char * get_datafile_path(const char *filename, const char *app_env_var_prefix)
Constructs the full path to a global configuration file.
Definition filesystem.c:2179
WS_DLL_PUBLIC const char * get_datafile_dir(const char *app_env_var_prefix)
Gets the directory in which global configuration files are stored.
Definition filesystem.c:982
WS_DLL_PUBLIC int test_for_directory(const char *path)
Tests whether a given pathname refers to a directory.
Definition filesystem.c:173
WS_DLL_PUBLIC bool running_in_build_directory(void)
Indicates whether Wireshark is running from a build directory.
Definition filesystem.c:1402
WS_DLL_PUBLIC int create_profiles_dir(const char *app_env_var_prefix, char **pf_dir_path_return)
Creates the directory used to store configuration profile directories.
Definition filesystem.c:1663
WS_DLL_PUBLIC const char * get_systemfile_dir(const char *app_env_var_prefix)
Gets the directory in which system files are stored.
WS_DLL_PUBLIC char * get_profile_dir(const char *app_env_var_prefix, const char *profilename, bool is_global)
Gets the directory used to store configuration files for a given profile.
Definition filesystem.c:1727
WS_DLL_PUBLIC void profile_register_persconffile(const char *filename)
Registers a filename to the personal configuration files storage.
Definition filesystem.c:1491
WS_DLL_PUBLIC const char * file_open_error_message(int err, bool for_writing)
Returns a human-readable error message for file open or create failures.
Definition filesystem.c:2220
WS_DLL_PUBLIC const char * file_write_error_message(int err)
Returns a human-readable error message for write operation failures.
Definition filesystem.c:2325
WS_DLL_PUBLIC const char * get_plugins_pers_dir_with_version(const char *app_env_var_prefix)
Appends VERSION_MAJOR.VERSION_MINOR to the personal plugin directory path.
Definition filesystem.c:1266
WS_DLL_PUBLIC bool profile_exists(const char *app_env_var_prefix, const char *profilename, bool global)
Checks whether a given configuration profile exists.
Definition filesystem.c:1753
WS_DLL_PUBLIC char * get_persconffile_path(const char *filename, bool from_profile, const char *app_env_var_prefix)
Constructs the full path name of a personal configuration file.
Definition filesystem.c:2153
WS_DLL_PUBLIC bool write_file_binary_mode(const char *filename, const void *content, size_t content_len)
Writes raw content to a file in binary mode.
Definition filesystem.c:2545
WS_DLL_PUBLIC const GHashTable * allowed_profile_filenames(void)
Returns the list of known profile configuration filenames.
Definition filesystem.c:2018
WS_DLL_PUBLIC void profile_store_persconffiles(bool store)
Enables or disables tracking of personal configuration file names for profile duplication.
Definition filesystem.c:1482
WS_DLL_PUBLIC bool is_default_profile(void)
Checks whether the current configuration profile is the default profile.
Definition filesystem.c:1448
WS_DLL_PUBLIC char * find_last_pathname_separator(const char *path)
Returns a pointer to the last pathname separator in a given path.
Definition filesystem.c:73
WS_DLL_PUBLIC bool test_for_regular_file(const char *path)
Tests whether a given pathname refers to a regular file.
Definition filesystem.c:201
WS_DLL_PUBLIC const char * get_plugins_pers_dir(const char *app_env_var_prefix)
Gets the personal plugin directory.
Definition filesystem.c:1258