2 * Declarations of routines for gathering and handling lists of
3 * present/absent features (usually actually dependencies)
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #ifndef __WSUTIL_FEATURE_LIST_H__
13 #define __WSUTIL_FEATURE_LIST_H__
16 #include "ws_symbol_export.h"
20 #endif /* __cplusplus */
23 * Handle to a list of features/dependencies.
24 * Semi-opaque. Functions which gather the list of features
25 * will be passed one of these to use with
26 * `with_feature()`/`without_feature()` (below).
28 typedef GList
**feature_list
;
31 * The format of entries in a feature_list is a char* starting with a
32 * '+' or '-' character indicating if the feature is respectively
33 * present or absent, followed by the unchanged feature description.
34 * This allows the insert order of features to be preserved,
35 * while still preserving the present/absent status in a simple way.
40 * Pointer to a function which gathers a list of features.
42 typedef void(*gather_feature_func
)(feature_list l
);
45 * Add an indicator to the given feature_list that the named
49 void with_feature(feature_list l
, const char *fmt
, ...) G_GNUC_PRINTF(2,3);
52 * Add an indicator to the given feature_list that the named
56 void without_feature(feature_list l
, const char *fmt
, ...) G_GNUC_PRINTF(2,3);
59 * Sort the given feature list, alphabetically by feature name.
60 * (The leading '+' or '-' is not factored into the sort.)
64 void sort_features(feature_list l
);
67 * Free the memory used by the feature list,
68 * and reset its pointer to NULL.
71 void free_features(feature_list l
);
75 #endif /* __cplusplus */
77 #endif /* __WSUTIL_FEATURE_LIST_H__ */