2 * Routines for handling preferences
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0+
11 #ifndef __PREFRENCE_UTILS_H__
12 #define __PREFRENCE_UTILS_H__
16 #endif /* __cplusplus */
19 * Preference utility routines.
20 * @ingroup prefs_group
23 /** If autoscroll in live captures is active or not
25 extern gboolean auto_scroll_live;
27 /** Fill in capture options with values from the preferences
29 extern void prefs_to_capture_opts(void);
31 /** Save all preferences
33 extern void prefs_main_write(void);
35 /** Convenient function for plugin_if
37 * Note: The preferences must exist, it is not possible to create entries
40 * @param module the module for the preference
41 * @param key the key for the preference
42 * @param value the new value as string for the preference
44 * @return flags of types of preferences changed, non-zero if the value has been stored successfully
46 extern unsigned int prefs_store_ext(const char * module, const char * key, const char * value);
48 /** Convenient function for the writing of multiple preferences, without
49 * explicitly having prefs_t variables.
51 * Note: The preferences must exist, it is not possible to create entries
54 * @param module the module for the preference
55 * @param pref_values a hash table
57 * @return true if the value has been stored successfully
59 extern gboolean prefs_store_ext_multiple(const char * module, GHashTable * pref_values);
61 /** Add a custom column.
63 * @param fmt column format
64 * @param title column title
65 * @param custom_field column custom field
66 * @param custom_occurrence custom occurrence
68 * @return The index of the inserted column
70 gint column_prefs_add_custom(gint fmt, const gchar *title,
71 const gchar *custom_field,
72 gint custom_occurrence);
76 * @param col_link Column list entry
78 void column_prefs_remove_link(GList* col_link);
82 * @param col Column number
84 void column_prefs_remove_nth(gint col);
89 #endif /* __cplusplus */
91 #endif /* __PREFRENCE_UTILS_H__ */
94 * Editor modelines - https://www.wireshark.org/tools/modelines.html
99 * indent-tabs-mode: nil
102 * ex: set shiftwidth=4 tabstop=8 expandtab:
103 * :indentSize=4:tabSize=8:noTabs=true: