00001 #ifndef TIME64_H
00002 # define TIME64_H
00003
00004 #include <time.h>
00005 #include "time64_config.h"
00006
00007
00008 typedef INT_64_T Int64;
00009 typedef Int64 Time64_T;
00010 typedef Int64 Year;
00011
00012
00013
00014 struct TM64 {
00015 int tm_sec;
00016 int tm_min;
00017 int tm_hour;
00018 int tm_mday;
00019 int tm_mon;
00020 Year tm_year;
00021 int tm_wday;
00022 int tm_yday;
00023 int tm_isdst;
00024
00025 #ifdef HAS_TM_TM_GMTOFF
00026 long tm_gmtoff;
00027 #endif
00028
00029 #ifdef HAS_TM_TM_ZONE
00030 char *tm_zone;
00031 #endif
00032 };
00033
00034
00035
00036 #ifdef USE_TM64
00037 #define TM TM64
00038 #else
00039 #define TM tm
00040 #endif
00041
00042
00043
00044 struct TM *gmtime64_r (const Time64_T *, struct TM *);
00045 struct TM *localtime64_r (const Time64_T *, struct TM *);
00046 struct TM *gmtime64 (const Time64_T *);
00047 struct TM *localtime64 (const Time64_T *);
00048
00049 char *asctime64 (const struct TM *);
00050 char *asctime64_r (const struct TM *, char *);
00051
00052 char *ctime64 (const Time64_T*);
00053 char *ctime64_r (const Time64_T*, char*);
00054
00055 Time64_T timegm64 (const struct TM *);
00056 Time64_T mktime64 (const struct TM *);
00057 Time64_T timelocal64 (const struct TM *);
00058
00059
00060
00061 #ifdef HAS_LOCALTIME_R
00062 # define LOCALTIME_R(clock, result) localtime_r(clock, result)
00063 #else
00064 # define LOCALTIME_R(clock, result) fake_localtime_r(clock, result)
00065 #endif
00066 #ifdef HAS_GMTIME_R
00067 # define GMTIME_R(clock, result) gmtime_r(clock, result)
00068 #else
00069 # define GMTIME_R(clock, result) fake_gmtime_r(clock, result)
00070 #endif
00071
00072
00073
00074 #ifdef USE_TM64
00075 #define TM64_ASCTIME_FORMAT "%.3s %.3s%3d %.2d:%.2d:%.2d %lld\n"
00076 #else
00077 #define TM64_ASCTIME_FORMAT "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n"
00078 #endif
00079
00080
00081 #endif