Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

human.h

Go to the documentation of this file.
00001 #ifndef HUMAN_H_
00002 # define HUMAN_H_ 1
00003 
00004 # if HAVE_CONFIG_H
00005 #  include <config.h>
00006 # endif
00007 
00008 # if HAVE_INTTYPES_H
00009 #  include <inttypes.h>
00010 # endif
00011 
00012 /* A conservative bound on the maximum length of a human-readable string.
00013    The output can be the product of the largest uintmax_t and the largest int,
00014    so add their sizes before converting to a bound on digits.  */
00015 # define LONGEST_HUMAN_READABLE ((sizeof (uintmax_t) + sizeof (int)) \
00016              * CHAR_BIT / 3)
00017 
00018 # ifndef PARAMS
00019 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
00020 #   define PARAMS(Args) Args
00021 #  else
00022 #   define PARAMS(Args) ()
00023 #  endif
00024 # endif
00025 
00026 enum human_inexact_style
00027 {
00028   human_floor = -1,
00029   human_round_to_even = 0,
00030   human_ceiling = 1
00031 };
00032 
00033 char *human_readable PARAMS ((uintmax_t, char *, int, int));
00034 char *human_readable_inexact PARAMS ((uintmax_t, char *, int, int,
00035                   enum human_inexact_style));
00036 
00037 void human_block_size PARAMS ((char const *, int, int *));
00038 
00039 #endif /* HUMAN_H_ */

Generated on Mon Apr 7 19:41:45 2003 for DuTree by doxygen1.2.18