| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
Typedefs | Functions
feature_list.h File Reference
`#include <glib.h>`
`#include "ws_symbol_export.h"`

Go to the source code of this file.

## Typedefs
typedef GList ** | feature_list
| Semi-opaque handle to a list of features or dependencies.
typedef void(* | gather_feature_func) (feature_list l)
| Pointer to a function which gathers a list of features.
typedef const char *(* | get_version_func) (void)
| Pointer to a function which gets a version string.

## Functions
WS_DLL_PUBLIC void | with_feature (feature_list l, const char *fmt,...)
| Mark a feature as present in the provided list.
WS_DLL_PUBLIC void | without_feature (feature_list l, const char *fmt,...)
| Mark a feature as absent in the given list.
WS_DLL_PUBLIC void | sort_features (feature_list l)
| Sort a feature list alphabetically by feature name.
WS_DLL_PUBLIC void | separate_features (feature_list l, feature_list with_list, feature_list without_list)
| Split a feature list into present and absent feature subsets.
WS_DLL_PUBLIC void | free_features (feature_list l)
| Free all memory associated with a feature list.

## Detailed Description

Declarations of routines for gathering and handling lists of present/absent features (usually actually dependencies)

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

## Typedef Documentation

## ◆ feature_list

typedef GList** feature_list

Semi-opaque handle to a list of features or dependencies.

Functions that collect or modify feature sets will receive a `feature_list` handle, which can be updated via `with_feature()` or `without_feature()` calls.

Note
  Ownership and lifetime are managed by the caller; this typedef provides clarity and encapsulation for feature tracking APIs.

## Function Documentation

## ◆ free_features()

WS_DLL_PUBLIC void free_features | ( | feature_list | l | ) |

Free all memory associated with a feature list.

Releases all entries in the given `feature_list` and resets the pointer to `NULL`.

Parameters

  l | Pointer to the feature list to be freed and nulled.

## ◆ separate_features()

WS_DLL_PUBLIC void separate_features | ( | feature_list | l,
|  | feature_list | with_list,
|  | feature_list | without_list
| ) |  |

Split a feature list into present and absent feature subsets.

Iterates over the input `feature_list` and separates entries into two output lists: `with_list` for present features (prefixed with '+') and `without_list` for absent features (prefixed with '-'). The prefixes are preserved in the output lists.

Both output lists must be empty when first passed to this function.

Parameters

  l | Input feature list to be partitioned.
  with_list | Output list for present features (prefixed with '+').
  without_list | Output list for absent features (prefixed with '-').

## ◆ sort_features()

WS_DLL_PUBLIC void sort_features | ( | feature_list | l | ) |

Sort a feature list alphabetically by feature name.

Reorders the entries in the given `feature_list` in ascending alphabetical order, ignoring any leading '+' or '-' indicators.

Note
  The function is currently unused.

Parameters

  l | Mutable feature list to be sorted in-place.

## ◆ with_feature()

WS_DLL_PUBLIC void with_feature | ( | feature_list | l,
|  | const char * | fmt,
|  |  | ...
| ) |  |

Mark a feature as present in the provided list.

Parameters

  l | Mutable feature list to update.
  fmt | Format string describing the feature.
  ... | Arguments for the format string.

## ◆ without_feature()

WS_DLL_PUBLIC void without_feature | ( | feature_list | l,
|  | const char * | fmt,
|  |  | ...
| ) |  |

Mark a feature as absent in the given list.

Parameters

  l | Mutable feature list to update.
  fmt | Format string describing the absent feature.
  ... | Arguments for the format string.