Pristine Ack-5.5
[Ack-5.5.git] / lib / minix / include / time.h
1 /* The <time.h> header is used by the procedures that deal with time.
2  * Handling time is surprisingly complicated, what with GMT, local time
3  * and other factors.  Although the Bishop of Ussher (1581-1656) once
4  * calculated that based on the Bible, the world began on 12 Oct. 4004 BC
5  * at 9 o'clock in the morning, in the UNIX world time begins at midnight, 
6  * 1 Jan. 1970 GMT.  Before that, all was NULL and (void).
7  */
8
9 #ifndef _TIME_H
10 #define _TIME_H
11
12 #define CLOCKS_PER_SEC  60      /* MINIX always uses 60 Hz, even in Europe */
13 #ifdef _POSIX_SOURCE
14 #define CLK_TCK         CLOCKS_PER_SEC
15 #endif
16
17 #define NULL    ((void *)0)
18
19 #ifndef _SIZE_T
20 #define _SIZE_T
21 typedef unsigned int size_t;    /*  type returned by sizeof */
22 #endif
23
24 #ifndef _TIME_T
25 #define _TIME_T
26 typedef long time_t;            /* time in sec since 1 Jan 1970 0000 GMT */
27 #endif
28
29 #ifndef _CLOCK_T
30 #define _CLOCK_T
31 typedef long clock_t;           /* time in ticks since process started */
32 #endif
33
34 struct tm {
35   int tm_sec;                   /* seconds after the minute [0, 59] */
36   int tm_min;                   /* minutes after the hour [0, 59] */
37   int tm_hour;                  /* hours since midnight [0, 23] */
38   int tm_mday;                  /* day of the month [1, 31] */
39   int tm_mon;                   /* months since January [0, 11] */
40   int tm_year;                  /* years since 1900 */
41   int tm_wday;                  /* days since Sunday [0, 6] */
42   int tm_yday;                  /* days since January 1 [0, 365] */
43   int tm_isdst;                 /* Daylight Saving Time flag */
44 };
45
46 /* Function Prototypes. */
47 #ifndef _ANSI_H
48 #include <ansi.h>
49 #endif
50
51 _PROTOTYPE( clock_t clock, (void)                                       );
52 _PROTOTYPE( double difftime, (time_t _time1, time_t _time0)             );
53 _PROTOTYPE( time_t mktime, (struct tm *_timeptr)                        );
54 _PROTOTYPE( time_t time, (time_t *_timeptr)                             );
55 _PROTOTYPE( char *asctime, (const struct tm *_timeptr)                  );
56 _PROTOTYPE( char *ctime, (const time_t *_timer)                 );
57 _PROTOTYPE( struct tm *gmtime, (const time_t *_timer)                   );
58 _PROTOTYPE( struct tm *localtime, (const time_t *_timer)                );
59 _PROTOTYPE( size_t strftime, (char *_s, size_t _max, const char *_fmt,
60                                 const struct tm *_timep)                );
61
62 #ifdef _POSIX_SOURCE
63 _PROTOTYPE( void tzset, (void)                                          );
64 #endif
65
66 #endif /* _TIME_H */