Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
ui_prefs.h
Go to the documentation of this file.
1
12#ifndef __UI_PREFERENCES_H__
13#define __UI_PREFERENCES_H__
14
15#include <epan/prefs.h>
16#include <epan/prefs-int.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif /* __cplusplus */
21
22/* Initialize the UI preferences component */
23void ui_prefs_init(void);
24
25/* Cleanup the UI preferences component */
26void ui_prefs_cleanup(void);
27
28typedef pref_t* (*ui_pref_deprecated_cb)(module_t* module, const char* name);
29
30/*
31 * Register a UI component that will have preferences.
32 * Specify the module under which to register it, the name used for the
33 * module in the preferences file, the title used in the tab for it
34 * in a preferences dialog box, and a routine to call back when the
35 * preferences are applied.
36 *
37 * @param name is a name for the module to use on the command line with "-o"
38 * and in preference files.
39 * @param title the module title in the preferences UI
40 * @param description the description included in the preferences file
41 * and shown as tooltip in the GUI, or NULL
42 * @param help The help string associated with the module, or NULL
43 * @param apply_cb Callback routine that is called when preferences are
44 * applied. It may be NULL, which inhibits the callback.
45 * @param depr_callback Optional Callback routine that is called when a preference
46 * name string isn't found when reading a preference file.
47 * It may be NULL.
48 * @return a preferences module which can be used to register a user 'preference'
49 */
51ui_prefs_register_module(const char* name, const char* title,
52 const char* description, const char* help,
53 void (*apply_cb)(void), ui_pref_deprecated_cb depr_callback);
54
55/*
56 * Unregister a UI component that will have preferences. Done when the component
57 * is removed
58 *
59 * @param module Module to deregister
60 */
61void
62ui_prefs_deregister_module(module_t* module);
63
64typedef struct {
65 FILE* pf;
67
68/*
69 * Write out all preferences for a UI module.
70 *
71 * @param module Module containing preferences
72 * @param user_data ui_prefs_write_pref_arg_t pointer
73 */
74unsigned
75ui_prefs_write_module(module_t* module, void* user_data);
76
77
79ui_prefs_read_pref(char* pref_name, const char* value, void* private_data, bool return_range_errors);
80
81#ifdef __cplusplus
82}
83#endif /* __cplusplus */
84
85#endif /* __UI_PREFERENCES_H__ */
prefs_set_pref_e
Definition prefs.h:1149
Definition prefs-int.h:27
Definition prefs.c:201
Definition ui_prefs.h:64