X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fhuman.h;h=4ec9f0da8602f1620291b58828ca712f2527aec0;hb=862d856cf0083d07c86d56dce8f9be7b207a8dd4;hp=66bedcce9574e6c2113fd7d050bc2a8a7cb592f4;hpb=358e52e8bb23ab6e5bcc42ca3546493a868d9591;p=gnulib.git diff --git a/lib/human.h b/lib/human.h index 66bedcce9..4ec9f0da8 100644 --- a/lib/human.h +++ b/lib/human.h @@ -1,6 +1,14 @@ #ifndef HUMAN_H_ # define HUMAN_H_ 1 +# if HAVE_CONFIG_H +# include +# endif + +# if HAVE_INTTYPES_H +# include +# endif + /* A conservative bound on the maximum length of a human-readable string. The output can be the product of the largest uintmax_t and the largest int, so add their sizes before converting to a bound on digits. */ @@ -15,6 +23,17 @@ # endif # endif -char *human_readable PARAMS ((uintmax_t, char *, int, int, int)); +enum human_inexact_style +{ + human_floor = -1, + human_round_to_even = 0, + human_ceiling = 1 +}; + +char *human_readable PARAMS ((uintmax_t, char *, int, int)); +char *human_readable_inexact PARAMS ((uintmax_t, char *, int, int, + enum human_inexact_style)); + +void human_block_size PARAMS ((char const *, int, int *)); #endif /* HUMAN_H_ */