New upstream version 1.9
[debian/gzip] / lib / time.in.h
index 865c114119680ca398343cc32d0be2f1ad2b0e28..a2dca89340cf5d643961e1fddcdf4376019e02b4 100644 (file)
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2018 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
@@ -13,7 +13,7 @@
    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/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
@@ -120,6 +120,24 @@ _GL_CXXALIAS_SYS (nanosleep, int,
 _GL_CXXALIASWARN (nanosleep);
 # endif
 
+/* Initialize time conversion information.  */
+# if @GNULIB_TZSET@
+#  if @REPLACE_TZSET@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef tzset
+#    define tzset rpl_tzset
+#   endif
+_GL_FUNCDECL_RPL (tzset, void, (void));
+_GL_CXXALIAS_RPL (tzset, void, (void));
+#  else
+#   if ! @HAVE_TZSET@
+_GL_FUNCDECL_SYS (tzset, void, (void));
+#   endif
+_GL_CXXALIAS_SYS (tzset, void, (void));
+#  endif
+_GL_CXXALIASWARN (tzset);
+# endif
+
 /* Return the 'time_t' representation of TP and normalize TP.  */
 # if @GNULIB_MKTIME@
 #  if @REPLACE_MKTIME@
@@ -187,7 +205,7 @@ _GL_CXXALIASWARN (gmtime_r);
 /* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
    <http://www.opengroup.org/susv3xsh/localtime.html> and
    <http://www.opengroup.org/susv3xsh/gmtime.html>.  */
-# if @GNULIB_GETTIMEOFDAY@
+# if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@
 #  if @REPLACE_LOCALTIME@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef localtime
@@ -202,7 +220,7 @@ _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
 _GL_CXXALIASWARN (localtime);
 # endif
 
-# if @GNULIB_GETTIMEOFDAY@
+# if 0 || @REPLACE_GMTIME@
 #  if @REPLACE_GMTIME@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef gmtime
@@ -217,7 +235,7 @@ _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
 _GL_CXXALIASWARN (gmtime);
 # endif
 
-/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
+/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store
    the resulting broken-down time into TM.  See
    <http://www.opengroup.org/susv3xsh/strptime.html>.  */
 # if @GNULIB_STRPTIME@
@@ -233,6 +251,41 @@ _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
 _GL_CXXALIASWARN (strptime);
 # endif
 
+/* Convert *TP to a date and time string.  See
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime.html>.  */
+# if @GNULIB_CTIME@
+#  if @REPLACE_CTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define ctime rpl_ctime
+#   endif
+_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
+                                 _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
+#  else
+_GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
+#  endif
+_GL_CXXALIASWARN (ctime);
+# endif
+
+/* Convert *TP to a date and time string.  See
+   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html>.  */
+# if @GNULIB_STRFTIME@
+#  if @REPLACE_STRFTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define strftime rpl_strftime
+#   endif
+_GL_FUNCDECL_RPL (strftime, size_t, (char *__buf, size_t __bufsize,
+                                     const char *__fmt, const struct tm *__tp)
+                                    _GL_ARG_NONNULL ((1, 3, 4)));
+_GL_CXXALIAS_RPL (strftime, size_t, (char *__buf, size_t __bufsize,
+                                     const char *__fmt, const struct tm *__tp));
+#  else
+_GL_CXXALIAS_SYS (strftime, size_t, (char *__buf, size_t __bufsize,
+                                     const char *__fmt, const struct tm *__tp));
+#  endif
+_GL_CXXALIASWARN (strftime);
+# endif
+
 # if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
 typedef struct tm_zone *timezone_t;
 _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));