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:
Nils O. Selåsdal
2013-11-19 11:33:43 +01:00
parent ac95b1002c
commit 8083fa54cf
3 changed files with 61 additions and 10 deletions
+6 -2
View File
@@ -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