add a missing section header table index conversion
[tangerine.git] / compiler / clib / include / time.h
blobab55d3232cbf024c5311ac409d6fac8be1b8714a
1 #ifndef _TIME_H_
2 #define _TIME_H_
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: ANSI-C header file time.h
9 Lang: english
11 #include <sys/_types.h>
12 #include <sys/cdefs.h>
13 #include <sys/arosc.h>
15 #ifndef __AROS_TIME_T_DECLARED
16 #define __AROS_TIME_T_DECLARED
17 typedef __time_t time_t;
18 #endif
20 #ifndef __AROS_CLOCK_T_DECLARED
21 #define __AROS_CLOCK_T_DECLARED
22 typedef __clock_t clock_t;
23 #endif
25 #define __need_size_t
26 #define __need_NULL
27 #include <stddef.h>
29 /* XXX: This is supposed to be 1000000 on SUSv2 platforms apparently */
30 #define CLOCKS_PER_SEC 50
32 struct tm
34 int tm_sec;
35 int tm_min;
36 int tm_hour;
37 int tm_mday;
38 int tm_mon;
39 int tm_year;
40 int tm_wday;
41 int tm_yday;
42 int tm_isdst;
43 long int tm_gmtoff;
44 const char *tm_zone;
47 #if !defined(_ANSI_SOURCE) && defined(_P1003_1B_VISIBLE)
49 #ifndef __AROS_TIMER_T_DECLARED
50 #define __AROS_TIMER_T_DECLARED
51 typedef __timer_t timer_t;
52 #endif
54 #ifndef __AROS_CLOCKID_T_DECLARED
55 #define __AROS_CLOCKID_T_DECLARED
56 typedef __clockid_t clockid_t;
57 #endif
59 struct timespec
61 time_t tv_sec; /* seconds */
62 long tv_nsec; /* nanoseconds */
65 struct itimerspec
67 struct timespec it_interval; /* timer period */
68 struct timespec it_value; /* timer expiration */
71 #define CLOCK_REALTIME 0
72 #define TIMER_ABSTIME 1
74 /* time.h shouldn't include signal.h */
75 struct sigevent;
77 #endif /* !_ANSI_SOURCE && _P1003_1B_VISIBLE */
79 #if __XSI_VISIBLE
80 #define __daylight (__get_arosc_userdata()->acud_daylight)
81 #define __timezone (__get_arosc_userdata()->acud_timezone)
82 #endif
84 #if __POSIX_VISIBLE
85 #define __tzname (__get_arosc_userdata()->acud_tzname)
86 #endif
88 __BEGIN_DECLS
89 char *asctime(const struct tm *);
90 clock_t clock(void);
91 char *ctime(const time_t *);
92 double difftime(time_t, time_t);
93 struct tm *gmtime(const time_t *);
94 struct tm *localtime(const time_t *);
95 time_t mktime(struct tm *);
96 size_t strftime(char *, size_t, const char *, const struct tm *);
97 time_t time(time_t *);
99 #if !defined(_ANSI_SOURCE)
100 /* NOTIMPL void tzset(void); */
101 #endif
103 #if __POSIX_VISIBLE >= 199506
104 char *asctime_r(const struct tm *, char *);
105 char *ctime_r(const time_t *, char *);
106 struct tm *gmtime_r(const time_t *, struct tm *);
107 struct tm *localtime_r(const time_t *, struct tm *);
108 #endif
110 #if __XSI_VISIBLE
111 /* NOTIMPL struct tm *getdate(const char *); */
112 /* NOTIMPL char *strptime(const char *, const char *, struct tm *); */
113 #endif
115 #if __POSIX_VISIBLE >= 199309
116 /* NOTIMPL int clock_getres(clockid_t, struct timespec *); */
117 /* NOTIMPL int clock_gettime(clockid_t, struct timespec *); */
118 /* NOTIMPL int clock_settime(clockid_t, const struct timespec *); */
119 /* NOTIMPL int nanosleep(const struct timespec *, struct timespec *); */
121 /* NOTIMPL int timer_create(clockid_t, struct sigevent *, timer_t *); */
122 /* NOTIMPL int timer_delete(timer_t); */
123 /* NOTIMPL int timer_gettime(timer_t, struct itimerspec *); */
124 /* NOTIMPL int timer_getoverrun(timer_t); */
125 /* NOTIMPL int timer_settime(timer_t, int, const struct itimerspec *,
126 struct itimerspec *); */
127 #endif
129 __END_DECLS
131 #endif /* _TIME_H_ */