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);
664#define WS_FILENAME_RESERVED_PRINTABLE_CHARS "<>:\"/\\|?*"
673#define WS_FILENAME_RESERVED_CHARS WS_FILENAME_RESERVED_PRINTABLE_CHARS \
674 "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a" \
675 "\x0b\x0c\x0d\x0e\x0f\x10\x11\x12\x13\x14" \
676 "\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"
733 const void *content,
size_t content_len);
750 const char *to_filename);
765WS_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:2835
WS_DLL_PUBLIC unsigned files_identical_hash(const void *fname)
Create hash value using same metrics as files_identical().
Definition filesystem.c:2602
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:1693
WS_DLL_PUBLIC const char * get_basename(const char *path)
Returns the last component of a pathname.
Definition filesystem.c:109
WS_DLL_PUBLIC int test_for_fifo(const char *path)
Tests whether a given pathname refers to a FIFO (named pipe).
Definition filesystem.c:190
WS_DLL_PUBLIC const char * get_persdatafile_dir(void)
Gets the default directory in which personal data is stored.
Definition filesystem.c:2206
WS_DLL_PUBLIC char * get_dirname(char *path)
Returns the directory portion of a pathname.
Definition filesystem.c:136
WS_DLL_PUBLIC const char * get_profile_name(void)
Gets the current configuration profile name used for storing personal configuration files.
Definition filesystem.c:1469
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:2132
WS_DLL_PUBLIC char * configuration_init(const char *arg0, const char *app_flavor_lower)
Initialize our configuration environment.
Definition filesystem.c:927
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:1959
WS_DLL_PUBLIC void set_profile_name(const char *profilename)
Sets the configuration profile name for storing personal configuration files.
Definition filesystem.c:1455
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:2317
WS_DLL_PUBLIC void set_persconffile_dir(const char *p)
Sets the path of the personal configuration file directory.
Definition filesystem.c:1686
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:2249
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:1281
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:1765
WS_DLL_PUBLIC bool has_global_profiles(const char *app_env_var_prefix)
Checks whether global configuration profiles are available.
Definition filesystem.c:1485
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:940
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:2744
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:2494
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:1273
WS_DLL_PUBLIC bool files_identical(const char *fname1, const char *fname2)
Checks whether two filenames refer to the same file.
Definition filesystem.c:2613
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:2814
WS_DLL_PUBLIC bool file_exists(const char *fname)
Checks whether a file exists.
Definition filesystem.c:2470
WS_DLL_PUBLIC WS_RETNONNULL const char * get_current_working_dir(void)
Gets the current working directory.
Definition filesystem.c:946
WS_DLL_PUBLIC const char * get_extcap_pers_dir(const char *app_env_var_prefix)
Gets the personal extcap directory.
Definition filesystem.c:1419
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:537
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:2022
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:1983
WS_DLL_PUBLIC void free_progdirs(void)
Frees internal program directory structures.
Definition filesystem.c:2856
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:1410
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:2126
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:2627
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:2295
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:1008
WS_DLL_PUBLIC int test_for_directory(const char *path)
Tests whether a given pathname refers to a directory.
Definition filesystem.c:176
WS_DLL_PUBLIC bool running_in_build_directory(void)
Indicates whether Wireshark is running from a build directory.
Definition filesystem.c:1431
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:1726
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:1815
WS_DLL_PUBLIC void profile_register_persconffile(const char *filename)
Registers a filename to the personal configuration files storage.
Definition filesystem.c:1522
WS_DLL_PUBLIC char * filename_sanitize(const char *name, char replacement)
Returns a copy of a file name with every WS_FILENAME_RESERVED_CHARS character replaced.
Definition filesystem.c:2486
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:2336
WS_DLL_PUBLIC const char * file_write_error_message(int err)
Returns a human-readable error message for write operation failures.
Definition filesystem.c:2441
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:1300
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:1821
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:2269
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:2678
WS_DLL_PUBLIC const GHashTable * allowed_profile_filenames(void)
Returns the list of known profile configuration filenames.
Definition filesystem.c:2120
WS_DLL_PUBLIC void profile_store_persconffiles(bool store)
Enables or disables tracking of personal configuration file names for profile duplication.
Definition filesystem.c:1513
WS_DLL_PUBLIC bool is_default_profile(void)
Checks whether the current configuration profile is the default profile.
Definition filesystem.c:1479
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:76
WS_DLL_PUBLIC bool test_for_regular_file(const char *path)
Tests whether a given pathname refers to a regular file.
Definition filesystem.c:204
WS_DLL_PUBLIC const char * get_plugins_pers_dir(const char *app_env_var_prefix)
Gets the personal plugin directory.
Definition filesystem.c:1292