From 23a09eb7376beae7ffca03c3466b1fa7d003a5ca Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Mon, 24 May 2004 22:19:27 +0000 Subject: Add humanize_number(3) to libutil for formating numbers into a human readable form. Obtained from: NetBSD --- libutil/libutil.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libutil/libutil.h') diff --git a/libutil/libutil.h b/libutil/libutil.h index fbc68c0..3042d0f 100644 --- a/libutil/libutil.h +++ b/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_ */ -- cgit v1.2.3-56-ge451