Include files from the "epan" directory and subdirectories thereof with
[obnox/wireshark/wip.git] / epan / ftypes / ftypes-int.h
1 /*
2  * $Id: ftypes-int.h,v 1.5 2002/01/21 07:37:39 guy Exp $
3  *
4  * Ethereal - Network traffic analyzer
5  * By Gerald Combs <gerald@ethereal.com>
6  * Copyright 2001 Gerald Combs
7  * 
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  * 
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  */
22
23 #ifndef FTYPES_INT_H
24 #define FTYPES_INT_H
25
26 #include <epan/packet.h>
27 #include "ftypes.h"
28
29 typedef void (*FvalueNewFunc)(fvalue_t*);
30 typedef void (*FvalueFreeFunc)(fvalue_t*);
31
32 typedef gboolean (*FvalueFromString)(fvalue_t*, char*, LogFunc);
33
34 typedef void (*FvalueSetFunc)(fvalue_t*, gpointer, gboolean);
35 typedef void (*FvalueSetIntegerFunc)(fvalue_t*, guint32);
36 typedef void (*FvalueSetFloatingFunc)(fvalue_t*, gdouble);
37
38 typedef gpointer (*FvalueGetFunc)(fvalue_t*);
39 typedef guint32 (*FvalueGetIntegerFunc)(fvalue_t*);
40 typedef double (*FvalueGetFloatingFunc)(fvalue_t*);
41
42 typedef gboolean (*FvalueCmp)(fvalue_t*, fvalue_t*);
43
44 typedef guint (*FvalueLen)(fvalue_t*);
45 typedef void (*FvalueSlice)(fvalue_t*, GByteArray *, guint offset, guint length);
46
47 struct _ftype_t {
48         const char              *name;
49         const char              *pretty_name;
50         int                     wire_size;
51         FvalueNewFunc           new_value;
52         FvalueFreeFunc          free_value;
53         FvalueFromString        val_from_string;
54
55         /* could be union */
56         FvalueSetFunc           set_value;
57         FvalueSetIntegerFunc    set_value_integer;
58         FvalueSetFloatingFunc   set_value_floating;
59
60         /* could be union */
61         FvalueGetFunc           get_value;
62         FvalueGetIntegerFunc    get_value_integer;
63         FvalueGetFloatingFunc   get_value_floating;
64
65         FvalueCmp               cmp_eq;
66         FvalueCmp               cmp_ne;
67         FvalueCmp               cmp_gt;
68         FvalueCmp               cmp_ge;
69         FvalueCmp               cmp_lt;
70         FvalueCmp               cmp_le;
71
72         FvalueLen               len;
73         FvalueSlice             slice;
74 };
75
76
77 void
78 ftype_register(enum ftenum ftype, ftype_t *ft);
79
80 #endif