human.h (131447) | human.h (133543) |
---|---|
1/* human.h -- print human readable file size 2 | 1/* human.h -- print human readable file size 2 |
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free 4 Software Foundation, Inc. | 3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 4 Free Software Foundation, Inc. |
5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of --- 11 unchanged lines hidden (view full) --- 24 25# if HAVE_CONFIG_H 26# include <config.h> 27# endif 28 29# include <limits.h> 30# include <stdbool.h> 31 | 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of --- 11 unchanged lines hidden (view full) --- 24 25# if HAVE_CONFIG_H 26# include <config.h> 27# endif 28 29# include <limits.h> 30# include <stdbool.h> 31 |
32# if HAVE_INTTYPES_H 33# include <inttypes.h> 34# else 35# if HAVE_STDINT_H 36# include <stdint.h> 37# endif | 32# if HAVE_STDINT_H 33# include <stdint.h> |
38# endif | 34# endif |
35# if HAVE_UNISTD_H 36# include <unistd.h> 37# endif |
|
39 40/* A conservative bound on the maximum length of a human-readable string. 41 The output can be the square of the largest uintmax_t, so double 42 its size before converting to a bound. 43 302 / 1000 is ceil (log10 (2.0)). Add 1 for integer division truncation. 44 Also, the output can have a thousands separator between every digit, 45 so multiply by MB_LEN_MAX + 1 and then subtract MB_LEN_MAX. 46 Finally, append 3, the maximum length of a suffix. */ --- 43 unchanged lines hidden --- | 38 39/* A conservative bound on the maximum length of a human-readable string. 40 The output can be the square of the largest uintmax_t, so double 41 its size before converting to a bound. 42 302 / 1000 is ceil (log10 (2.0)). Add 1 for integer division truncation. 43 Also, the output can have a thousands separator between every digit, 44 so multiply by MB_LEN_MAX + 1 and then subtract MB_LEN_MAX. 45 Finally, append 3, the maximum length of a suffix. */ --- 43 unchanged lines hidden --- |