Commit Graph

3546 Commits

Author SHA1 Message Date
Jim Meyering 601fdc5f75 whoops. add strdup.h, not xstrdup.h. 2004-04-02 22:22:00 +00:00
Jim Meyering d2377406d6 (libfetish_a_SOURCES): Add allocsa.c, allocsa.h and strdup.h. 2004-04-02 22:20:06 +00:00
Jim Meyering d49a6c1a2b . 2004-03-31 07:48:14 +00:00
Jim Meyering 000d43c489 *** empty log message *** 2004-03-30 13:50:48 +00:00
Jim Meyering 922e4e22cc Merge changes from emacs (via gnulib). 2004-03-30 13:50:44 +00:00
Jim Meyering a3bae2f417 *** empty log message *** 2004-03-29 07:29:23 +00:00
Jim Meyering edf60899e0 [HAVE_UNISTD_H]: Include <unistd.h>, for resolvepath declaration. 2004-03-29 07:29:06 +00:00
Jim Meyering 829a38c5d3 Include dirfd.h, for dirfd. 2004-03-29 07:28:52 +00:00
Jim Meyering d2ec7be5c3 *** empty log message *** 2004-03-24 17:37:08 +00:00
Jim Meyering 226248d531 (humblock): Support BLOCKSIZE envvar, as well as BLOCK_SIZE. 2004-03-24 17:36:57 +00:00
Jim Meyering b3601c900a . 2004-03-24 15:19:40 +00:00
Jim Meyering f358d24e32 *** empty log message *** 2004-03-24 14:45:23 +00:00
Jim Meyering 393592573c (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.
2004-03-24 14:45:17 +00:00
Jim Meyering 6a8f1849c1 . 2004-03-23 20:17:58 +00:00
Jim Meyering b573808b27 Remove space(s) before TAB. 2004-03-23 18:04:35 +00:00
Jim Meyering 3eb991fe9e whoops: getopt_int.h, not getopt_int.c. 2004-03-23 17:34:05 +00:00
Jim Meyering 42401183af Sync from gnulib. 2004-03-23 17:33:25 +00:00
Jim Meyering 546413e85a . 2004-03-23 17:33:02 +00:00
Jim Meyering fe2103f357 New file, from gnulib. 2004-03-23 17:32:11 +00:00
Jim Meyering 2a90dd7d2f (libfetish_a_SOURCES): Add getopt_int.h. 2004-03-23 17:31:11 +00:00
Jim Meyering 9e8815a79d *** empty log message *** 2004-03-23 17:18:59 +00:00
Jim Meyering 33f43662ef Sync from gnulib.
* mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
2004-03-23 17:18:54 +00:00
Jim Meyering 806490628c Sync from gnulib.
* mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
	not on all platforms that have <wchar.h>.
2004-03-23 17:18:37 +00:00
Jim Meyering ec8d695194 . 2004-03-22 20:40:03 +00:00
Jim Meyering 92bd801772 (libfetish_a_SOURCES): Add readtokens0.c and readtokens0.h 2004-03-22 20:00:44 +00:00
Jim Meyering 96cafaac76 *** empty log message *** 2004-03-22 20:00:27 +00:00
Jim Meyering 82efb0955e *** empty log message *** 2004-03-21 19:50:46 +00:00
Jim Meyering 420f2c7a7e *** empty log message *** 2004-03-21 19:50:31 +00:00
Jim Meyering 846d81da01 (readtoken): Don't leak 64 bytes when reading an empty input stream. 2004-03-21 19:50:17 +00:00
Jim Meyering f25499439b *** empty log message *** 2004-03-21 18:49:13 +00:00
Jim Meyering 4ee9bda98e 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.
2004-03-21 18:49:06 +00:00
Jim Meyering 7c3d57a267 (readtoken, readtokens): Update prototypes. 2004-03-21 18:48:54 +00:00
Jim Meyering 590b3ed337 *** empty log message *** 2004-03-17 10:09:24 +00:00
Jim Meyering bf3bf1462e 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.
2004-03-17 10:09:16 +00:00
Jim Meyering aa11f812a2 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.
2004-03-17 10:09:02 +00:00
Jim Meyering f18a2980a7 *** empty log message *** 2004-03-15 08:37:07 +00:00
Jim Meyering fae8b8505c `date --date="21:04 +0100" +%S' would print the seconds value
from the current time, rather than `00'.

For a date string like `10:23 +0100',
set the number of seconds to zero.  Reported by Marc Haber.
2004-03-15 08:37:03 +00:00
Jim Meyering 98ea4dad08 . 2004-03-11 09:25:53 +00:00
Jim Meyering 118cee9878 . 2004-03-04 13:14:11 +00:00
Jim Meyering f7291db3f9 *** empty log message *** 2004-03-04 13:13:51 +00:00
Jim Meyering e7c9ecd175 (getloadavg): Use true', not 1'. 2004-03-04 13:13:43 +00:00
Jim Meyering 44ebf255de *** empty log message *** 2004-03-04 13:08:37 +00:00
Jim Meyering f5057405b1 (set_cloexec_flag) [ ! (F_GETFD && F_SETFD)]: Return true, not false. 2004-03-04 13:08:29 +00:00
Jim Meyering b8e698744e *** empty log message *** 2004-03-04 08:50:34 +00:00
Jim Meyering a07aa7e020 Include <stdbool.h>.
Adjust signature to use `bool' rather than `int'.
2004-03-04 08:49:10 +00:00
Jim Meyering a1c30fd7d1 Include "cloexec.h" first, and <unistd.h> before <fcntl.h>.
(set_cloexec_flag): Use bool for booleans.  All uses changed.
If F_GETFD returns a negative number (not just -1), report a
failure.  Don't use F_SETFD if the flags are already right.
Don't report a failure with F_SETFD unless it returns -1.
2004-03-04 08:42:20 +00:00
Jim Meyering e819dd0dd9 Include "cloexec.h".
(getloadavg): Use set_cloexec_flag instead of manual fcntl call.
2004-03-03 22:06:47 +00:00
Jim Meyering 06a57a878f *** empty log message *** 2004-03-03 22:06:17 +00:00
Jim Meyering 4ff061cf60 (libfetish_a_SOURCES): Add cloexec.c, cloexec.h. 2004-03-03 22:06:11 +00:00
Jim Meyering 534ec4c800 from Dmitry V. Levin 2004-03-03 22:01:56 +00:00