13#include "ws_symbol_export.h"
90typedef const char* (*pref_custom_type_name_cb)(void);
96typedef char* (*pref_custom_type_description_cb)(void);
111typedef char* (*pref_custom_to_str_cb)(
pref_t* pref,
bool default_val);
292 void* user_data,
bool skip_obsolete);
323 bool return_range_errors,
unsigned int *changed_flags);
WS_DLL_PUBLIC const char * prefs_get_name(pref_t *pref)
Fetch the name of a preference.
Definition prefs.c:282
WS_DLL_PUBLIC unsigned prefs_module_list_foreach(const wmem_tree_t *module_list, module_cb callback, void *user_data, bool skip_obsolete)
Iterate through all modules with preferences.
Definition prefs.c:862
WS_DLL_PUBLIC unsigned int prefs_set_int_value(pref_t *pref, int value, pref_source_t source)
Set an integer preference value.
Definition prefs.c:5074
WS_DLL_PUBLIC unsigned prefs_get_uint_base(pref_t *pref)
Get the base value of an unsigned integer preference.
Definition prefs.c:5220
WS_DLL_PUBLIC void prefs_set_effect_flags(pref_t *pref, unsigned int flags)
Set flags for the effect of the preference.
Definition prefs.c:6320
WS_DLL_PUBLIC bool prefs_set_range_value(pref_t *pref, range_t *value, pref_source_t source)
Set a range value for a preference.
Definition prefs.c:1750
WS_DLL_PUBLIC void prefs_set_effect_flags_by_name(module_t *module, const char *pref, unsigned int flags)
Same as prefs_set_effect_flags, just different way to get preference.
Definition prefs.c:6331
WS_DLL_PUBLIC unsigned int prefs_set_enum_value(pref_t *pref, int value, pref_source_t source)
Set an enum preference value.
Definition prefs.c:1379
WS_DLL_PUBLIC const char * prefs_get_string_value(pref_t *pref, pref_source_t source)
Get the string value of a preference.
Definition prefs.c:1557
WS_DLL_PUBLIC unsigned pref_unstash(pref_t *pref, void *unstash_data_p)
"Unstash" a preference. Set a preference to its stashed value. Can be called from prefs_pref_foreach(...
Definition prefs.c:2165
WS_DLL_PUBLIC char * join_string_list(GList *sl)
Convert a string list preference to a preference string.
Definition prefs.c:4192
WS_DLL_PUBLIC bool prefs_pref_is_default(pref_t *pref)
Check if a preference is at its default value.
Definition prefs.c:6486
WS_DLL_PUBLIC bool prefs_set_color_value(pref_t *pref, color_t value, pref_source_t source)
Set a color value for a preference.
Definition prefs.c:1870
struct pref_unstash_data pref_unstash_data_t
Carries context data used when unstashing preferences back to their live values.
prefs_set_pref_e(* pref_set_pair_cb)(char *key, const char *value, void *private_data, bool return_range_errors)
Set a preference based on a key-value pair.
Definition prefs-int.h:184
char *(* pref_custom_type_description_cb)(void)
Callback that returns a newly allocated human-readable description of a custom preference type.
Definition prefs-int.h:96
WS_DLL_PUBLIC struct epan_uat * prefs_get_uat_value(pref_t *pref)
Get the UAT value for a preference.
Definition prefs.c:1851
WS_DLL_PUBLIC GList * prefs_get_list_value(pref_t *pref, pref_source_t source)
Get the list value for a preference based on the source.
Definition prefs.c:1732
WS_DLL_PUBLIC void prefs_set_module_effect_flags(module_t *module, unsigned int flags)
Set flags for module's preferences effect.
Definition prefs.c:6346
WS_DLL_PUBLIC const char * prefs_get_password_value(pref_t *pref, pref_source_t source)
Get the password value for a preference.
Definition prefs.c:5173
WS_DLL_PUBLIC void reset_pref(pref_t *pref)
Reset a preference to its default value.
Definition prefs.c:4443
WS_DLL_PUBLIC bool prefs_get_bool_value(pref_t *pref, pref_source_t source)
Get the boolean value of a preference.
Definition prefs.c:1326
WS_DLL_PUBLIC unsigned int prefs_get_module_effect_flags(module_t *module)
Fetch flags that show module's preferences effect.
Definition prefs.c:6337
WS_DLL_PUBLIC const enum_val_t * prefs_get_enumvals(pref_t *pref)
Get the enumeration values for a preference.
Definition prefs.c:1436
WS_DLL_PUBLIC uint32_t prefs_get_max_value(pref_t *pref)
Fetches the maximum value for a preference.
Definition prefs.c:287
WS_DLL_PUBLIC int prefs_get_type(pref_t *pref)
Retrieves the type of a preference.
Definition prefs.c:277
WS_DLL_PUBLIC double prefs_get_float_value(pref_t *pref, pref_source_t source)
Get the float value of a preference.
Definition prefs.c:5154
WS_DLL_PUBLIC const wmem_tree_t * prefs_get_module_tree(void)
Get the list of all modules with preferences (used for iterating through all preferences)
Definition prefs.c:340
WS_DLL_PUBLIC bool prefs_get_enum_radiobuttons(pref_t *pref)
Get the radio button values for an enumeration preference.
Definition prefs.c:1441
WS_DLL_PUBLIC const char * prefs_get_title(pref_t *pref)
Get the title of a preference.
Definition prefs.c:272
WS_DLL_PUBLIC void prefs_range_remove_value(pref_t *pref, uint32_t val)
Remove a range value of a range preference.
Definition prefs.c:1819
WS_DLL_PUBLIC unsigned prefs_get_uint_value(pref_t *pref, pref_source_t source)
Get the unsigned integer value of a preference.
Definition prefs.c:5056
WS_DLL_PUBLIC char * prefs_sanitize_string(const char *str)
Sanitize a string so that it can be written to a preference file.
Definition prefs.c:4993
WS_DLL_PUBLIC color_t * prefs_get_color_value(pref_t *pref, pref_source_t source)
Get the color value for a preference based on the specified source.
Definition prefs.c:1908
WS_DLL_PUBLIC void prefs_invert_bool_value(pref_t *pref, pref_source_t source)
Inverts the boolean value of a preference based on the specified source.
Definition prefs.c:1307
WS_DLL_PUBLIC bool prefs_add_list_value(pref_t *pref, void *value, pref_source_t source)
Add a list value to a preference.
Definition prefs.c:1711
bool(* pref_custom_is_default_cb)(pref_t *pref)
Callback that reports whether a custom preference currently holds its default value.
Definition prefs-int.h:103
pref_type_e
Discriminator tag identifying the type and UI representation of a preference entry.
Definition prefs-int.h:138
@ PREF_CUSTOM
Definition prefs-int.h:148
@ PREF_COLOR
Definition prefs-int.h:147
@ PREF_BOOL
Definition prefs-int.h:140
@ PREF_OPEN_FILENAME
Definition prefs-int.h:151
@ PREF_STATIC_TEXT
Definition prefs-int.h:144
@ PREF_UAT
Definition prefs-int.h:145
@ PREF_PROTO_TCP_SNDAMB_ENUM
Definition prefs-int.h:153
@ PREF_DECODE_AS_RANGE
Definition prefs-int.h:150
@ PREF_RANGE
Definition prefs-int.h:143
@ PREF_ENUM
Definition prefs-int.h:141
@ PREF_FLOAT
Definition prefs-int.h:156
@ PREF_PASSWORD
Definition prefs-int.h:152
@ PREF_DISSECTOR
Definition prefs-int.h:154
@ PREF_STRING
Definition prefs-int.h:142
@ PREF_SAVE_FILENAME
Definition prefs-int.h:146
@ PREF_UINT
Definition prefs-int.h:139
@ PREF_INT
Definition prefs-int.h:155
@ PREF_DIRNAME
Definition prefs-int.h:149
WS_DLL_PUBLIC unsigned pref_stash(pref_t *pref, void *unused)
"Stash" a preference. Copy a preference to its stashed value. Can be called from prefs_pref_foreach()...
void(* pref_custom_reset_cb)(pref_t *pref)
Callback invoked to reset a custom preference to its default value.
Definition prefs-int.h:73
WS_DLL_PUBLIC int read_prefs_file(const char *pf_path, FILE *pf, pref_set_pair_cb pref_set_pair_fct, void *private_data)
Read the preferences file (or similar) and call the callback function to set each key/value pair foun...
Definition prefs.c:4758
WS_DLL_PUBLIC void reset_stashed_pref(pref_t *pref)
Set a stashed preference to its default value.
Definition prefs.c:2332
WS_DLL_PUBLIC int prefs_get_int_value(pref_t *pref, pref_source_t source)
Get the integer value of a preference based on the specified source.
Definition prefs.c:5105
WS_DLL_PUBLIC unsigned int prefs_set_string_value(pref_t *pref, const char *value, pref_source_t source)
Set a string value for a preference.
Definition prefs.c:1511
WS_DLL_PUBLIC unsigned int prefs_set_custom_value(pref_t *pref, const char *value, pref_source_t source)
Set a custom value for a preference.
Definition prefs.c:1450
WS_DLL_PUBLIC range_t * prefs_get_range_value_real(pref_t *pref, pref_source_t source)
Get the range value for a preference based on the specified source.
Definition prefs.c:1785
WS_DLL_PUBLIC unsigned int prefs_set_enum_string_value(pref_t *pref, const char *value, pref_source_t source)
Set an enum value for a preference.
Definition prefs.c:1411
WS_DLL_PUBLIC void prefs_range_add_value(pref_t *pref, uint32_t val)
Add a range value of a range preference.
Definition prefs.c:1813
WS_DLL_PUBLIC bool prefs_set_range_value_work(pref_t *pref, const char *value, bool return_range_errors, unsigned int *changed_flags)
Set a range value for a range preference.
Definition prefs.c:1668
WS_DLL_PUBLIC unsigned int prefs_get_effect_flags(pref_t *pref)
Fetch flags that show the effect of the preference.
Definition prefs.c:6311
WS_DLL_PUBLIC unsigned pref_clean_stash(pref_t *pref, void *unused)
Clean up a stashed preference. Can be called from prefs_pref_foreach().
char *(* pref_custom_to_str_cb)(pref_t *pref, bool default_val)
Callback that serializes a custom preference to a newly allocated string.
Definition prefs-int.h:111
WS_DLL_PUBLIC bool prefs_add_decode_as_value(pref_t *pref, unsigned value, bool replace)
Adds or replaces a decode-as value for a preference.
Definition prefs.c:2034
prefs_set_pref_e(* pref_custom_set_cb)(pref_t *pref, const char *value, unsigned int *changed_flags)
Callback invoked to set a custom preference from a string value, reporting which flags changed.
Definition prefs-int.h:82
WS_DLL_PUBLIC unsigned int prefs_set_stashed_range_value(pref_t *pref, const char *value)
Set a stashed range value for a preference.
Definition prefs.c:1692
const char *(* pref_custom_type_name_cb)(void)
Callback that returns the type name string for a custom preference; returns NULL for internal or hidd...
Definition prefs-int.h:90
void(* pref_custom_free_cb)(pref_t *pref)
Callback invoked to free any resources allocated by a custom preference.
Definition prefs-int.h:67
WS_DLL_PUBLIC void prefs_read_module(const char *name, const char *app_env_var_prefix)
Read the preferences for a specific module.
Definition prefs.c:4606
WS_DLL_PUBLIC unsigned int prefs_set_password_value(pref_t *pref, const char *value, pref_source_t source)
Set a password value for a preference.
Definition prefs.c:5214
WS_DLL_PUBLIC bool prefs_remove_decode_as_value(pref_t *pref, unsigned value, bool set_default)
Removes a decode-as value from a preference.
Definition prefs.c:2059
WS_DLL_PUBLIC int prefs_get_enum_value(pref_t *pref, pref_source_t source)
Get the current value of an enumeration preference.
Definition prefs.c:1418
WS_DLL_PUBLIC unsigned int prefs_set_float_value(pref_t *pref, double value, pref_source_t source)
Set a float value for a preference.
Definition prefs.c:5123
WS_DLL_PUBLIC const char * prefs_get_description(pref_t *pref)
Get the description of a preference.
Definition prefs.c:267
WS_DLL_PUBLIC unsigned int prefs_set_uint_value(pref_t *pref, unsigned value, pref_source_t source)
Set an unsigned integer preference value.
Definition prefs.c:5179
WS_DLL_PUBLIC unsigned int prefs_set_bool_value(pref_t *pref, bool value, pref_source_t source)
Set a boolean preference value.
Definition prefs.c:1275
pref_source_t
Selects which copy of a preference value is used as the active source.
Definition prefs.h:140
unsigned(* module_cb)(module_t *module, void *user_data)
Definition prefs.h:536
prefs_set_pref_e
Result of setting a preference.
Definition prefs.h:1271
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Internal representation of a wmem balanced tree.
Definition wmem_tree-int.h:81
RGB color representation with 16-bit precision per channel.
Definition color.h:27
Defines a single named value within an enumerated preference or option type.
Definition params.h:16
Represents a User Accessible Table (UAT), managing a set of user-editable records exposed to a dissec...
Definition uat-int.h:44
char * name
Definition uat-int.h:45
Callback table for a PREF_CUSTOM preference, providing lifecycle and serialization hooks.
Definition prefs-int.h:116
pref_custom_reset_cb reset_cb
Definition prefs-int.h:118
pref_custom_is_default_cb is_default_cb
Definition prefs-int.h:123
pref_custom_type_description_cb type_description_cb
Definition prefs-int.h:122
pref_custom_type_name_cb type_name_cb
Definition prefs-int.h:121
pref_custom_set_cb set_cb
Definition prefs-int.h:119
pref_custom_free_cb free_cb
Definition prefs-int.h:117
pref_custom_to_str_cb to_str_cb
Definition prefs-int.h:124
Represents a preference module grouping related preferences under a named, hierarchical entry in the ...
Definition prefs-int.h:27
unsigned int effect_flags
Definition prefs-int.h:49
wmem_allocator_t * scope
Definition prefs-int.h:33
GList * prefs
Definition prefs-int.h:34
bool use_gui
Definition prefs-int.h:42
wmem_tree_t * submodules
Definition prefs-int.h:36
const char * description
Definition prefs-int.h:30
const char * name
Definition prefs-int.h:28
bool obsolete
Definition prefs-int.h:39
struct pref_module * parent
Definition prefs-int.h:35
unsigned int prefs_changed_flags
Definition prefs-int.h:38
void(* apply_cb)(void)
Definition prefs-int.h:32
int numprefs
Definition prefs-int.h:37
const char * title
Definition prefs-int.h:29
const char * help
Definition prefs-int.h:31
Carries context data used when unstashing preferences back to their live values.
Definition prefs-int.h:691
module_t *bool handle_decode_as
Definition prefs-int.h:694
Bundles a preference module with a file handle for use during preference serialization.
Definition prefs-int.h:57
module_t *FILE * pf
Definition prefs-int.h:59