3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 2001 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #ifndef _DFILTER_MACRO_H
11 #define _DFILTER_MACRO_H
13 #include <wireshark.h>
18 #endif /* __cplusplus */
20 typedef struct _dfilter_macro_t
{
21 char* name
; /* the macro id */
22 char* text
; /* raw data from file */
23 bool usable
; /* macro is usable */
24 char** parts
; /* various segments of text between insertion targets */
25 int* args_pos
; /* what's to be inserted */
26 int argc
; /* the expected number of arguments */
27 void* priv
; /* a copy of text that contains every c-string in parts */
30 void macro_parse(dfilter_macro_t
*m
);
32 /* applies all macros to the given text and returns the resulting string or NULL on failure */
33 char* dfilter_macro_apply(const char* text
, df_error_t
** error
);
35 void dfilter_macro_init(void);
38 void dfilter_macro_reload(void);
40 void dfilter_macro_cleanup(void);
42 struct dfilter_macro_table_iter
{
48 dfilter_macro_table_count(void);
52 dfilter_macro_table_iter_init(struct dfilter_macro_table_iter
*iter
);
56 dfilter_macro_table_iter_next(struct dfilter_macro_table_iter
*iter
,
57 const char **name_ptr
, const char **text_ptr
);
61 #endif /* __cplusplus */
63 #endif /* _DFILTER_MACRO_H */