time.h revision 1.7 1 1.7 cgd /*
2 1.7 cgd * Copyright (c) 1989 The Regents of the University of California.
3 1.7 cgd * All rights reserved.
4 1.7 cgd *
5 1.7 cgd * (c) UNIX System Laboratories, Inc.
6 1.7 cgd * All or some portions of this file are derived from material licensed
7 1.7 cgd * to the University of California by American Telephone and Telegraph
8 1.7 cgd * Co. or Unix System Laboratories, Inc. and are reproduced herein with
9 1.7 cgd * the permission of UNIX System Laboratories, Inc.
10 1.7 cgd *
11 1.7 cgd * Redistribution and use in source and binary forms, with or without
12 1.7 cgd * modification, are permitted provided that the following conditions
13 1.7 cgd * are met:
14 1.7 cgd * 1. Redistributions of source code must retain the above copyright
15 1.7 cgd * notice, this list of conditions and the following disclaimer.
16 1.7 cgd * 2. Redistributions in binary form must reproduce the above copyright
17 1.7 cgd * notice, this list of conditions and the following disclaimer in the
18 1.7 cgd * documentation and/or other materials provided with the distribution.
19 1.7 cgd * 3. All advertising materials mentioning features or use of this software
20 1.7 cgd * must display the following acknowledgement:
21 1.7 cgd * This product includes software developed by the University of
22 1.7 cgd * California, Berkeley and its contributors.
23 1.7 cgd * 4. Neither the name of the University nor the names of its contributors
24 1.7 cgd * may be used to endorse or promote products derived from this software
25 1.7 cgd * without specific prior written permission.
26 1.7 cgd *
27 1.7 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 1.7 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 1.7 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 1.7 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 1.7 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 1.7 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 1.7 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 1.7 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 1.7 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 1.7 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 1.7 cgd * SUCH DAMAGE.
38 1.7 cgd *
39 1.7 cgd * from: @(#)time.h 5.12 (Berkeley) 3/9/91
40 1.7 cgd * $Id: time.h,v 1.7 1994/05/16 10:59:01 cgd Exp $
41 1.7 cgd */
42 1.7 cgd
43 1.7 cgd #ifndef _TIME_H_
44 1.7 cgd #define _TIME_H_
45 1.7 cgd
46 1.7 cgd #include <machine/ansi.h>
47 1.7 cgd
48 1.7 cgd #ifndef NULL
49 1.7 cgd #define NULL 0
50 1.7 cgd #endif
51 1.7 cgd
52 1.7 cgd #ifdef _CLOCK_T_
53 1.7 cgd typedef _CLOCK_T_ clock_t;
54 1.7 cgd #undef _CLOCK_T_
55 1.7 cgd #endif
56 1.7 cgd
57 1.7 cgd #ifdef _TIME_T_
58 1.7 cgd typedef _TIME_T_ time_t;
59 1.7 cgd #undef _TIME_T_
60 1.7 cgd #endif
61 1.7 cgd
62 1.7 cgd #ifdef _SIZE_T_
63 1.7 cgd typedef _SIZE_T_ size_t;
64 1.7 cgd #undef _SIZE_T_
65 1.7 cgd #endif
66 1.7 cgd
67 1.7 cgd #define CLOCKS_PER_SEC 100
68 1.7 cgd
69 1.7 cgd struct tm {
70 1.7 cgd int tm_sec; /* seconds after the minute [0-60] */
71 1.7 cgd int tm_min; /* minutes after the hour [0-59] */
72 1.7 cgd int tm_hour; /* hours since midnight [0-23] */
73 1.7 cgd int tm_mday; /* day of the month [1-31] */
74 1.7 cgd int tm_mon; /* months since January [0-11] */
75 1.7 cgd int tm_year; /* years since 1900 */
76 1.7 cgd int tm_wday; /* days since Sunday [0-6] */
77 1.7 cgd int tm_yday; /* days since January 1 [0-365] */
78 1.7 cgd int tm_isdst; /* Daylight Savings Time flag */
79 1.7 cgd long tm_gmtoff; /* offset from CUT in seconds */
80 1.7 cgd char *tm_zone; /* timezone abbreviation */
81 1.7 cgd };
82 1.7 cgd
83 1.7 cgd #include <sys/cdefs.h>
84 1.7 cgd
85 1.7 cgd __BEGIN_DECLS
86 1.7 cgd char *asctime __P((const struct tm *));
87 1.7 cgd clock_t clock __P((void));
88 1.7 cgd char *ctime __P((const time_t *));
89 1.7 cgd double difftime __P((time_t, time_t));
90 1.7 cgd struct tm *gmtime __P((const time_t *));
91 1.7 cgd struct tm *localtime __P((const time_t *));
92 1.7 cgd time_t mktime __P((struct tm *));
93 1.7 cgd size_t strftime __P((char *, size_t, const char *, const struct tm *));
94 1.7 cgd time_t time __P((time_t *));
95 1.7 cgd
96 1.7 cgd #if !defined(_ANSI_SOURCE)
97 1.7 cgd #define CLK_TCK 100
98 1.7 cgd extern char *tzname[2];
99 1.7 cgd void tzset __P((void));
100 1.7 cgd #endif /* not ANSI */
101 1.7 cgd
102 1.7 cgd #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
103 1.7 cgd char *timezone __P((int, int));
104 1.7 cgd void tzsetwall __P((void));
105 1.7 cgd #endif /* neither ANSI nor POSIX */
106 1.7 cgd __END_DECLS
107 1.7 cgd
108 1.7 cgd #endif /* !_TIME_H_ */
109