New module 'time', so that apps can include <time.h> as per
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 12 Feb 2007 18:49:19 +0000 (18:49 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 12 Feb 2007 18:49:19 +0000 (18:49 +0000)
commit3ac9552429c5a500717e1d3d129c32f7d0ea37a3
treed4fdd783d13d128eb9982d352264195f37acb429
parent4bc8b69ccf12c40ba0eec577b18e24bdd3cbc945
New module 'time', so that apps can include <time.h> as per
POSIX and GNU instead of separate include files like time_r.h
and timegm.h.  This implementation tries out a simpler approach
for replacing decls in standard include files (as compared to
the string module), somewhat as an experiment.

* config/srclist.txt: Comment out mktime.c for now.
* doc/gnulib-tool.texi (Initial import): Don't use time_r as an example
since it doesn't apply any more.  Use generic wording instead.
* MODULES.html.sh (Support for systems lacking POSIX:2001): New module
'time'.
* lib/time_.h, m4/time_h.m4, modules/time: New files.
* lib/strptime.h, lib/time_r.h, lib/timegm.h: Remove.
* lib/mktime.c: Include config.h depending on _LIBC, not HAVE_CONFIG_H.
Don't include <sys/types.h>; no longer needed since we assume C89.
* lib/mktime.c: Don't include "time_r.h"; no longer needed.
* lib/strftime.c: Likewise.
* lib/time_r.c: Likewise.
* lib/nanosleep.c (nanosleep): #undef after include files, not before.
* lib/nanosleep.c: Include <time.h> first, to check interface.
* lib/strptime.c: Likewise.
* lib/time_r.c: Likewise.
* lib/timegm.c: Likewise.
* lib/strptime.c: Don't include strptime.h or time_r.h; no longer
needed.
* lib/timegm.c: Don't include timegm.h; no longer needed.
* lib/timespec.h: Don't include <sys/time.h> before <time.h>;
time.h now handles any problems in that area.
(struct timespec, nanosleep): Remove; time.h now arranges for these.
* lib/xnanosleep.c: Don't include timespec.h; no longer needed now
that time.h defines struct timespec.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Check that nanosleep is declared.
Set REPLACE_NANOSLEEP.  Don't AC_DEFINE nanosleep; the time module now
handles that.
* m4/strptime.m4 (gl_FUNC_STPRTIME): Set REPLACE_STRPTIME.
* m4/time_r.m4 (gl_TIME_R): Don't define HAVE_TIME_R_POSIX; no longer
needed.  Set REPLACE_LOCALTIME.
* m4/timegm.m4 (gl_FUNC_TIMEGM): Set REPLACE_TIMEGM.
* m4/timespec.m4 (gl_CHECK_TYPE_STRUCT_TIMESPEC): Move to time_h.m4.
(gl_TIMESPEC): Don't check for sys/time.h or struct timespec or
nanosleep; time_h.m4 now does that.  Don't require
gl_USE_SYSTEM_EXTENSIONS; no longer needed directly, and the time
module handles this now.
* modules/getdate (Depends-on): Remove timespec.  Add time.
* modules/nanosleep (Depends-on): Likewise.
* modules/stat-time (Depends-on): Likewise.
* modules/nanosleep (Include): Include time.h, not timespec.h.
* modules/strptime (Files): Remove lib/strptime.h.
(Depends-on): Add extensions, time.
(Include): Include time.h, not strptime.h.
* modules/time_r (Files): Remove lib/time_r.h.
(Depends-on): Add time.
(Include): Include time.h, not time_r.h.
* modules/timegm: Likewise.
* modules/timespec (Description): Now does timespec-related decls
of our own, instead of struct timespec itself.
(Depends-on): Add time; remove extensions.
(Maintainer): Add self.
* modules/utimecmp (Depends-on): Add time; remove timespec.
* modules/utimens (Depends-on): Likewise.
* modules/xnanosleep (Depends-on): Likewise.
33 files changed:
ChangeLog
MODULES.html.sh
config/srclist.txt
doc/gnulib-tool.texi
lib/mktime.c
lib/nanosleep.c
lib/strftime.c
lib/strptime.c
lib/strptime.h [deleted file]
lib/time_.h [new file with mode: 0644]
lib/time_r.c
lib/time_r.h [deleted file]
lib/timegm.c
lib/timegm.h [deleted file]
lib/timespec.h
lib/xnanosleep.c
m4/nanosleep.m4
m4/strptime.m4
m4/time_h.m4 [new file with mode: 0644]
m4/time_r.m4
m4/timegm.m4
m4/timespec.m4
modules/getdate
modules/nanosleep
modules/stat-time
modules/strptime
modules/time [new file with mode: 0644]
modules/time_r
modules/timegm
modules/timespec
modules/utimecmp
modules/utimens
modules/xnanosleep