Jim Meyering [Wed, 24 Mar 2004 15:13:55 +0000 (15:13 +0000)]
(EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
Remove: not used.
(usage): Say "NUL-terminated", not "NUL-separated".
(main): Check for I/O error when istream is closed.
Allow --files0-from=F even if F is empty; this specifies no files.
(du_files): Now that we allow the list of files to be empty,
handle that case.
Jim Meyering [Wed, 24 Mar 2004 14:45:17 +0000 (14:45 +0000)]
(readtokens0): Return true on success rather
than on failure. All callers changed. This also happens to fix a
portability bug on pre-C99 hosts, where (bool) INTEGER sometimes
returns false even when INTEGER is nonzero.
Jim Meyering [Mon, 22 Mar 2004 22:26:16 +0000 (22:26 +0000)]
(.x.1): Remove --info-page= option, reverting
the change of 2004-01-22. I can no longer reproduce the problem
that prompted that change, and `info coreutils pr' would display the
`printing text' section of the manual, not the one on `pr invocation'.
Jim Meyering [Mon, 22 Mar 2004 20:03:38 +0000 (20:03 +0000)]
Include "readtokens0.h" rather than "readtokens.h".
(main): Use readtoken0 functions rather than readtokens.
Don't use errno when diagnosing readtokens0 failure.
Jim Meyering [Sun, 21 Mar 2004 18:49:06 +0000 (18:49 +0000)]
Include <stdbool.h>.
(readtoken): Use `size_t' rather than int/long.
All callers adjusted.
Use `bool' rather than `int' where appropriate.
Use memset rather than an explicit loop.
Use x2nrealloc rather than xrealloc.
Allow the use of `\0' as a delimiter.
(readtokens): Likewise.
Jim Meyering [Sun, 21 Mar 2004 18:44:25 +0000 (18:44 +0000)]
du accepts a new option --from0-file=FILE, where FILE contains
a list of NUL-separated file names.
Include "readtokens.h".
(usage): Describe the new option, and adjust the `Usage':
with this option, no FILE may be specified on the command line.
(main): Handle the new option.
Jim Meyering [Wed, 17 Mar 2004 17:37:28 +0000 (17:37 +0000)]
(General date syntax, Time of day items): Likewise.
Add copyright notice. Change getdate to
get_date when talking about the function name.
(Seconds since the Epoch): New section, containing the time_t
info moved from Date input formats section, along with new
info about the @ syntax. Mention negative time stamps,
fractional time stamps, and leap seconds.
(General date syntax): Modernize examples a bit to reflect new
features.
(General date syntax, Relative items in date strings):
Use ' rather than " to quote formats.
(Time of day items): Add an example with fractional seconds.
Describe fractional-second syntax.
Jim Meyering [Wed, 17 Mar 2004 17:31:15 +0000 (17:31 +0000)]
(touch invocation):
Describe use of fractional seconds.
(date invocation, Options for date): Likewise.
(date invocation): Mention effect of LC_TIME.
(Options for date): Describe new --iso-8601=ns option.
Jim Meyering [Wed, 17 Mar 2004 10:09:16 +0000 (10:09 +0000)]
Include "getdate.h" first, as we can now
assume C89 and don't need to worry about 'const'.
Similarly, include "unlocked-io.h" near start, not in middle.
Include <limits.h>.
(textint.value): Use long int rather than int.
(textint.digits): Use size_t rather than int.
(BILLION, LOG10_BILLION): New constants.
(parser_control): New member rel_ns. Members day_ordinal,
time_zone, month, day, hour, minutes, rel_year, rel_month,
rel_day, rel_hour, rel_minutes, rel_seconds
are now long int, not int. Member seconds is now struct timespec,
not int. New member timespec_seen. Members dates_seen, days_seen,
local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
not int.
(%union.intval): Now long int, not int.
New member timespec.
(tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
(seconds, signed_seconds, unsigned_seconds): New nonterminals.
(spec): Now is a timespec or an item list.
(timespec, items): New nonterminals.
(time, rel, relunit, number, get_date):
Add support for fractional seconds.
(time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
(gmtime, localtime, mktime): Remove decls; not needed with C89.
(to_hour): First arg is now long int, not int.
(to_year): Returns long int, not int.
Don't treat year -70 like 70.
(tm_diff): Returns long int, not int.
(lookup_word): Use bool instead of int when appropriate.
(yylex): Use size_t for count, not int.
Detect overflow when parsing large integer constants.
Add support for fractions.
(get_date): Make pointers 'const' if possible.
Use more-portable code to detect integer overflow.
(main) [TEST]: Adjust to above changes. Test for localtime failure.
Don't use ctime; it's not reliable if the year has >4 digits.
Jim Meyering [Wed, 17 Mar 2004 10:09:02 +0000 (10:09 +0000)]
Include stdbool.h, and timespec.h instead of
the usual <time.h> dance.
(get_date): Change signature to support fractional time stamps.
All callers changed.
Jim Meyering [Wed, 17 Mar 2004 10:07:19 +0000 (10:07 +0000)]
(enum Time_spec): New enum TIME_SPEC_NS.
(time_spec_string, time_spec, show_date): Support it.
(usage): Remove description of -ITIMESPEC, as it's obsolete and
confusing. Mention --iso-8601=ns.
(batch_convert): getline returns ssize_t, not int.
Jim Meyering [Wed, 17 Mar 2004 10:06:57 +0000 (10:06 +0000)]
(newtime): Now an array of two timespecs, one
for access and one for modification.
(ref_stats): Remove.
(get_reldate): Use get_date's parameter profile.
(touch, main): Adjust to above changes.
(main): Work even if tm_year == INT_MAX (so long as long int is wider).
Use gettime instead of gettimeofday, for new get_date signature.