2 /* : : generated by proto : : */
3 /***********************************************************************
5 * This software is part of the ast package *
6 * Copyright (c) 1985-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
15 * Information and Software Systems Research *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
23 ***********************************************************************/
29 * time conversion support definitions
33 #if !defined(__PROTO__)
34 #include <prototyped.h>
36 #if !defined(__LINKAGE__)
37 #define __LINKAGE__ /* 2004-08-11 transition */
42 #define TM_VERSION 20070319L
49 #define tmset(z) tminit(z)
50 #define tmisleapyear(y) (!((y)%4)&&(((y)%100)||!((((y)<1900)?((y)+1900):(y))%400)))
52 #define TM_ADJUST (1<<0) /* local doesn't do leap secs */
53 #define TM_LEAP (1<<1) /* do leap seconds */
54 #define TM_UTC (1<<2) /* universal coordinated ref */
56 #define TM_PEDANTIC (1<<3) /* pedantic date parse */
57 #define TM_DATESTYLE (1<<4) /* date(1) style mmddHHMMccyy */
58 #define TM_SUBSECOND (1<<5) /* <something>%S => ...%S.%P */
60 #define TM_DST (-60) /* default minutes for DST */
61 #define TM_LOCALZONE (25 * 60) /* use local time zone offset */
62 #define TM_UTCZONE (26 * 60) /* UTC "time zone" */
63 #define TM_MAXLEAP 1 /* max leap secs per leap */
64 #define TM_WINDOW 69 /* century windowing guard year */
67 * these indices must agree with tm_dform[]
70 #define TM_MONTH_ABBREV 0
72 #define TM_DAY_ABBREV 24
77 #define TM_MERIDIAN 41
81 #define TM_SUFFIXES 51
94 #define TM_INTERNATIONAL 107
96 #define TM_DISTANT 109
97 #define TM_MERIDIAN_TIME 110
99 #define TM_ERA_DATE 112
100 #define TM_ERA_TIME 113
101 #define TM_ERA_DEFAULT 114
102 #define TM_ERA_YEAR 115
103 #define TM_ORDINALS 116
109 typedef struct /* leap second info */
111 time_t time
; /* the leap second event */
112 int total
; /* inclusive total since epoch */
115 typedef struct /* time zone info */
117 char* type
; /* type name */
118 char* standard
; /* standard time name */
119 char* daylight
; /* daylight or summertime name */
120 short west
; /* minutes west of GMT */
121 short dst
; /* add to tz.west for DST */
124 typedef struct /* tm library readonly data */
126 char** format
; /* default TM_* format strings */
127 unsigned char* lex
; /* format lex type classes */
128 char* digit
; /* output digits */
129 short* days
; /* days in month i */
130 short* sum
; /* days in months before i */
131 Tm_leap_t
* leap
; /* leap second table */
132 Tm_zone_t
* zone
; /* alternate timezone table */
135 typedef struct /* tm library global info */
137 char* deformat
; /* TM_DEFAULT override */
138 int flags
; /* flags */
139 char** format
; /* current format strings */
140 Tm_zone_t
* date
; /* timezone from last tmdate() */
141 Tm_zone_t
* local
; /* local timezone */
142 Tm_zone_t
* zone
; /* current timezone */
160 #if _BLD_ast && defined(__EXPORT__)
162 #define __MANGLE__ __LINKAGE__ __EXPORT__
164 #if !_BLD_ast && defined(__IMPORT__)
166 #define __MANGLE__ __LINKAGE__ __IMPORT__
169 extern __MANGLE__ Tm_data_t
* _tm_datap_
;
170 extern __MANGLE__ Tm_info_t
* _tm_infop_
;
172 #define tm_data (*_tm_datap_)
173 #define tm_info (*_tm_infop_)
176 #define __MANGLE__ __LINKAGE__
178 #if _BLD_ast && defined(__EXPORT__)
180 #define __MANGLE__ __LINKAGE__ __EXPORT__
183 extern __MANGLE__
time_t tmdate
__PROTO__((const char*, char**, time_t*));
184 extern __MANGLE__
int tmequiv
__PROTO__((Tm_t
*));
185 extern __MANGLE__ Tm_t
* tmfix
__PROTO__((Tm_t
*));
186 extern __MANGLE__
char* tmfmt
__PROTO__((char*, size_t, const char*, time_t*));
187 extern __MANGLE__
char* tmform
__PROTO__((char*, const char*, time_t*));
188 extern __MANGLE__
int tmgoff
__PROTO__((const char*, char**, int));
189 extern __MANGLE__
void tminit
__PROTO__((Tm_zone_t
*));
190 extern __MANGLE__
time_t tmleap
__PROTO__((time_t*));
191 extern __MANGLE__
int tmlex
__PROTO__((const char*, char**, char**, int, char**, int));
192 extern __MANGLE__
char** tmlocale
__PROTO__((void));
193 extern __MANGLE__ Tm_t
* tmmake
__PROTO__((time_t*));
194 extern __MANGLE__
char* tmpoff
__PROTO__((char*, size_t, const char*, int, int));
195 extern __MANGLE__
time_t tmscan
__PROTO__((const char*, char**, const char*, char**, time_t*, long));
196 extern __MANGLE__
int tmsleep
__PROTO__((time_t, time_t));
197 extern __MANGLE__
time_t tmtime
__PROTO__((Tm_t
*, int));
198 extern __MANGLE__ Tm_zone_t
* tmtype
__PROTO__((const char*, char**));
199 extern __MANGLE__
int tmweek
__PROTO__((Tm_t
*, int, int, int));
200 extern __MANGLE__
int tmword
__PROTO__((const char*, char**, const char*, char**, int));
201 extern __MANGLE__ Tm_zone_t
* tmzone
__PROTO__((const char*, char**, const char*, int*));
204 #define __MANGLE__ __LINKAGE__