/** @file * * Storage of profile information * Stig Bjorlykke , 2008 * * Wireshark - Network traffic analyzer * By Gerald Combs * Copyright 1998 Gerald Combs * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef __PROFILE_H__ #define __PROFILE_H__ #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct { char *name; /* profile name */ char *reference; /* profile reference */ bool is_global; // Settings char *auto_switch_filter; } profile_def; /** Initialize the profile list. Can be called more than once. */ void profile_init(const char* app_env_var_prefix); /** Initialize the profile list. Can be called more than once. */ void profile_sync(const char* app_env_var_prefix); /** Add a profile to the profile list * * @param name Profile name * @param parent Parent profile name * @param is_global Profile is in the global configuration directory * @param auto_switch_filter Filter to use for auto switching profiles * * @return A pointer to the new profile list */ GList* profile_add_profile(const char *name, const char *parent, bool is_global, const char* auto_switch_filter); /** Clear out the profile list */ void profile_empty_list(void); /** Edited profile list * * @return The head of the edited profile list */ GList* profile_get_list(void); /** Save the profile settings to disk * * @param name Profile name * @param app_env_var_prefix The prefix for the application environment variable used to get the global configuration directory. * @param app_name Proper name of the application (used in file comment strings) * @param err_info Optional error info string. * * @return true if the profiles were successfully saved or false otherwise. */ bool profile_save_settings(const char* name, const char* app_env_var_prefix, const char* app_name, char** err_info); /** Remove the current profile. * * @param app_env_var_prefix The prefix for the application environment variable used to get the global configuration directory. * @param err_info Optional error info string. * * @return true if the current profile exists and was successfully deleted * or false otherwise. */ bool profile_delete_current(const char* app_env_var_prefix, char** err_info); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* __PROFILE_H__ */