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