b91958bec6365299bc89e36a9f37d94835e508a3
[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)) \
8                                  * CHAR_BIT / 3)
9
10 # ifndef __P
11 #  if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
12 #   define __P(args) args
13 #  else
14 #   define __P(args) ()
15 #  endif  /* GCC.  */
16 # endif  /* Not __P.  */
17
18 char *human_readable __P ((uintmax_t, char *, int, int, int));
19
20 #endif /* HUMAN_H_ */