Jim Meyering
44dcbba28a
(suffixes): Prefer K to k for 1024.
...
(generate_suffix_backwards): New function.
(human_readable_inexact): Use it.
2001-12-19 15:05:33 +00:00
Jim Meyering
ff5aea354f
(adjust_value): New function.
...
(human_readable_inexact): Apply rounding style even when
printing approximate values.
2000-06-16 12:51:28 +00:00
Jim Meyering
fbc3c192c1
(human_readable_inexact): Allow an input block
...
size that is not a multiple of the output block size, and vice versa.
2000-06-15 12:21:10 +00:00
Jim Meyering
4fef810c37
use double quotes, not single quotes around syntax-error-evoking string
2000-02-27 17:54:25 +00:00
Jim Meyering
8041fd5301
Use #if !HAVE_DECL...' instead of #ifndef HAVE_DECL..'
...
now that autoconf always defines the HAVE_DECL_ symbols.
Arrange for cpp to fail if the configure-time
declaration check was not run.
2000-02-27 17:40:24 +00:00
Jim Meyering
41c5f76c2f
(default_block_size): New function.
...
(humblock): Use it if no block size is specified.
(human_block_size): If the specified block size is zero, report an
error if report_errors is nonzero; otherwise use the default.
1999-11-07 21:06:02 +00:00
Jim Meyering
8999870c56
(human_readable): New function.
...
(human_readable_inexact): Renamed from human_readable, with new arg
INEXACT_STYLE. Add support for ceiling and floor.
1999-07-04 08:47:28 +00:00
Jim Meyering
1ee4fffc88
(human_readable): Allow from_block_size to be zero.
1999-05-17 13:03:46 +00:00
Jim Meyering
c93ac403ed
Include <string.h> or <strings.h> for strlen prototype.
1999-05-13 20:48:44 +00:00
Jim Meyering
e3a368948e
Don't include inttypes.h here.
1999-04-25 19:18:55 +00:00
Jim Meyering
30edff7a36
Include xstrtol.h, not xstrtoul.h, since xstrtol.h now defines all the
...
xstrto... functions.
1999-04-18 23:18:32 +00:00
Jim Meyering
2d4f0fea3a
(humblock): Use ARGMATCH in place of argmatch.
1999-01-01 06:47:04 +00:00
Jim Meyering
3b87431a69
(human_readable): amt -> damt, to fix typo when
...
computing which power to use after overflow occurs during
multiplication.
From Paul Eggert.
1998-07-22 18:30:16 +00:00
Jim Meyering
ea7102f120
* lib/human.c, lib/human.h (human_readable): Coalesce last two args
...
into one, for convenience. All callers changed.
(human_block_size): New function.
* lib/human.c: Include <config.h> only if HAVE_CONFIG_H.
Include <stdlib.h> if HAVE_STDLIB_H;
declare getenv unless HAVE_DECL_GETENV.
(_): New macro.
Include <argmatch.h>, <error.h>, <xstrtoul.h>.
(DEFAULT_BLOCK_SIZE): New macro.
(block_size_args, block_size_types): New constants.
(humblock): New function.
1998-06-29 15:23:04 +00:00
Jim Meyering
00c42a8936
(human_readable): Convert to ANSI-style definition.
...
[lint]: Define `power'.
1997-11-30 11:10:24 +00:00
Jim Meyering
240cb49efe
New file. The interface is inspired
...
by the human_readable function that was in du.c, but it's pretty
much rewritten from scratch.
1997-11-30 10:24:32 +00:00