dcerpc-nt: add UNION_ALIGN_TO... helpers
[wireshark-sm.git] / wsutil / feature_list.h
bloba9c2d8ec6a44061d2424a1d9013f9bc4e1728b34
1 /** @file
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__
15 #include <glib.h>
16 #include "ws_symbol_export.h"
18 #ifdef __cplusplus
19 extern "C" {
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
46 * feature is present.
48 WS_DLL_PUBLIC
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
53 * feature is absent.
55 WS_DLL_PUBLIC
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.)
61 * Currently unused.
63 WS_DLL_PUBLIC
64 void sort_features(feature_list l);
67 * Free the memory used by the feature list,
68 * and reset its pointer to NULL.
70 WS_DLL_PUBLIC
71 void free_features(feature_list l);
73 #ifdef __cplusplus
75 #endif /* __cplusplus */
77 #endif /* __WSUTIL_FEATURE_LIST_H__ */