Add -b / --use-bit option to display rates in bit/s instead of bytes/s

Signed-off-by: Thomas Graf <tgraf@suug.ch>
This commit is contained in:
Thomas Graf
2014-05-08 15:16:38 +02:00
parent 127ffda015
commit 46ec101b00
6 changed files with 56 additions and 20 deletions

View File

@ -33,6 +33,7 @@
enum {
UNIT_DEFAULT,
UNIT_SI,
UNIT_BIT,
__UNIT_MAX,
};
@ -42,7 +43,7 @@ enum {
#define UNIT_NUMBER "number"
struct fraction {
uint64_t f_divisor;
float f_divisor;
char * f_name;
struct list_head f_list;
@ -58,7 +59,7 @@ struct unit {
extern struct unit * unit_lookup(const char *);
extern struct unit * unit_add(const char *name);
extern void unit_add_div(struct unit *, int, const char *, float);
extern uint64_t unit_divisor(uint64_t, struct unit *, char **, int *);
extern double unit_divisor(uint64_t, struct unit *, char **, int *);
extern double unit_value2str(uint64_t, struct unit *, char **, int *);
extern void fraction_free(struct fraction *);