00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #if __GNUC__ >= 3
00022 @PRAGMA_SYSTEM_HEADER@
00023 #endif
00024 @PRAGMA_COLUMNS@
00025
00026
00027
00028
00029
00030
00031 #if (defined __need_time_t || defined __need_clock_t \
00032 || defined __need_timespec \
00033 || defined _GL_TIME_H)
00034
00035 # @INCLUDE_NEXT@ @NEXT_TIME_H@
00036
00037 #else
00038
00039 # define _GL_TIME_H
00040
00041 # @INCLUDE_NEXT@ @NEXT_TIME_H@
00042
00043
00044 # include <stddef.h>
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 # if ! @TIME_H_DEFINES_STRUCT_TIMESPEC@
00057 # if @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
00058 # include <sys/time.h>
00059 # elif @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
00060 # include <pthread.h>
00061
00062 # undef asctime_r
00063 # undef ctime_r
00064 # undef gmtime_r
00065 # undef localtime_r
00066 # undef rand_r
00067 # undef strtok_r
00068 # else
00069
00070 # ifdef __cplusplus
00071 extern "C" {
00072 # endif
00073
00074 # if !GNULIB_defined_struct_timespec
00075 # undef timespec
00076 # define timespec rpl_timespec
00077 struct timespec
00078 {
00079 time_t tv_sec;
00080 long int tv_nsec;
00081 };
00082 # define GNULIB_defined_struct_timespec 1
00083 # endif
00084
00085 # ifdef __cplusplus
00086 }
00087 # endif
00088
00089 # endif
00090 # endif
00091
00092 # if !GNULIB_defined_struct_time_t_must_be_integral
00093
00094
00095
00096
00097
00098 struct __time_t_must_be_integral {
00099 unsigned int __floating_time_t_unsupported : (time_t) 1;
00100 };
00101 # define GNULIB_defined_struct_time_t_must_be_integral 1
00102 # endif
00103
00104
00105
00106
00107 # if @GNULIB_NANOSLEEP@
00108 # if @REPLACE_NANOSLEEP@
00109 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00110 # define nanosleep rpl_nanosleep
00111 # endif
00112 _GL_FUNCDECL_RPL (nanosleep, int,
00113 (struct timespec const *__rqtp, struct timespec *__rmtp)
00114 _GL_ARG_NONNULL ((1)));
00115 _GL_CXXALIAS_RPL (nanosleep, int,
00116 (struct timespec const *__rqtp, struct timespec *__rmtp));
00117 # else
00118 # if ! @HAVE_NANOSLEEP@
00119 _GL_FUNCDECL_SYS (nanosleep, int,
00120 (struct timespec const *__rqtp, struct timespec *__rmtp)
00121 _GL_ARG_NONNULL ((1)));
00122 # endif
00123 _GL_CXXALIAS_SYS (nanosleep, int,
00124 (struct timespec const *__rqtp, struct timespec *__rmtp));
00125 # endif
00126 _GL_CXXALIASWARN (nanosleep);
00127 # endif
00128
00129
00130 # if @GNULIB_MKTIME@
00131 # if @REPLACE_MKTIME@
00132 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00133 # define mktime rpl_mktime
00134 # endif
00135 _GL_FUNCDECL_RPL (mktime, time_t, (struct tm *__tp) _GL_ARG_NONNULL ((1)));
00136 _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
00137 # else
00138 _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
00139 # endif
00140 _GL_CXXALIASWARN (mktime);
00141 # endif
00142
00143
00144
00145
00146 # if @GNULIB_TIME_R@
00147 # if @REPLACE_LOCALTIME_R@
00148 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00149 # undef localtime_r
00150 # define localtime_r rpl_localtime_r
00151 # endif
00152 _GL_FUNCDECL_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
00153 struct tm *restrict __result)
00154 _GL_ARG_NONNULL ((1, 2)));
00155 _GL_CXXALIAS_RPL (localtime_r, struct tm *, (time_t const *restrict __timer,
00156 struct tm *restrict __result));
00157 # else
00158 # if ! @HAVE_DECL_LOCALTIME_R@
00159 _GL_FUNCDECL_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
00160 struct tm *restrict __result)
00161 _GL_ARG_NONNULL ((1, 2)));
00162 # endif
00163 _GL_CXXALIAS_SYS (localtime_r, struct tm *, (time_t const *restrict __timer,
00164 struct tm *restrict __result));
00165 # endif
00166 # if @HAVE_DECL_LOCALTIME_R@
00167 _GL_CXXALIASWARN (localtime_r);
00168 # endif
00169 # if @REPLACE_LOCALTIME_R@
00170 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00171 # undef gmtime_r
00172 # define gmtime_r rpl_gmtime_r
00173 # endif
00174 _GL_FUNCDECL_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
00175 struct tm *restrict __result)
00176 _GL_ARG_NONNULL ((1, 2)));
00177 _GL_CXXALIAS_RPL (gmtime_r, struct tm *, (time_t const *restrict __timer,
00178 struct tm *restrict __result));
00179 # else
00180 # if ! @HAVE_DECL_LOCALTIME_R@
00181 _GL_FUNCDECL_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
00182 struct tm *restrict __result)
00183 _GL_ARG_NONNULL ((1, 2)));
00184 # endif
00185 _GL_CXXALIAS_SYS (gmtime_r, struct tm *, (time_t const *restrict __timer,
00186 struct tm *restrict __result));
00187 # endif
00188 # if @HAVE_DECL_LOCALTIME_R@
00189 _GL_CXXALIASWARN (gmtime_r);
00190 # endif
00191 # endif
00192
00193
00194
00195
00196 # if @GNULIB_STRPTIME@
00197 # if ! @HAVE_STRPTIME@
00198 _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
00199 char const *restrict __format,
00200 struct tm *restrict __tm)
00201 _GL_ARG_NONNULL ((1, 2, 3)));
00202 # endif
00203 _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
00204 char const *restrict __format,
00205 struct tm *restrict __tm));
00206 _GL_CXXALIASWARN (strptime);
00207 # endif
00208
00209
00210 # if @GNULIB_TIMEGM@
00211 # if @REPLACE_TIMEGM@
00212 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
00213 # undef timegm
00214 # define timegm rpl_timegm
00215 # endif
00216 _GL_FUNCDECL_RPL (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
00217 _GL_CXXALIAS_RPL (timegm, time_t, (struct tm *__tm));
00218 # else
00219 # if ! @HAVE_TIMEGM@
00220 _GL_FUNCDECL_SYS (timegm, time_t, (struct tm *__tm) _GL_ARG_NONNULL ((1)));
00221 # endif
00222 _GL_CXXALIAS_SYS (timegm, time_t, (struct tm *__tm));
00223 # endif
00224 _GL_CXXALIASWARN (timegm);
00225 # endif
00226
00227
00228
00229
00230 # if defined GNULIB_POSIXCHECK
00231 # undef asctime
00232 _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
00233 "better use strftime (or even sprintf) instead");
00234 # endif
00235 # if defined GNULIB_POSIXCHECK
00236 # undef asctime_r
00237 _GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
00238 "better use strftime (or even sprintf) instead");
00239 # endif
00240 # if defined GNULIB_POSIXCHECK
00241 # undef ctime
00242 _GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
00243 "better use strftime (or even sprintf) instead");
00244 # endif
00245 # if defined GNULIB_POSIXCHECK
00246 # undef ctime_r
00247 _GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
00248 "better use strftime (or even sprintf) instead");
00249 # endif
00250
00251 #endif