| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Classes | Typedefs | Functions
ui_prefs.h File Reference
`#include <epan/prefs.h>`
`#include <epan/prefs-int.h>`

Go to the source code of this file.

## Classes
struct | ui_prefs_write_pref_arg_t
| Argument bundle passed to the preference writer callback when saving UI preferences to a file. More...

## Typedefs
typedef pref_t *(* | ui_pref_deprecated_cb) (module_t *module, const char *name)

## Functions
void | ui_prefs_init (void)
| Initialize the UI preferences component.
void | ui_prefs_cleanup (void)
| Cleanup the UI preferences component.
module_t * | ui_prefs_register_module (const char *name, const char *title, const char *description, const char *help, void(*apply_cb)(void), ui_pref_deprecated_cb depr_callback)
| Register a UI component that will have preferences.
void | ui_prefs_deregister_module (module_t *module)
| Unregister a UI component that will have preferences.
unsigned | ui_prefs_write_module (module_t *module, void *user_data)
| Write out all preferences for a UI module.
prefs_set_pref_e | ui_prefs_read_pref (char *pref_name, const char *value, void *private_data, bool return_range_errors)
| Read a preference value from the UI.

## Detailed Description

Routines for UI preferences

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

## Function Documentation

## ◆ ui_prefs_cleanup()

void ui_prefs_cleanup | ( | void |  | ) |

Cleanup the UI preferences component.

This function cleans up the resources used by the UI preferences component.

## ◆ ui_prefs_deregister_module()

void ui_prefs_deregister_module | ( | module_t * | module | ) |

Unregister a UI component that will have preferences.

Done when the component is removed.

Parameters

  module | Module to deregister

## ◆ ui_prefs_init()

void ui_prefs_init | ( | void |  | ) |

Initialize the UI preferences component.

This function initializes the necessary data structures and resources for managing UI preferences.

## ◆ ui_prefs_read_pref()

prefs_set_pref_e ui_prefs_read_pref | ( | char * | pref_name,
|  | const char * | value,
|  | void * | private_data,
|  | bool | return_range_errors )

Read a preference value from the UI.

This function reads a preference value from the user interface and stores it in the provided buffer.

Parameters

  pref_name | The name of the preference to read.
  value | A pointer to a buffer where the preference value will be stored.
  private_data | User-defined data passed to the callback function.
  return_range_errors | If true, return an error if the value is out of range.

Returns
  void

## ◆ ui_prefs_register_module()

module_t * ui_prefs_register_module | ( | const char * | name,
|  | const char * | title,
|  | const char * | description,
|  | const char * | help,
|  | void(* | apply_cb )(void),
|  | ui_pref_deprecated_cb | depr_callback )

Register a UI component that will have preferences.

Specify the module under which to register it, the name used for the module in the preferences file, the title used in the tab for it in a preferences dialog box, and a routine to call back when the preferences are applied.

Parameters

  name | is a name for the module to use on the command line with "-o" and in preference files.
  title | the module title in the preferences UI
  description | the description included in the preferences file and shown as tooltip in the GUI, or NULL
  help | The help string associated with the module, or NULL
  apply_cb | Callback routine that is called when preferences are applied. It may be NULL, which inhibits the callback.
  depr_callback | Optional Callback routine that is called when a preference name string isn't found when reading a preference file. It may be NULL.

Returns
  a preferences module which can be used to register a user 'preference'

## ◆ ui_prefs_write_module()

unsigned ui_prefs_write_module | ( | module_t * | module,
|  | void * | user_data )

Write out all preferences for a UI module.

Parameters

  module | Module containing preferences
  user_data | ui_prefs_write_pref_arg_t pointer

Returns
  0 on success, non-zero on failure