| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
uat-int.h
Go to the documentation of this file.
1
16#ifndef __UAT_INT_H__
17#define __UAT_INT_H__
18
19#include <glib.h>
20
21#include "uat.h"
22#include "ws_symbol_export.h"
23
24#ifdef __cplusplus
25 extern "C" {
26#endif /* __cplusplus */
27
28 typedef struct _uat_fld_rep_t uat_fld_rep_t;
29 typedef struct _uat_rep_t uat_rep_t;
30
31 typedef void (*uat_rep_fld_free_cb_t)(uat_fld_rep_t*);
32 typedef void (*uat_rep_free_cb_t)(uat_rep_t*);
33
34 typedef struct _fld_data_t {
35 unsigned colnum;
36 uat_fld_rep_t* rep;
37 uat_rep_fld_free_cb_t free_rep;
38} fld_data_t;
39
40 struct epan_uat {
41 char* name;
42 size_t record_size;
43 char* filename;
44 bool from_profile;
45 char* help;
46 unsigned flags;
47 void** user_ptr;
48 unsigned* nrows_p;
49 uat_copy_cb_t copy_cb;
50 uat_update_cb_t update_cb;
51 uat_free_cb_t free_cb;
52 uat_post_update_cb_t post_update_cb;
53 uat_reset_cb_t reset_cb;
54
55 uat_field_t* fields;
56 const char** default_values;
57 unsigned ncols;
58 GArray* user_data;
59 GArray* raw_data;
60 GArray* valid_data;
61 bool changed;
62 uat_rep_t* rep;
63 uat_rep_free_cb_t free_rep;
64 bool loaded;
65};
66
67WS_DLL_PUBLIC
68 char* uat_get_actual_filename(uat_t* uat, bool for_writing, const char* app_env_var_prefix);
69
75WS_DLL_PUBLIC
76 void* uat_add_record(uat_t *uat, const void *orig_rec_ptr, bool valid_rec);
77
82WS_DLL_PUBLIC
83 void uat_update_record(uat_t *uat, const void *record, bool valid_rec);
84
88WS_DLL_PUBLIC
89 void uat_swap(uat_t *uat, unsigned idx_a, unsigned idx_b);
90
94WS_DLL_PUBLIC
95 void uat_insert_record_idx(uat_t *uat, unsigned rec_idx, const void *src_record);
96
101WS_DLL_PUBLIC
102 void uat_remove_record_idx(uat_t *uat, unsigned rec_idx);
103
109WS_DLL_PUBLIC
110 void uat_remove_record_range(uat_t *uat, unsigned rec_idx, unsigned count);
111
115WS_DLL_PUBLIC
116 void uat_move_index(uat_t *uat, unsigned old_idx, unsigned new_idx);
117
121WS_DLL_PUBLIC
122 void uat_clear(uat_t *uat);
123
129WS_DLL_PUBLIC
130 bool uat_save(uat_t *uat, const char* app_env_var_prefix, char **error);
131
135 void uat_load_all(const char* app_env_var_prefix);
136
144WS_DLL_PUBLIC
145 char *uat_fld_tostr(void *rec, uat_field_t *f);
146
151WS_DLL_PUBLIC
152 char *uat_record_tostr(const uat_t *uat, void *rec);
153
158#define UAT_UPDATE(uat) do { *((uat)->user_ptr) = (void*)((uat)->user_data->data); *((uat)->nrows_p) = (uat)->user_data->len; } while(0)
164#define UAT_INDEX_PTR(uat,idx) (uat->raw_data->data + (uat->record_size * (idx)))
169#define UAT_USER_INDEX_PTR(uat,idx) (uat->user_data->data + (uat->record_size * (idx)))
170
171#ifdef __cplusplus
172}
173#endif /* __cplusplus */
174
175#endif /* __UAT_INT_H__ */
176
177/*
178 * Editor modelines - https://www.wireshark.org/tools/modelines.html
179 *
180 * Local variables:
181 * c-basic-offset: 4
182 * tab-width: 8
183 * indent-tabs-mode: nil
184 * End:
185 *
186 * vi: set shiftwidth=4 tabstop=8 expandtab:
187 * :indentSize=4:tabSize=8:noTabs=true:
188 */
_fld_data_t
Definition uat-int.h:34
_uat_field_t
Definition uat.h:235
epan_uat
Definition uat-int.h:40
epan_uat::user_ptr
void ** user_ptr
Definition uat-int.h:47
epan_uat::raw_data
GArray * raw_data
Definition uat-int.h:59
epan_uat::nrows_p
unsigned * nrows_p
Definition uat-int.h:48
epan_uat::valid_data
GArray * valid_data
Definition uat-int.h:60
epan_uat::user_data
GArray * user_data
Definition uat-int.h:58
uat_load_all
void uat_load_all(const char *app_env_var_prefix)
Definition uat.c:615
uat_update_record
WS_DLL_PUBLIC void uat_update_record(uat_t *uat, const void *record, bool valid_rec)
Definition uat.c:145
uat_remove_record_range
WS_DLL_PUBLIC void uat_remove_record_range(uat_t *uat, unsigned rec_idx, unsigned count)
Definition uat.c:217
uat_move_index
WS_DLL_PUBLIC void uat_move_index(uat_t *uat, unsigned old_idx, unsigned new_idx)
Definition uat.c:235
uat_clear
WS_DLL_PUBLIC void uat_clear(uat_t *uat)
Definition uat.c:533
uat_save
WS_DLL_PUBLIC bool uat_save(uat_t *uat, const char *app_env_var_prefix, char **error)
Definition uat.c:396
uat_swap
WS_DLL_PUBLIC void uat_swap(uat_t *uat, unsigned idx_a, unsigned idx_b)
Definition uat.c:164
uat_record_tostr
WS_DLL_PUBLIC char * uat_record_tostr(const uat_t *uat, void *rec)
Definition uat.c:327
uat_add_record
WS_DLL_PUBLIC void * uat_add_record(uat_t *uat, const void *orig_rec_ptr, bool valid_rec)
Definition uat.c:117
uat_fld_tostr
WS_DLL_PUBLIC char * uat_fld_tostr(void *rec, uat_field_t *f)
Definition uat.c:288
uat_remove_record_idx
WS_DLL_PUBLIC void uat_remove_record_idx(uat_t *uat, unsigned rec_idx)
Definition uat.c:205
uat_insert_record_idx
WS_DLL_PUBLIC void uat_insert_record_idx(uat_t *uat, unsigned rec_idx, const void *src_record)
Definition uat.c:186
uat.h
uat_copy_cb_t
void *(* uat_copy_cb_t)(void *dest, const void *source, size_t len)
Definition uat.h:88
uat_free_cb_t
void(* uat_free_cb_t)(void *record)
Definition uat.h:98
uat_update_cb_t
bool(* uat_update_cb_t)(void *record, char **error)
Definition uat.h:126
uat_reset_cb_t
void(* uat_reset_cb_t)(void)
Definition uat.h:106