diff options
author | Anders Broman <anders.broman@ericsson.com> | 2011-01-10 14:31:33 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2011-01-10 14:31:33 +0000 |
commit | 6404b4437a384c7e0c4f7b0ceed6ff6d53ff99d4 (patch) | |
tree | cd308b9762ffc4454dccae2cc1af237dfd16ecfb /epan/value_string.h | |
parent | b321c5d5eacff341afad804b534ca84c59ef45d6 (diff) |
Introduce match_strval_idx_ext()
svn path=/trunk/; revision=35451
Diffstat (limited to 'epan/value_string.h')
-rw-r--r-- | epan/value_string.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/epan/value_string.h b/epan/value_string.h index e018dc786f..6761ef25e3 100644 --- a/epan/value_string.h +++ b/epan/value_string.h @@ -115,7 +115,7 @@ extern const gchar* str_to_str(const gchar *val, const string_string *vs, const */ /* --------------------------------------------------------------------*/ struct _value_string_ext; -typedef const char *(*_value_string_match_t)(const guint32, const struct _value_string_ext *); +typedef const char *(*_value_string_match_t)(const guint32, const struct _value_string_ext *, gint *idx); typedef struct _value_string_ext { _value_string_match_t _vs_match; @@ -150,6 +150,13 @@ extern value_string_ext *value_string_ext_new(value_string *vs, guint vs_tot_num */ extern const gchar* match_strval_ext(const guint32 val, const value_string_ext *vse); +/* 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_strval_idx_ext(const guint32 val, value_string_ext *vse, gint *idx); + /* Similar to match_strval_ext except that on failure * Formats val with fmt, and returns the resulting string */ |