diff options
author | Jonathan McCrohan <jmccrohan@gmail.com> | 2020-07-29 23:11:46 +0100 |
---|---|---|
committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2020-07-29 23:11:46 +0100 |
commit | 612e6fdfa43ac716a2431d695de842f7127c12d0 (patch) | |
tree | 58532da4c219499547e0ab5554d78ea112eea466 /wavemon.h | |
parent | 818f5500fa11d5bf57c5542b20beb94d6f0dda6e (diff) | |
parent | 8deb3660926fe8278948b898b9c1b772eed2e61e (diff) | |
download | wavemon-612e6fdfa43ac716a2431d695de842f7127c12d0.tar.gz |
Update upstream source from tag 'upstream/0.9.1'
Update to upstream version '0.9.1'
with Debian dir 559193b433abdd46788bc66e02edda248b928278
Diffstat (limited to 'wavemon.h')
-rw-r--r-- | wavemon.h | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -137,6 +137,7 @@ extern struct wavemon_conf { /* Boolean values */ int check_geometry, /* ensure window is large enough */ cisco_mac, /* Cisco-style MAC addresses */ + transparent_bg, /* Use terminal background instead of black */ override_bounds, /* override autodetection */ scan_sort_asc; /* direction of @scan_sort_order */ @@ -171,8 +172,9 @@ struct conf_item { char **list; /* t_list: NULL-terminated array of strings */ int *dep; /* dependency */ + bool hidden; /* only allow to set via wavemonrc */ - double min, /* value boundaries */ + int min, /* value boundaries */ max, inc; /* increment for value changes */ @@ -382,6 +384,21 @@ static inline char *byte_units(const double bytes) return result; } +/* Integer units - similar to %g for float. */ +static inline char *int_counts(uint32_t count) +{ + static char result[0x10]; + + if (count < 1000) + sprintf(result, "%u", count); + else if (count < 1000000) + sprintf(result, "%uk", count/1000); + else + sprintf(result, "%.lg", (double)count); + + return result; +} + /** * Compute exponentially weighted moving average * @mavg: old value of the moving average |