2 * Definitions for value_string structures and routines
4 * $Id: value_string.h,v 1.5 2004/02/22 22:45:21 guy Exp $
6 * Ethereal - Network traffic analyzer
7 * By Gerald Combs <gerald@zing.org>
8 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26 #ifndef __VALUE_STRING_H__
27 #define __VALUE_STRING_H__
31 /* Struct for the match_strval function */
33 typedef struct _value_string {
38 #define VS_DEF(x) { x, #x }
39 #define VS_END { 0, NULL }
41 extern gchar* match_strval(guint32, const value_string*);
43 extern gchar* val_to_str(guint32, const value_string *, const char *);
44 extern const char *decode_enumerated_bitfield(guint32 val, guint32 mask,
45 int width, const value_string *tab, const char *fmt);
46 extern const char *decode_enumerated_bitfield_shifted(guint32 val, guint32 mask,
47 int width, const value_string *tab, const char *fmt);
49 #endif /* __VALUE_STRING_H__ */