Mercurial > hg > octave-jordi > gnulib-hg
view lib/strftime.h @ 18060:ea0b31e02258
fprintftime, strftime: use timezone_t args
* NEWS: Document the change.
* lib/fprintftime.h (fprintftime):
* lib/strftime.c (extra_args) [my_strftime]:
* lib/strftime.h (nstrftime):
Time zone arg is now of type timezone_t, not int.
* lib/strftime.c (mktime_z) [_LIBC]: New macro.
(__gmtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: Remove; no longer used.
(my_strftime) [emacs && !my_strftime]:
(emacs_strftimeu) [emacs && !FPRINTFTIME]:
Remove; Emacs doesn't need this any more.
(HAVE_TZSET) [my_strftime]: Unset, since we no longer want
fprintftime and nstrftime to call tzset.
(ut) [!my_strftime]: Remove, replacing with ...
(tz) [!my_stftime]: ... this new macro. All uses changed.
(strftime_case_): Use localtime_rz and mktime_z instead
of localtime_r and mktime.
* modules/fprintftime (Depends-on): Add time_rz.
* modules/strftime (Depends-on): Add time_rz. Remove time_r.
* tests/test-strftime.c (main): Adjust to new nstrftime API.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 23 Jul 2015 18:28:13 -0700 |
parents | ab58d4870664 |
children |
line wrap: on
line source
/* declarations for strftime.c Copyright (C) 2002, 2004, 2008-2015 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <time.h> #ifdef __cplusplus extern "C" { #endif /* Just like strftime, but with two more arguments: POSIX requires that strftime use the local timezone information. Use the timezone __TZ instead. Use __NS as the number of nanoseconds in the %N directive. */ size_t nstrftime (char *, size_t, char const *, struct tm const *, timezone_t __tz, int __ns); #ifdef __cplusplus } #endif