diff options
author | Gerald Combs <gerald@wireshark.org> | 2009-05-26 00:49:38 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2009-05-26 00:49:38 +0000 |
commit | 8a6daf2a1cae5b59bacf30bef62fc63245009e21 (patch) | |
tree | 9d96d69c98284159294894ee7ca20dad2fc25336 /epan/value_string.h | |
parent | e718dc79ea8b7a6e619f53031dc0191f7549cdf9 (diff) |
From Didier Gautheron via bug 3052:
Add:
- FIX 4.0 to 4.4 fields, auto generated with XSLT stylesheets applied on
http://www.quickfixengine.org/ xml files (not included quickfixengine code is
BSD but xml files have no copyright).
- value_string functions for string keys, added to value_string.c.
- FIX desegmentation, it doesn't work well with malformed FIX PDU.
svn path=/trunk/; revision=28478
Diffstat (limited to 'epan/value_string.h')
-rw-r--r-- | epan/value_string.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/epan/value_string.h b/epan/value_string.h index 546e8a7800..3fc92c9bf3 100644 --- a/epan/value_string.h +++ b/epan/value_string.h @@ -34,6 +34,13 @@ typedef struct _value_string { const gchar *strptr; } value_string; +/* Struct for the str_to_str, match_strstr_idx, and match_strstr functions */ + +typedef struct _string_string { + const gchar *value; + const gchar *strptr; +} string_string; + /* Struct for the rval_to_str, match_strrval_idx, and match_strrval functions */ typedef struct _range_string { guint32 value_min; @@ -58,6 +65,20 @@ extern const gchar* match_strval(guint32 val, const value_string *vs); Formats val with fmt, and returns the resulting string, on failure. */ extern const gchar* val_to_str(guint32 val, const value_string *vs, const char *fmt); +/* Tries to match val against each element in the value_string array vs. + Returns the associated string ptr, and sets "*idx" to the index in + that table, on a match, and returns NULL, and sets "*idx" to -1, + on failure. */ +extern const gchar* match_strstr_idx(const gchar *val, const string_string *vs, gint *idx); + +/* Like match_strval_idx(), but doesn't return the index. */ +extern const gchar* match_strstr(const gchar *val, const string_string *vs); + +/* Tries to match val against each element in the value_string array vs. + Returns the associated string ptr on a match. + Formats val with fmt, and returns the resulting string, on failure. */ +extern const gchar* str_to_str(const gchar *val, const string_string *vs, const char *fmt); + /* Generate a string describing an enumerated bitfield (an N-bit field with various specific values having particular names). */ extern const char *decode_enumerated_bitfield(guint32 val, guint32 mask, |