Back to index

glibc  2.9
time.h
Go to the documentation of this file.
00001 #ifndef _TIME_H
00002 #if defined __need_time_t  || defined __need_clock_t || defined __need_timespec
00003 # include <time/time.h>
00004 #else
00005 # include <time/time.h>
00006 # include <xlocale.h>
00007 
00008 __BEGIN_DECLS
00009 
00010 extern __typeof (strftime_l) __strftime_l;
00011 libc_hidden_proto (__strftime_l)
00012 extern __typeof (strptime_l) __strptime_l;
00013 
00014 libc_hidden_proto (time)
00015 libc_hidden_proto (asctime)
00016 libc_hidden_proto (mktime)
00017 libc_hidden_proto (timelocal)
00018 libc_hidden_proto (localtime)
00019 libc_hidden_proto (strftime)
00020 libc_hidden_proto (strptime)
00021 
00022 librt_hidden_proto (clock_gettime)
00023 
00024 /* Now define the internal interfaces.  */
00025 struct tm;
00026 
00027 /* Defined in mktime.c.  */
00028 extern const unsigned short int __mon_yday[2][13] attribute_hidden;
00029 
00030 /* Defined in localtime.c.  */
00031 extern struct tm _tmbuf attribute_hidden;
00032 
00033 /* Defined in tzset.c.  */
00034 extern char *__tzstring (const char *string);
00035 
00036 /* Defined in tzset.c. */
00037 extern size_t __tzname_cur_max attribute_hidden;
00038 
00039 
00040 extern int __use_tzfile attribute_hidden;
00041 
00042 extern void __tzfile_read (const char *file, size_t extra,
00043                         char **extrap);
00044 extern void __tzfile_compute (time_t timer, int use_localtime,
00045                            long int *leap_correct, int *leap_hit,
00046                            struct tm *tp);
00047 extern void __tzfile_default (const char *std, const char *dst,
00048                            long int stdoff, long int dstoff);
00049 extern void __tzset_parse_tz (const char *tz);
00050 extern void __tz_compute (time_t timer, struct tm *tm, int use_localtime)
00051      __THROW internal_function;
00052 
00053 /* Subroutine of `mktime'.  Return the `time_t' representation of TP and
00054    normalize TP, given that a `struct tm *' maps to a `time_t' as performed
00055    by FUNC.  Keep track of next guess for time_t offset in *OFFSET.  */
00056 extern time_t __mktime_internal (struct tm *__tp,
00057                              struct tm *(*__func) (const time_t *,
00058                                                  struct tm *),
00059                              time_t *__offset);
00060 extern struct tm *__localtime_r (__const time_t *__timer,
00061                              struct tm *__tp) attribute_hidden;
00062 
00063 extern struct tm *__gmtime_r (__const time_t *__restrict __timer,
00064                            struct tm *__restrict __tp);
00065 libc_hidden_proto (__gmtime_r)
00066 
00067 /* Compute the `struct tm' representation of *T,
00068    offset OFFSET seconds east of UTC,
00069    and store year, yday, mon, mday, wday, hour, min, sec into *TP.
00070    Return nonzero if successful.  */
00071 extern int __offtime (__const time_t *__timer,
00072                     long int __offset,
00073                     struct tm *__tp);
00074 
00075 extern char *__asctime_r (__const struct tm *__tp, char *__buf);
00076 extern void __tzset (void);
00077 
00078 /* Prototype for the internal function to get information based on TZ.  */
00079 extern struct tm *__tz_convert (const time_t *timer, int use_localtime, struct tm *tp);
00080 
00081 /* Return the maximum length of a timezone name.
00082    This is what `sysconf (_SC_TZNAME_MAX)' does.  */
00083 extern long int __tzname_max (void);
00084 
00085 extern int __nanosleep (__const struct timespec *__requested_time,
00086                      struct timespec *__remaining);
00087 libc_hidden_proto (__nanosleep)
00088 extern int __nanosleep_nocancel (__const struct timespec *__requested_time,
00089                              struct timespec *__remaining)
00090   attribute_hidden;
00091 extern int __getdate_r (__const char *__string, struct tm *__resbufp);
00092 
00093 
00094 /* Determine CLK_TCK value.  */
00095 extern int __getclktck (void);
00096 
00097 
00098 /* strptime support.  */
00099 extern char * __strptime_internal (const char *rp, const char *fmt,
00100                                struct tm *tm, void *statep,
00101                                __locale_t locparam)
00102      internal_function;
00103 
00104 extern double __difftime (time_t time1, time_t time0);
00105 
00106 
00107 /* Use in the clock_* functions.  Size of the field representing the
00108    actual clock ID.  */
00109 #ifndef _ISOMAC
00110 # define CLOCK_IDFIELD_SIZE 3
00111 #endif
00112 
00113 __END_DECLS
00114 
00115 #endif
00116 #endif