fix github issue #31, allow time overrides for all time uses
This commit is contained in:
parent
4c2bf4ea34
commit
023f44bacf
@ -156,6 +156,34 @@
|
||||
#define XTIME(tl) time((tl))
|
||||
#endif /* STACK_TRAP */
|
||||
|
||||
#elif defined(TIME_OVERRIDES)
|
||||
/* user would like to override time() and gmtime() functionality */
|
||||
|
||||
#ifndef HAVE_TIME_T_TYPE
|
||||
typedef long time_t;
|
||||
#endif
|
||||
extern time_t XTIME(time_t * timer);
|
||||
|
||||
#ifndef HAVE_TM_TYPE
|
||||
struct tm {
|
||||
int tm_sec; /* seconds after the minute [0-60] */
|
||||
int tm_min; /* minutes after the hour [0-59] */
|
||||
int tm_hour; /* hours since midnight [0-23] */
|
||||
int tm_mday; /* day of the month [1-31] */
|
||||
int tm_mon; /* months since January [0-11] */
|
||||
int tm_year; /* years since 1900 */
|
||||
int tm_wday; /* days since Sunday [0-6] */
|
||||
int tm_yday; /* days since January 1 [0-365] */
|
||||
int tm_isdst; /* Daylight Savings Time flag */
|
||||
long tm_gmtoff; /* offset from CUT in seconds */
|
||||
char *tm_zone; /* timezone abbreviation */
|
||||
};
|
||||
#endif
|
||||
extern struct tm* XGMTIME(const time_t* timer);
|
||||
|
||||
#ifndef HAVE_VALIDATE_DATE
|
||||
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
||||
#endif
|
||||
#else
|
||||
/* default */
|
||||
/* uses complete <time.h> facility */
|
||||
|
Loading…
x
Reference in New Issue
Block a user