whoops - forgot to commit header files
[reactos.git] / posix / include / time.h
1 /*
2 * time.h
3 *
4 * time types. Based on the Single UNIX(r) Specification, Version 2
5 *
6 * This file is part of the ReactOS Operating System.
7 *
8 * Contributors:
9 * Created by KJK::Hyperion <noog@libero.it>
10 *
11 * THIS SOFTWARE IS NOT COPYRIGHTED
12 *
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
15 *
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 */
22 #ifndef __TIME_H_INCLUDED__
23 #define __TIME_H_INCLUDED__
24
25 /* INCLUDES */
26 #include <signal.h>
27 #include <sys/types.h>
28
29 /* OBJECTS */
30 //extern static int getdate_err; /* FIXME */
31 extern int daylight;
32 extern long int timezone;
33 extern char *tzname[];
34
35 /* TYPES */
36 /* pre-declaration of signal.h types to suppress warnings caused by circular
37 dependencies */
38 struct sigevent;
39
40 struct tm
41 {
42 int tm_sec; /* seconds [0,61] */
43 int tm_min; /* minutes [0,59] */
44 int tm_hour; /* hour [0,23] */
45 int tm_mday; /* day of month [1,31] */
46 int tm_mon; /* month of year [0,11] */
47 int tm_year; /* years since 1900 */
48 int tm_wday; /* day of week [0,6] (Sunday = 0) */
49 int tm_yday; /* day of year [0,365] */
50 int tm_isdst; /* daylight savings flag */
51 };
52
53 struct timespec
54 {
55 time_t tv_sec; /* seconds */
56 long tv_nsec; /* nanoseconds */
57 };
58
59 struct itimerspec
60 {
61 struct timespec it_interval; /* timer period */
62 struct timespec it_value; /* timer expiration */
63 };
64
65 /* CONSTANTS */
66 /* FIXME: all the constants are wrong */
67 /* Number of clock ticks per second returned by the times() function (LEGACY). */
68 #define CLK_TCK (1)
69 /* A number used to convert the value returned by the clock() function into
70 seconds. */
71 #define CLOCKS_PER_SEC (1)
72 /* The identifier of the systemwide realtime clock. */
73 #define CLOCK_REALTIME (0)
74 /* Flag indicating time is absolute with respect to the clock associated with a
75 timer. */
76 #define TIMER_ABSTIME (1)
77
78 /* PROTOTYPES */
79 char *asctime(const struct tm *);
80 char *asctime_r(const struct tm *, char *);
81 clock_t clock(void);
82 int clock_getres(clockid_t, struct timespec *);
83 int clock_gettime(clockid_t, struct timespec *);
84 int clock_settime(clockid_t, const struct timespec *);
85 char *ctime(const time_t *);
86 char *ctime_r(const time_t *, char *);
87 double difftime(time_t, time_t);
88 struct tm *getdate(const char *);
89 struct tm *gmtime(const time_t *);
90 struct tm *gmtime_r(const time_t *, struct tm *);
91 struct tm *localtime(const time_t *);
92 struct tm *localtime_r(const time_t *, struct tm *);
93 time_t mktime(struct tm *);
94 int nanosleep(const struct timespec *, struct timespec *);
95 size_t strftime(char *, size_t, const char *, const struct tm *);
96 char *strptime(const char *, const char *, struct tm *);
97 time_t time(time_t *);
98 int timer_create(clockid_t, struct sigevent *, timer_t *);
99 int timer_delete(timer_t);
100 int timer_gettime(timer_t, struct itimerspec *);
101 int timer_getoverrun(timer_t);
102 int timer_settime(timer_t, int, const struct itimerspec *,
103 struct itimerspec *);
104 void tzset(void);
105
106 /* MACROS */
107
108 #endif /* __TIME_H_INCLUDED__ */ /* replace with the appropriate tag */
109
110 /* EOF */
111