1997-11-30 18:24:32 +08:00
|
|
|
#ifndef HUMAN_H_
|
|
|
|
# define HUMAN_H_ 1
|
|
|
|
|
1999-04-26 03:20:18 +08:00
|
|
|
# if HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# if HAVE_INTTYPES_H
|
|
|
|
# include <inttypes.h>
|
|
|
|
# endif
|
|
|
|
|
1997-11-30 18:24:32 +08:00
|
|
|
/* 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. */
|
1997-11-30 19:08:39 +08:00
|
|
|
# define LONGEST_HUMAN_READABLE ((sizeof (uintmax_t) + sizeof (int)) \
|
|
|
|
* CHAR_BIT / 3)
|
1997-11-30 18:24:32 +08:00
|
|
|
|
1997-12-21 19:22:51 +08:00
|
|
|
# ifndef PARAMS
|
|
|
|
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
|
|
|
# define PARAMS(Args) Args
|
1997-11-30 19:08:39 +08:00
|
|
|
# else
|
1997-12-21 19:22:51 +08:00
|
|
|
# define PARAMS(Args) ()
|
|
|
|
# endif
|
|
|
|
# endif
|
1997-11-30 18:24:32 +08:00
|
|
|
|
1999-07-04 16:47:49 +08:00
|
|
|
enum human_inexact_style
|
|
|
|
{
|
|
|
|
human_floor = -1,
|
|
|
|
human_round_to_even = 0,
|
|
|
|
human_ceiling = 1
|
|
|
|
};
|
|
|
|
|
1998-06-29 23:23:45 +08:00
|
|
|
char *human_readable PARAMS ((uintmax_t, char *, int, int));
|
1999-07-04 16:47:49 +08:00
|
|
|
char *human_readable_inexact PARAMS ((uintmax_t, char *, int, int,
|
|
|
|
enum human_inexact_style));
|
1998-06-29 23:23:45 +08:00
|
|
|
|
|
|
|
void human_block_size PARAMS ((char const *, int, int *));
|
1997-11-30 18:24:32 +08:00
|
|
|
|
|
|
|
#endif /* HUMAN_H_ */
|