diff options
author | Jakob Gruber <jakob.gruber@gmail.com> | 2011-02-20 19:38:32 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-04-21 00:29:32 +0200 |
commit | 3c8a448a2ff6b433059b1beb3a35cfd67c148d0c (patch) | |
tree | d97cf667508787562f35f0125f31396d63bee495 /lib/libalpm/db.h | |
parent | dcb6fb224dd3ac91c08369e9fbff12349b96e545 (diff) | |
download | pacman-3c8a448a2ff6b433059b1beb3a35cfd67c148d0c.tar.gz pacman-3c8a448a2ff6b433059b1beb3a35cfd67c148d0c.tar.xz |
Add a utility function to humanize sizes
Converts the given size in bytes in two possible ways:
1) target_unit is specified (!= 0): size is converted to target unit.
2) target_unit is not specified (== '\0'): size is converted to the first
unit which will bring size to below 2048.
If specified, label will point to the long label ('MB') if long_labels is
set or the short label ('M') if it is not.
Dan: use '\0' rather than 0 for the special value as a matter of coding
style for char variables.
Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/db.h')
0 files changed, 0 insertions, 0 deletions