aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-02-26 06:40:25 +0000
committerGerald Combs <gerald@wireshark.org>2013-02-26 06:40:25 +0000
commit0645396514fb5a9d6998c2d42c93c135491042ac (patch)
tree1f58991e1949b0252ffb61909d9819e14a97ba22 /wsutil
parent96a24cc79f7a32851cc2005603e32633389043a3 (diff)
Print human-readable statistics by default. Raw values can be printed
using "-M". Based on a suggestion by Hansang Bae. svn path=/trunk/; revision=47900
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/str_util.c3
-rw-r--r--wsutil/str_util.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/wsutil/str_util.c b/wsutil/str_util.c
index 9f8cac5320..f2de5bfbee 100644
--- a/wsutil/str_util.c
+++ b/wsutil/str_util.c
@@ -131,6 +131,9 @@ gchar *format_size(gint64 size, format_size_flags_e flags) {
case format_size_unit_bits_s:
g_string_append(human_str, is_small ? "bits/s" : "bps");
break;
+ case format_size_unit_bytes_s:
+ g_string_append(human_str, is_small ? "bytes/s" : "Bps");
+ break;
default:
g_assert_not_reached();
}
diff --git a/wsutil/str_util.h b/wsutil/str_util.h
index 7fc189b0cc..120fc00820 100644
--- a/wsutil/str_util.h
+++ b/wsutil/str_util.h
@@ -80,9 +80,9 @@ gboolean isdigit_string(guchar *string);
typedef enum {
format_size_unit_none = 0, /**< No unit will be appended. You must supply your own. */
format_size_unit_bytes = 1, /**< "bytes" for un-prefixed sizes, "B" otherwise. */
- /* XXX Do we use bytes/s anywhere? */
format_size_unit_bits = 2, /**< "bits" for un-prefixed sizes, "b" otherwise. */
format_size_unit_bits_s = 3, /**< "bits/s" for un-prefixed sizes, "bps" otherwise. */
+ format_size_unit_bytes_s = 4, /**< "bytes/s" for un-prefixed sizes, "Bps" otherwise. */
format_size_prefix_si = 0 << 8, /**< SI (power of 1000) prefixes will be used. */
format_size_prefix_iec = 1 << 8 /**< IEC (power of 1024) prefixes will be used. */
/* XXX format_size_prefix_default_for_this_particular_os ? */