add and use pretty num
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
uint64_t timespec_diff_us(const struct timespec *a, const struct timespec *b);
|
||||
void timespec_add_ms(struct timespec *ts, uint16_t ms);
|
||||
char *pretty_bytes(uint64_t bytes, int8_t start_suffix, char *buf, size_t bufsz);
|
||||
char *pretty_num(const double num, char *buf, const size_t bufsz);
|
||||
|
||||
void fast_read_num_u64(const char* dir, const char* file, char* buf, uint64_t* result, uint32_t divider);
|
||||
void fast_read_num_u16(const char* dir, const char* file, char* buf, uint16_t* result, uint32_t divider);
|
||||
@@ -20,6 +21,7 @@ int get_hwmon_dir(char *path);
|
||||
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define P_BYTES(kb, start) pretty_bytes((kb), (start), (char[16]){0}, 16)
|
||||
#define P_BYTES(bytes, start) pretty_bytes((bytes), (start), (char[16]){0}, 16)
|
||||
#define P_NUM(num) pretty_num((num), (char[8]){0}, 8)
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user