summaryrefslogtreecommitdiff
path: root/epan/ftypes/ftypes.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-11-12 22:06:00 +0000
committerGuy Harris <guy@alum.mit.edu>2013-11-12 22:06:00 +0000
commit409dd075c6dbd46a0073c87e1de2c47ec8ecccde (patch)
tree6ed6029d1e8de2f109a9dc93559009f6d2c13e2f /epan/ftypes/ftypes.c
parent72f3c258a04d6323699eb9ebca13e53d2cb5b22e (diff)
downloadwireshark-409dd075c6dbd46a0073c87e1de2c47ec8ecccde.tar.gz
Replace fvalue_ftype() with a fvalue_type_ftenum() routine that returns
the ftenum_t for the fvalue's ftype, rather than a pointer to the ftype (which isn't all that useful except as a handle, unless you import the internal header). Have fvalue_to_string_repr() return NULL, rather than failing, if the fvalue's ftype has no val_to_string_repr method. This lets us not include the ftypes internal header in ui/cli/tap-diameter-avp.c. svn path=/trunk/; revision=53290
Diffstat (limited to 'epan/ftypes/ftypes.c')
-rw-r--r--epan/ftypes/ftypes.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/epan/ftypes/ftypes.c b/epan/ftypes/ftypes.c
index a98889d437..a409c9ce1e 100644
--- a/epan/ftypes/ftypes.c
+++ b/epan/ftypes/ftypes.c
@@ -264,10 +264,10 @@ fvalue_from_string(ftenum_t ftype, char *s, LogFunc logfunc)
return NULL;
}
-ftype_t*
-fvalue_ftype(fvalue_t *fv)
+ftenum_t
+fvalue_type_ftenum(fvalue_t *fv)
{
- return fv->ftype;
+ return fv->ftype->ftype;
}
const char*
@@ -296,7 +296,10 @@ fvalue_string_repr_len(fvalue_t *fv, ftrepr_t rtype)
char *
fvalue_to_string_repr(fvalue_t *fv, ftrepr_t rtype, char *buf)
{
- g_assert(fv->ftype->val_to_string_repr);
+ if (fv->ftype->val_to_string_repr == NULL) {
+ /* no value-to-string-representation function, so the value cannot be represented */
+ return NULL;
+ }
if (!buf) {
int len;
if ((len = fvalue_string_repr_len(fv, rtype)) >= 0) {