Pristine Ack-5.5
[Ack-5.5.git] / lang / cem / libcc.ansi / headers / time.h
1 /*
2  * time.h - date and time
3  */
4 /* $Id: time.h,v 1.9 1994/06/24 11:41:32 ceriel Exp $ */
5
6 #if     !defined(_TIME_H)
7 #define _TIME_H
8
9 #define NULL            ((void *)0)
10
11 #if     defined(__BSD4_2)
12 #define CLOCKS_PER_SEC  1000000         /* ticks per second */
13 #else
14 #define CLOCKS_PER_SEC  60
15 #endif  /* __BSD4_2 */
16
17 #if     !defined(_SIZE_T)
18 #define _SIZE_T
19 typedef unsigned int    size_t;         /* type returned by sizeof */
20 #endif  /* _SIZE_T */
21
22 #if     !defined(_TIME_T)
23 #define _TIME_T
24 typedef unsigned long   time_t;         /* type returned by TOD clock */
25 #endif  /* _TIME_T */
26
27 typedef unsigned long   clock_t;        /* type returned by real time clock */
28
29 struct tm {
30         int     tm_sec;                 /* seconds after the minute - [0, 59] */
31         int     tm_min;                 /* minutes after the hour - [0, 59] */
32         int     tm_hour;                /* hours since midnight - [0, 23] */
33         int     tm_mday;                /* day of the month - [1, 31] */
34         int     tm_mon;                 /* months since January - [0, 11] */
35         int     tm_year;                /* years since 1900 */
36         int     tm_wday;                /* days since Sunday - [0, 6] */
37         int     tm_yday;                /* days since January 1 - [0, 365] */
38         int     tm_isdst;               /* Daylight Saving Time flag */
39 };
40
41 clock_t         clock(void);
42 double          difftime(time_t _time1, time_t _time0);
43 time_t          mktime(struct tm *_timeptr);
44 time_t          time(time_t *_timeptr);
45 char            *asctime(const struct tm *_timeptr);
46 char            *ctime(const time_t *_timer);
47 struct  tm      *gmtime(const time_t *_timer);
48 struct  tm      *localtime(const time_t *_timer);
49 size_t          strftime(char *_s, size_t _maxsize,
50                         const char *_format,
51                         const struct tm *_timeptr);
52
53 #if     defined(__USG) || defined(_POSIX_SOURCE)
54
55 void    tzset(void);
56
57 #if     defined(__USG)
58 extern long timezone;
59 extern int daylight;
60 extern char *tzname[2];
61 #endif
62 #endif  /* __USG || _POSIX_SOURCE */
63
64 #endif  /* _TIME_H */