6 * User Accessible Tables
7 * Mantain an array of user accessible data strucures
10 * (c) 2007, Luis E. Garcia Ontanon <luis.ontanon@gmail.com>
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 2001 Gerald Combs
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
36 typedef struct _uat_fld_rep_t uat_fld_rep_t;
37 typedef struct _uat_rep_t uat_rep_t;
39 typedef void (*uat_rep_fld_free_cb_t)(uat_fld_rep_t*);
40 typedef void (*uat_rep_free_cb_t)(uat_rep_t*);
42 typedef struct _fld_data_t {
45 uat_rep_fld_free_cb_t free_rep;
52 gboolean from_profile;
57 uat_copy_cb_t copy_cb;
58 uat_update_cb_t update_cb;
59 uat_free_cb_t free_cb;
66 uat_rep_free_cb_t free_rep;
70 gchar* uat_get_actual_filename(uat_t* uat, gboolean for_writing);
76 void* uat_add_record(uat_t*, const void* orig_rec_ptr);
78 void uat_swap(uat_t*, guint idx_a, guint idx_b);
80 void uat_remove_record_idx(uat_t*, guint rec_idx);
82 void uat_destroy(uat_t*);
84 void uat_clear(uat_t*);
86 gboolean uat_save(uat_t* , char** );
88 void uat_load_all(void);
90 #define UAT_UPDATE(uat) do { *((uat)->user_ptr) = (void*)((uat)->user_data->data); *((uat)->nrows_p) = (uat)->user_data->len; } while(0)
91 #define UAT_INDEX_PTR(uat,idx) (uat->user_data->data + (uat->record_size * (idx)))