diff options
author | pjd <pjd@FreeBSD.org> | 2004-05-24 22:19:27 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2004-05-24 22:19:27 +0000 |
commit | d207894810cf9fa574c3f60f611210946e00a166 (patch) | |
tree | 32c833de9efdb9ee45b5a114068632de7a8d073d /lib/libutil/libutil.h | |
parent | 06701a2fa969f461f476522609e94f065fb97e0e (diff) | |
download | FreeBSD-src-d207894810cf9fa574c3f60f611210946e00a166.zip FreeBSD-src-d207894810cf9fa574c3f60f611210946e00a166.tar.gz |
Add humanize_number(3) to libutil for formating numbers into a human
readable form.
Obtained from: NetBSD
Diffstat (limited to 'lib/libutil/libutil.h')
-rw-r--r-- | lib/libutil/libutil.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h index fbc68c0..3042d0f 100644 --- a/lib/libutil/libutil.h +++ b/lib/libutil/libutil.h @@ -69,6 +69,8 @@ int openpty(int *_amaster, int *_aslave, char *_name, struct termios *_termp, struct winsize *_winp); int forkpty(int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp); +int humanize_number(char *_buf, size_t _len, int64_t _number, + const char *_suffix, int _scale, int _flags); const char *uu_lockerr(int _uu_lockresult); int uu_lock(const char *_ttyname); int uu_unlock(const char *_ttyname); @@ -129,4 +131,13 @@ __END_DECLS #define PWSCAN_MASTER 0x01 #define PWSCAN_WARN 0x02 +/* humanize_number(3) */ +#define HN_DECIMAL 0x01 +#define HN_NOSPACE 0x02 +#define HN_B 0x04 +#define HN_DIVISOR_1000 0x08 + +#define HN_GETSCALE 0x10 +#define HN_AUTOSCALE 0x20 + #endif /* !_LIBUTIL_H_ */ |