Update humanize_number() from FreeBSD

Implements HN_IEC_PREFIXES.
This commit is contained in:
Guillem Jover
2018-05-20 19:22:16 +02:00
parent facbddb652
commit e3979d1a7c
3 changed files with 102 additions and 62 deletions

View File

@@ -67,14 +67,16 @@ int pidfile_remove(struct pidfh *pfh);
char *fparseln(FILE *, size_t *, size_t *, const char[3], int);
__END_DECLS
/* humanize_number(3) */
#define HN_DECIMAL 0x01
#define HN_NOSPACE 0x02
#define HN_B 0x04
#define HN_DIVISOR_1000 0x08
/* Values for humanize_number(3)'s flags parameter. */
#define HN_DECIMAL 0x01
#define HN_NOSPACE 0x02
#define HN_B 0x04
#define HN_DIVISOR_1000 0x08
#define HN_IEC_PREFIXES 0x10
#define HN_GETSCALE 0x10
#define HN_AUTOSCALE 0x20
/* Values for humanize_number(3)'s scale parameter. */
#define HN_GETSCALE 0x10
#define HN_AUTOSCALE 0x20
/*
* fparseln() specific operation flags.