Wireshark  4.3.0
The Wireshark network protocol analyzer
dfunctions.h
Go to the documentation of this file.
1 
10 #ifndef DFUNCTIONS_H
11 #define DFUNCTIONS_H
12 
13 #include <glib.h>
14 #include <ftypes/ftypes.h>
15 #include "syntax-tree.h"
16 #include "dfilter-int.h"
17 
18 /* Functions take any number of arguments and return 1. */
19 
20 /* The run-time logic of the dfilter function */
21 typedef bool (*DFFuncType)(GSList *stack, uint32_t arg_count, df_cell_t *retval);
22 
23 /* The return type for the dfilter function */
24 typedef ftenum_t (*DFReturnType)(GSList *param_list);
25 
26 /* The semantic check for the dfilter function */
27 typedef ftenum_t (*DFSemCheckType)(dfwork_t *dfw, const char *func_name, ftenum_t lhs_ftype,
28  GSList *param_list, df_loc_t func_loc);
29 
30 /* This is a "function definition" record, holding everything
31  * we need to know about a function */
32 typedef struct {
33  const char *name;
34  DFFuncType function;
35  unsigned min_nargs;
36  unsigned max_nargs; /* 0 for no limit */
37  DFReturnType return_type;
38  DFSemCheckType semcheck_param_function;
40 
41 /* Return the function definition record for a function of named "name" */
42 df_func_def_t* df_func_lookup(const char *name);
43 
44 #endif
Definition: dfilter-loc.h:16
Definition: dfilter-int.h:25
Definition: dfunctions.h:32
Definition: dfilter-int.h:75