New file. The interface is inspired
[gnulib.git] / lib / human.h
1 #ifndef HUMAN_H_
2 # define HUMAN_H_ 1
3
4 /* A conservative bound on the maximum length of a human-readable string.
5    The output can be the product of the largest uintmax_t and the largest int,
6    so add their sizes before converting to a bound on digits.  */
7 #define LONGEST_HUMAN_READABLE ((sizeof (uintmax_t) + sizeof (int)) * CHAR_BIT / 3)
8
9 #ifndef __P
10 # if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
11 #  define __P(args) args
12 # else
13 #  define __P(args) ()
14 # endif  /* GCC.  */
15 #endif  /* Not __P.  */
16
17 char *human_readable __P ((uintmax_t, char *, int, int, int));
18
19 #endif /* HUMAN_H_ */