source: trunk/libs/newlib/src/newlib/libc/time/local.h @ 543

Last change on this file since 543 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 945 bytes
Line 
1/* local header used by libc/time routines */
2#include <_ansi.h>
3#include <time.h>
4
5#define SECSPERMIN      60L
6#define MINSPERHOUR     60L
7#define HOURSPERDAY     24L
8#define SECSPERHOUR     (SECSPERMIN * MINSPERHOUR)
9#define SECSPERDAY      (SECSPERHOUR * HOURSPERDAY)
10#define DAYSPERWEEK     7
11#define MONSPERYEAR     12
12
13#define YEAR_BASE       1900
14#define EPOCH_YEAR      1970
15#define EPOCH_WDAY      4
16#define EPOCH_YEARS_SINCE_LEAP 2
17#define EPOCH_YEARS_SINCE_CENTURY 70
18#define EPOCH_YEARS_SINCE_LEAP_CENTURY 370
19
20#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
21
22int         __tzcalc_limits (int __year);
23
24extern const int __month_lengths[2][MONSPERYEAR];
25
26void _tzset_unlocked_r (struct _reent *);
27void _tzset_unlocked (void);
28
29/* locks for multi-threading */
30#ifdef __SINGLE_THREAD__
31#define TZ_LOCK
32#define TZ_UNLOCK
33#else
34#define TZ_LOCK __tz_lock()
35#define TZ_UNLOCK __tz_unlock()
36#endif
37
38void __tz_lock (void);
39void __tz_unlock (void);
40
Note: See TracBrowser for help on using the repository browser.