Split uc_human_bytesz in uc_human_bytesz_dec/uc_human_bytesz_bin, for
decimal and binary conversion (http://en.wikipedia.org/wiki/Megabyte)
This commit is contained in:
@@ -77,11 +77,15 @@ int
|
||||
getfields(char *str, char **args, int max, int mflag, const char *set);
|
||||
|
||||
//Converts bytes to a human representable test, (i.e. 12kB, 160 MB 1.78 GB etc.)
|
||||
//Conversion is done in decimal (base 10 ,1 kB == 1000 bytes)
|
||||
///result should be at least of size 12,
|
||||
///returns the result argument
|
||||
char *
|
||||
uc_human_bytesz(uint64_t bytes, char *result, size_t result_len);
|
||||
uc_human_bytesz_dec(uint64_t bytes, char *result, size_t result_len);
|
||||
|
||||
//same as uc_human_bytesz_bin, but Conversion is done in binary
|
||||
//(base 2 ,1 KiB == 1024 bytes)
|
||||
char *
|
||||
uc_human_bytesz_bin(uint64_t bytes, char *result, size_t result_len);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user