* doc/Makefile.am (MOSTLYCLEANFILES): add find.cps, which is
[findutils.git] / lib / human.h
blob4ec9f0da8602f1620291b58828ca712f2527aec0
1 #ifndef HUMAN_H_
2 # define HUMAN_H_ 1
4 # if HAVE_CONFIG_H
5 # include <config.h>
6 # endif
8 # if HAVE_INTTYPES_H
9 # include <inttypes.h>
10 # endif
12 /* A conservative bound on the maximum length of a human-readable string.
13 The output can be the product of the largest uintmax_t and the largest int,
14 so add their sizes before converting to a bound on digits. */
15 # define LONGEST_HUMAN_READABLE ((sizeof (uintmax_t) + sizeof (int)) \
16 * CHAR_BIT / 3)
18 # ifndef PARAMS
19 # if defined PROTOTYPES || (defined __STDC__ && __STDC__)
20 # define PARAMS(Args) Args
21 # else
22 # define PARAMS(Args) ()
23 # endif
24 # endif
26 enum human_inexact_style
28 human_floor = -1,
29 human_round_to_even = 0,
30 human_ceiling = 1
33 char *human_readable PARAMS ((uintmax_t, char *, int, int));
34 char *human_readable_inexact PARAMS ((uintmax_t, char *, int, int,
35 enum human_inexact_style));
37 void human_block_size PARAMS ((char const *, int, int *));
39 #endif /* HUMAN_H_ */