diff options
author | Guy Harris <guy@alum.mit.edu> | 2001-08-01 08:27:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2001-08-01 08:27:00 +0000 |
commit | d451acb66cce2ac3e881b66226c43098794dad9b (patch) | |
tree | d0545b539587d315a902b5977d62508b03ba20b8 /epan/proto.c | |
parent | 0363dc030d25d264e77818edc4473ddcef50f9d7 (diff) |
Add a "time_secs_to_str_buf()" routine, which takes seconds and
fractions-of-a-second (the units of which are either milliseconds or
microseconds, specified by a Boolean argument), and formats it into a
"DD days, HH hours, MM minutes, SS seconds" using a buffer supplied to
it. Have "time_secs_to_str()" and "time_msecs_to_str()" both use it.
Also, have it correctly handle the case of SS being > 0 but < 1 (which
"time_msecs_to_str()" didn't do).
Rename "rel_time_to_str()" to "rel_time_to_secs_str()", and add a
"rel_time_to_str()" routine that takes a "struct timeval" and hands its
seconds and microseconds values to "time_secs_to_str_buf()". Use
"rel_time_to_secs_str()" to format FT_RELATIVE_TIME values for now; we
might want to use "rel_time_to_str()" for them, though, or make it an
option (either a user option, or a per-field option, using the field
that also holds BASE_ values).
svn path=/trunk/; revision=3806
Diffstat (limited to 'epan/proto.c')
-rw-r--r-- | epan/proto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/proto.c b/epan/proto.c index 35de4bde33..d086ed21a0 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -1,7 +1,7 @@ /* proto.c * Routines for protocol tree * - * $Id: proto.c,v 1.30 2001/07/13 00:55:53 guy Exp $ + * $Id: proto.c,v 1.31 2001/08/01 08:27:00 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -1956,7 +1956,7 @@ proto_item_fill_label(field_info *fi, gchar *label_str) case FT_RELATIVE_TIME: snprintf(label_str, ITEM_LABEL_LENGTH, "%s: %s seconds", hfinfo->name, - rel_time_to_str(fvalue_get(fi->value))); + rel_time_to_secs_str(fvalue_get(fi->value))); break; case FT_IPXNET: @@ -2964,7 +2964,7 @@ proto_alloc_dfilter_string(field_info *finfo, guint8 *pd) case FT_RELATIVE_TIME: value_str = - rel_time_to_str((struct timeval *)fvalue_get(finfo->value)); + rel_time_to_secs_str((struct timeval *)fvalue_get(finfo->value)); dfilter_len = abbrev_len + strlen(value_str) + 4; buf = g_malloc0(dfilter_len); snprintf(buf, dfilter_len, "%s == %s", |