2002-04-18 05:23:31 +08:00
|
|
|
/* local header used by libc/time routines */
|
|
|
|
#include <_ansi.h>
|
|
|
|
#include <time.h>
|
2020-10-05 20:50:13 +08:00
|
|
|
#include <sys/_tz_structs.h>
|
2002-04-18 05:23:31 +08:00
|
|
|
|
|
|
|
#define SECSPERMIN 60L
|
|
|
|
#define MINSPERHOUR 60L
|
|
|
|
#define HOURSPERDAY 24L
|
|
|
|
#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
|
|
|
|
#define SECSPERDAY (SECSPERHOUR * HOURSPERDAY)
|
|
|
|
#define DAYSPERWEEK 7
|
|
|
|
#define MONSPERYEAR 12
|
|
|
|
|
|
|
|
#define YEAR_BASE 1900
|
|
|
|
#define EPOCH_YEAR 1970
|
|
|
|
#define EPOCH_WDAY 4
|
|
|
|
#define EPOCH_YEARS_SINCE_LEAP 2
|
|
|
|
#define EPOCH_YEARS_SINCE_CENTURY 70
|
|
|
|
#define EPOCH_YEARS_SINCE_LEAP_CENTURY 370
|
|
|
|
|
|
|
|
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
|
|
|
|
|
2017-12-04 13:54:48 +08:00
|
|
|
int __tzcalc_limits (int __year);
|
2002-04-18 05:23:31 +08:00
|
|
|
|
2017-12-04 10:25:16 +08:00
|
|
|
extern const int __month_lengths[2][MONSPERYEAR];
|
2014-09-12 05:55:01 +08:00
|
|
|
|
2017-12-04 13:54:48 +08:00
|
|
|
void _tzset_unlocked_r (struct _reent *);
|
|
|
|
void _tzset_unlocked (void);
|
2015-03-31 17:14:22 +08:00
|
|
|
|
2002-04-18 05:23:31 +08:00
|
|
|
/* locks for multi-threading */
|
|
|
|
#ifdef __SINGLE_THREAD__
|
|
|
|
#define TZ_LOCK
|
|
|
|
#define TZ_UNLOCK
|
|
|
|
#else
|
|
|
|
#define TZ_LOCK __tz_lock()
|
|
|
|
#define TZ_UNLOCK __tz_unlock()
|
|
|
|
#endif
|
|
|
|
|
2017-12-04 13:54:48 +08:00
|
|
|
void __tz_lock (void);
|
|
|
|
void __tz_unlock (void);
|
2002-04-18 05:23:31 +08:00
|
|
|
|