From Peter J. Creath: add a convenience macro for value_string tables

where the values all have #defines or enum values and the corresponding
strings are just the #define or enum value names.

svn path=/trunk/; revision=10187
This commit is contained in:
Guy Harris 2004-02-22 22:45:21 +00:00
parent 48531970f3
commit 5d2df19a7a
1 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,7 @@
/* value_string.h
* Definitions for value_string structures and routines
*
* $Id: value_string.h,v 1.4 2003/12/01 23:41:44 guy Exp $
* $Id: value_string.h,v 1.5 2004/02/22 22:45:21 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -35,6 +35,9 @@ typedef struct _value_string {
gchar *strptr;
} value_string;
#define VS_DEF(x) { x, #x }
#define VS_END { 0, NULL }
extern gchar* match_strval(guint32, const value_string*);
extern gchar* val_to_str(guint32, const value_string *, const char *);