diff options
author | Sören Tempel <soeren+git@soeren-tempel.net> | 2018-10-11 13:39:25 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-01-05 23:26:50 +0200 |
commit | a6039e38a42cc977f7f9da3dcc69e7f98317b4c1 (patch) | |
tree | 630e5b6709d6878240b80aca488b19b4d1868ee7 /src/apk_print.h | |
parent | 0b82bcc53e6027c74fae2c972d5d9fff54d95d6c (diff) | |
download | apk-tools-a6039e38a42cc977f7f9da3dcc69e7f98317b4c1.tar.gz apk-tools-a6039e38a42cc977f7f9da3dcc69e7f98317b4c1.tar.bz2 apk-tools-a6039e38a42cc977f7f9da3dcc69e7f98317b4c1.tar.xz apk-tools-a6039e38a42cc977f7f9da3dcc69e7f98317b4c1.zip |
Humanize size output of `apk info`
This commits adds a function for receiving the closet byte unit and the
size in that unit for a given size_t. The function doesn't return a
string since dynamic memory allocation (or a static buffer) would be
required to implement this properly.
Discussion: It might be useful to add a command line flag for disabling
this behaviour in order to retain compatibility with the previous apk
info output format.
Diffstat (limited to 'src/apk_print.h')
-rw-r--r-- | src/apk_print.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/apk_print.h b/src/apk_print.h index 841107d..3f0c544 100644 --- a/src/apk_print.h +++ b/src/apk_print.h @@ -26,6 +26,7 @@ const char *apk_error_str(int error); void apk_reset_screen_width(void); int apk_get_screen_width(void); +const char *apk_get_human_size(off_t size, off_t *dest); struct apk_indent { int x; |