summaryrefslogtreecommitdiff
path: root/lib/human.h
blob: b91958bec6365299bc89e36a9f37d94835e508a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef HUMAN_H_
# define HUMAN_H_ 1

/* 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.  */
# define LONGEST_HUMAN_READABLE ((sizeof (uintmax_t) + sizeof (int)) \
				 * CHAR_BIT / 3)

# ifndef __P
#  if defined (__GNUC__) || (defined (__STDC__) && __STDC__)
#   define __P(args) args
#  else
#   define __P(args) ()
#  endif  /* GCC.  */
# endif  /* Not __P.  */

char *human_readable __P ((uintmax_t, char *, int, int, int));

#endif /* HUMAN_H_ */