]>
Commit | Line | Data |
---|---|---|
efcc988a JR |
1 | --- Date-Pcalc-6.1/src/C_XS/ToolBox.h~ 2013-06-13 17:00:05.523968595 +0200 |
2 | +++ Date-Pcalc-6.1/src/C_XS/ToolBox.h 2013-06-13 17:00:31.110914002 +0200 | |
3 | @@ -93,7 +93,7 @@ | |
4 | #elif PERL_DARWIN | |
5 | #define boolean bool | |
6 | #else | |
7 | - typedef enum { false = FALSE, true = TRUE } boolean; | |
8 | + typedef enum { _false = FALSE, _true = TRUE } boolean; | |
9 | #endif | |
10 | #endif | |
11 | ||
12 | --- Date-Pcalc-6.1/src/C_XS/DatePcalc.c~ 2013-06-13 17:00:05.523968595 +0200 | |
13 | +++ Date-Pcalc-6.1/src/C_XS/DatePcalc.c 2013-06-13 17:01:19.212809930 +0200 | |
14 | @@ -689,8 +689,8 @@ | |
15 | { | |
16 | N_int i = (N_int) c; | |
17 | ||
18 | - if ((i >= 0x30) and (i <= 0x39)) return(true); | |
19 | - return(false); | |
20 | + if ((i >= 0x30) and (i <= 0x39)) return(_true); | |
21 | + return(_false); | |
22 | } | |
23 | ||
24 | static boolean DateCalc_is_alnum(N_char c) | |
25 | @@ -703,8 +703,8 @@ | |
26 | ((i >= 0xC0) and (i <= 0xD6)) or | |
27 | ((i >= 0xD8) and (i <= 0xF6)) or | |
28 | ((i >= 0xF8) and (i <= 0xFF))) | |
29 | - return(true); | |
30 | - return(false); | |
31 | + return(_true); | |
32 | + return(_false); | |
33 | } | |
34 | ||
35 | N_char DateCalc_ISO_LC(N_char c) | |
36 | @@ -742,14 +742,14 @@ | |
37 | { /* Mnemonic: COBOL "PIC 9" */ | |
38 | if ((str != NULL) and (idx >= 0) and (idx < len)) | |
39 | return( DateCalc_is_digit(str[idx]) XOR neg ); | |
40 | - return(false); | |
41 | + return(_false); | |
42 | } | |
43 | ||
44 | static boolean DateCalc_scanx(charptr str, Z_int len, Z_int idx, boolean neg) | |
45 | { /* Mnemonic: COBOL "PIC X" */ | |
46 | if ((str != NULL) and (idx >= 0) and (idx < len)) | |
47 | return( DateCalc_is_alnum(str[idx]) XOR neg ); | |
48 | - return(false); | |
49 | + return(_false); | |
50 | } | |
51 | ||
52 | static Z_int DateCalc_Str2Int(charptr string, Z_int length) | |
53 | @@ -877,16 +877,16 @@ | |
54 | (month >= 1) and (month <= 12) and | |
55 | (day >= 1) and | |
56 | (day <= DateCalc_Days_in_Month_[DateCalc_leap_year(year)][month])) | |
57 | - return(true); | |
58 | - return(false); | |
59 | + return(_true); | |
60 | + return(_false); | |
61 | } | |
62 | ||
63 | boolean DateCalc_check_time(Z_int hour, Z_int min, Z_int sec) | |
64 | { | |
65 | if ((hour >= 0) and (min >= 0) and (sec >= 0) and | |
66 | (hour < 24) and (min < 60) and (sec < 60)) | |
67 | - return(true); | |
68 | - return(false); | |
69 | + return(_true); | |
70 | + return(_false); | |
71 | } | |
72 | ||
73 | boolean DateCalc_check_business_date(Z_int year, Z_int week, Z_int dow) | |
74 | @@ -894,8 +894,8 @@ | |
75 | if ((year >= 1) and | |
76 | (week >= 1) and (week <= DateCalc_Weeks_in_Year(year)) and | |
77 | (dow >= 1) and (dow <= 7)) | |
78 | - return(true); | |
79 | - return(false); | |
80 | + return(_true); | |
81 | + return(_false); | |
82 | } | |
83 | ||
84 | Z_int DateCalc_Day_of_Year(Z_int year, Z_int month, Z_int day) | |
85 | @@ -965,9 +965,9 @@ | |
86 | *week = 1; | |
87 | (*year)++; | |
88 | } | |
89 | - return(true); | |
90 | + return(_true); | |
91 | } | |
92 | - return(false); | |
93 | + return(_false); | |
94 | } | |
95 | ||
96 | boolean DateCalc_monday_of_week(Z_int week, | |
97 | @@ -994,14 +994,14 @@ | |
98 | (mm < 1) or (mm > 12) or | |
99 | (dow < 1) or (dow > 7) or | |
100 | (n < 1) or (n > 5)) | |
101 | - return(false); | |
102 | + return(_false); | |
103 | first = DateCalc_Day_of_Week(*year,mm,1); | |
104 | if (dow < first) dow += 7; | |
105 | delta = (Z_long) (dow - first); | |
106 | delta += (n-1) * 7L; | |
107 | if (DateCalc_add_delta_days(year,month,day,delta) and (*month == mm)) | |
108 | - return(true); | |
109 | - return(false); | |
110 | + return(_true); | |
111 | + return(_false); | |
112 | } | |
113 | ||
114 | boolean DateCalc_standard_to_business(Z_int *year, Z_int *week, Z_int *dow, | |
115 | @@ -1012,9 +1012,9 @@ | |
116 | if (DateCalc_week_of_year(week,year,month,day)) | |
117 | { | |
118 | *dow = DateCalc_Day_of_Week(yy,month,day); | |
119 | - return(true); | |
120 | + return(_true); | |
121 | } | |
122 | - return(false); | |
123 | + return(_false); | |
124 | } | |
125 | ||
126 | boolean DateCalc_business_to_standard(Z_int *year, Z_int *month, Z_int *day, | |
127 | @@ -1030,7 +1030,7 @@ | |
128 | delta = ((week + (first > 4) - 1) * 7L) + (dow - first); | |
129 | return( DateCalc_add_delta_days(year,month,day,delta) ); | |
130 | } | |
131 | - return(false); | |
132 | + return(_false); | |
133 | } | |
134 | ||
135 | Z_long DateCalc_Delta_Days(Z_int year1, Z_int month1, Z_int day1, | |
136 | @@ -1058,9 +1058,9 @@ | |
137 | *Dh = (Z_int) HH; | |
138 | *Dm = (Z_int) MM; | |
139 | *Ds = (Z_int) SS; | |
140 | - return(true); | |
141 | + return(_true); | |
142 | } | |
143 | - return(false); | |
144 | + return(_false); | |
145 | } | |
146 | ||
147 | boolean DateCalc_delta_dhms(Z_long *Dd, | |
148 | @@ -1079,7 +1079,7 @@ | |
149 | hour1,min1,sec1, | |
150 | hour2,min2,sec2) ); | |
151 | } | |
152 | - return(false); | |
153 | + return(_false); | |
154 | } | |
155 | ||
156 | boolean DateCalc_delta_ymd(Z_int *year1, Z_int *month1, Z_int *day1, | |
157 | @@ -1091,9 +1091,9 @@ | |
158 | *day1 = day2 - *day1; | |
159 | *month1 = month2 - *month1; | |
160 | *year1 = year2 - *year1; | |
161 | - return(true); | |
162 | + return(_true); | |
163 | } | |
164 | - return(false); | |
165 | + return(_false); | |
166 | } | |
167 | ||
168 | boolean DateCalc_delta_ymdhms(Z_int *D_y, Z_int *D_m, Z_int *D_d, | |
169 | @@ -1106,14 +1106,14 @@ | |
170 | Z_long Dd; | |
171 | ||
172 | if (not DateCalc_delta_ymd(&year1,&month1,&day1, year2,month2,day2)) | |
173 | - return(false); | |
174 | + return(_false); | |
175 | Dd = (Z_long) day1; | |
176 | if (not DateCalc_delta_hms(&Dd,Dh,Dm,Ds, hour1,min1,sec1, hour2,min2,sec2)) | |
177 | - return(false); | |
178 | + return(_false); | |
179 | *D_y = year1; | |
180 | *D_m = month1; | |
181 | *D_d = (Z_int) Dd; | |
182 | - return(true); | |
183 | + return(_true); | |
184 | } | |
185 | ||
186 | boolean DateCalc_norm_delta_ymd(Z_int *year1, Z_int *month1, Z_int *day1, | |
187 | @@ -1136,26 +1136,26 @@ | |
188 | { | |
189 | Dy = (Z_long) (year2 - *year1); | |
190 | Dm = (Z_long) (month2 - *month1); | |
191 | - ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); | |
192 | + ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); | |
193 | if (!(((Dy >= 0L) and (Dm >= 0L) and (Dd >= 0L)) or | |
194 | ((Dy <= 0L) and (Dm <= 0L) and (Dd <= 0L)))) | |
195 | { | |
196 | if ((Dy < 0L) and (Dm > 0L)) { Dy++; Dm -= 12L; } | |
197 | else if ((Dy > 0L) and (Dm < 0L)) { Dy--; Dm += 12L; } | |
198 | - if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
199 | - else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
200 | + if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
201 | + else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
202 | if ((Dy < 0L) and (Dd > 0L)) { Dy++; Dm -= 12L; } | |
203 | else if ((Dy > 0L) and (Dd < 0L)) { Dy--; Dm += 12L; } | |
204 | - if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
205 | - else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
206 | + if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
207 | + else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=*year1; tm=*month1; td=*day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
208 | } | |
209 | } | |
210 | *year1 = (Z_int) Dy; | |
211 | *month1 = (Z_int) Dm; | |
212 | *day1 = (Z_int) Dd; | |
213 | - return(true); | |
214 | + return(_true); | |
215 | } | |
216 | - return(false); | |
217 | + return(_false); | |
218 | } | |
219 | ||
220 | boolean DateCalc_norm_delta_ymdhms(Z_int *D_y, Z_int *D_m, Z_int *D_d, | |
221 | @@ -1185,26 +1185,26 @@ | |
222 | { | |
223 | Dy = (Z_long) (year2 - year1); | |
224 | Dm = (Z_long) (month2 - month1); | |
225 | - ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); | |
226 | + ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); | |
227 | if (!(((Dy >= 0L) and (Dm >= 0L) and (Dd >= 0L) and (ss >= 0L)) or | |
228 | ((Dy <= 0L) and (Dm <= 0L) and (Dd <= 0L) and (ss <= 0L)))) | |
229 | { | |
230 | if ((Dy < 0L) and (Dm > 0L)) { Dy++; Dm -= 12L; } | |
231 | else if ((Dy > 0L) and (Dm < 0L)) { Dy--; Dm += 12L; } | |
232 | - if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
233 | - else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
234 | + if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
235 | + else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
236 | if ((Dy < 0L) and (Dd > 0L)) { Dy++; Dm -= 12L; } | |
237 | else if ((Dy > 0L) and (Dd < 0L)) { Dy--; Dm += 12L; } | |
238 | - if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
239 | - else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
240 | + if ((Dm < 0L) and (Dd > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
241 | + else if ((Dm > 0L) and (Dd < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
242 | if ((Dd < 0L) and (ss > 0L)) { Dd++; ss -= 86400L; } | |
243 | else if ((Dd > 0L) and (ss < 0L)) { Dd--; ss += 86400L; } | |
244 | - if ((Dm < 0L) and (ss > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
245 | - else if ((Dm > 0L) and (ss < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
246 | + if ((Dm < 0L) and (ss > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
247 | + else if ((Dm > 0L) and (ss < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
248 | if ((Dy < 0L) and (ss > 0L)) { Dy++; Dm -= 12L; } | |
249 | else if ((Dy > 0L) and (ss < 0L)) { Dy--; Dm += 12L; } | |
250 | - if ((Dm < 0L) and (ss > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
251 | - else if ((Dm > 0L) and (ss < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
252 | + if ((Dm < 0L) and (ss > 0L)) { Dm++; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
253 | + else if ((Dm > 0L) and (ss < 0L)) { Dm--; ty=year1; tm=month1; td=day1; if (!DateCalc_add_delta_ym(&ty,&tm,&td,Dy,Dm)) return(_false); Dd=d2-DateCalc_Date_to_Days(ty,tm,td); } | |
254 | if ((Dd < 0L) and (ss > 0L)) { Dd++; ss -= 86400L; } | |
255 | else if ((Dd > 0L) and (ss < 0L)) { Dd--; ss += 86400L; } | |
256 | } | |
257 | @@ -1224,9 +1224,9 @@ | |
258 | *Dhh = (Z_int) hh; | |
259 | *Dmm = (Z_int) mm; | |
260 | *Dss = (Z_int) ss; | |
261 | - return(true); | |
262 | + return(_true); | |
263 | } | |
264 | - return(false); | |
265 | + return(_false); | |
266 | } | |
267 | ||
268 | boolean DateCalc_add_delta_days(Z_int *year, Z_int *month, Z_int *day, | |
269 | @@ -1262,9 +1262,9 @@ | |
270 | } | |
271 | } | |
272 | } | |
273 | - return(true); | |
274 | + return(_true); | |
275 | } | |
276 | - return(false); | |
277 | + return(_false); | |
278 | } | |
279 | ||
280 | boolean DateCalc_add_delta_dhms(Z_int *year, Z_int *month, Z_int *day, | |
281 | @@ -1295,7 +1295,7 @@ | |
282 | else *hour = *min = *sec = 0; | |
283 | return( DateCalc_add_delta_days(year,month,day,Dd) ); | |
284 | } | |
285 | - return(false); | |
286 | + return(_false); | |
287 | } | |
288 | ||
289 | boolean DateCalc_add_year_month(Z_int *year, Z_int *month, | |
290 | @@ -1303,7 +1303,7 @@ | |
291 | { | |
292 | Z_long quot; | |
293 | ||
294 | - if ((*year < 1) or (*month < 1) or (*month > 12)) return(false); | |
295 | + if ((*year < 1) or (*month < 1) or (*month > 12)) return(_false); | |
296 | if (Dm != 0L) | |
297 | { | |
298 | Dm += (Z_long) (*month - 1); | |
299 | @@ -1322,8 +1322,8 @@ | |
300 | Dy += (Z_long) *year; | |
301 | *year = (Z_int) Dy; | |
302 | } | |
303 | - if (*year < 1) return(false); | |
304 | - return(true); | |
305 | + if (*year < 1) return(_false); | |
306 | + return(_true); | |
307 | } | |
308 | ||
309 | boolean DateCalc_add_delta_ym(Z_int *year, Z_int *month, Z_int *day, | |
310 | @@ -1331,19 +1331,19 @@ | |
311 | { | |
312 | Z_int Dd; | |
313 | ||
314 | - if (not DateCalc_check_date(*year,*month,*day)) return(false); | |
315 | - if (not DateCalc_add_year_month(year,month,Dy,Dm)) return(false); | |
316 | + if (not DateCalc_check_date(*year,*month,*day)) return(_false); | |
317 | + if (not DateCalc_add_year_month(year,month,Dy,Dm)) return(_false); | |
318 | if (*day > | |
319 | (Dd = DateCalc_Days_in_Month_[DateCalc_leap_year(*year)][*month])) | |
320 | *day = Dd; | |
321 | - return(true); | |
322 | + return(_true); | |
323 | } | |
324 | ||
325 | boolean DateCalc_add_delta_ymd(Z_int *year, Z_int *month, Z_int *day, | |
326 | Z_long Dy, Z_long Dm, Z_long Dd) | |
327 | { | |
328 | - if (not DateCalc_check_date(*year,*month,*day)) return(false); | |
329 | - if (not DateCalc_add_year_month(year,month,Dy,Dm)) return(false); | |
330 | + if (not DateCalc_check_date(*year,*month,*day)) return(_false); | |
331 | + if (not DateCalc_add_year_month(year,month,Dy,Dm)) return(_false); | |
332 | Dd += (Z_long) (*day - 1); | |
333 | *day = 1; | |
334 | return( DateCalc_add_delta_days(year,month,day,Dd) ); | |
335 | @@ -1355,8 +1355,8 @@ | |
336 | Z_long Dh, Z_long Dm, Z_long Ds) | |
337 | { | |
338 | if (not (DateCalc_check_date(*year,*month,*day) and | |
339 | - DateCalc_check_time(*hour,*min,*sec))) return(false); | |
340 | - if (not DateCalc_add_year_month(year,month,D_y,D_m)) return(false); | |
341 | + DateCalc_check_time(*hour,*min,*sec))) return(_false); | |
342 | + if (not DateCalc_add_year_month(year,month,D_y,D_m)) return(_false); | |
343 | D_d += (Z_long) (*day - 1); | |
344 | *day = 1; | |
345 | return( DateCalc_add_delta_dhms(year,month,day,hour,min,sec,D_d,Dh,Dm,Ds) ); | |
346 | @@ -1365,7 +1365,7 @@ | |
347 | boolean DateCalc_add_norm_delta_ymd(Z_int *year, Z_int *month, Z_int *day, | |
348 | Z_long Dy, Z_long Dm, Z_long Dd) | |
349 | { | |
350 | - if (not DateCalc_add_delta_ym(year,month,day,Dy,Dm)) return(false); | |
351 | + if (not DateCalc_add_delta_ym(year,month,day,Dy,Dm)) return(_false); | |
352 | return( DateCalc_add_delta_days(year,month,day,Dd) ); | |
353 | } | |
354 | ||
355 | @@ -1374,7 +1374,7 @@ | |
356 | Z_long D_y, Z_long D_m, Z_long D_d, | |
357 | Z_long Dh, Z_long Dm, Z_long Ds) | |
358 | { | |
359 | - if (not DateCalc_add_delta_ym(year,month,day,D_y,D_m)) return(false); | |
360 | + if (not DateCalc_add_delta_ym(year,month,day,D_y,D_m)) return(_false); | |
361 | return( DateCalc_add_delta_dhms(year,month,day,hour,min,sec,D_d,Dh,Dm,Ds) ); | |
362 | } | |
363 | ||
364 | @@ -1406,10 +1406,10 @@ | |
365 | if (*dst < 0) *dst = -1; | |
366 | else *dst = 1; | |
367 | } | |
368 | - return(true); | |
369 | + return(_true); | |
370 | } | |
371 | } | |
372 | - return(false); | |
373 | + return(_false); | |
374 | } | |
375 | ||
376 | boolean DateCalc_gmtime(Z_int *year, Z_int *month, Z_int *day, | |
377 | @@ -1435,9 +1435,9 @@ | |
378 | if (*dst < 0) *dst = -1; | |
379 | else *dst = 1; | |
380 | } | |
381 | - return(true); | |
382 | + return(_true); | |
383 | } | |
384 | - return(false); | |
385 | + return(_false); | |
386 | } | |
387 | ||
388 | boolean DateCalc_localtime(Z_int *year, Z_int *month, Z_int *day, | |
389 | @@ -1463,9 +1463,9 @@ | |
390 | if (*dst < 0) *dst = -1; | |
391 | else *dst = 1; | |
392 | } | |
393 | - return(true); | |
394 | + return(_true); | |
395 | } | |
396 | - return(false); | |
397 | + return(_false); | |
398 | } | |
399 | ||
400 | /* MacOS (Classic): */ | |
401 | @@ -1495,7 +1495,7 @@ | |
402 | (hour < 0) or (hour > 23) or | |
403 | (min < 0) or (min > 59) or | |
404 | (sec < 0) or (sec > 59) ) | |
405 | - return(false); | |
406 | + return(_false); | |
407 | ||
408 | #ifdef MACOS_TRADITIONAL | |
409 | if ( (year == 2040) and ( (month > 2) or | |
410 | @@ -1503,14 +1503,14 @@ | |
411 | ( (day == 6) and ( (hour > 6) or | |
412 | ( (hour == 6) and ( (min > 28) or | |
413 | ( (min == 28) and (sec > 15) ) ))))))) ) | |
414 | - return(false); | |
415 | + return(_false); | |
416 | #else | |
417 | if ( (year == 2038) and ( (month > 1) or | |
418 | ( (month == 1) and ( (day > 19) or | |
419 | ( (day == 19) and ( (hour > 3) or | |
420 | ( (hour == 3) and ( (min > 14) or | |
421 | ( (min == 14) and (sec > 7) ) ))))))) ) | |
422 | - return(false); | |
423 | + return(_false); | |
424 | #endif | |
425 | ||
426 | year -= 1900; | |
427 | @@ -1557,14 +1557,14 @@ | |
428 | ||
429 | if (when >= 0) | |
430 | { | |
431 | - if ((date = gmtime(&when)) == NULL) return(false); | |
432 | + if ((date = gmtime(&when)) == NULL) return(_false); | |
433 | year1 = (*date).tm_year + 1900; | |
434 | month1 = (*date).tm_mon + 1; | |
435 | day1 = (*date).tm_mday; | |
436 | hour1 = (*date).tm_hour; | |
437 | min1 = (*date).tm_min; | |
438 | sec1 = (*date).tm_sec; | |
439 | - if ((date = localtime(&when)) == NULL) return(false); | |
440 | + if ((date = localtime(&when)) == NULL) return(_false); | |
441 | year2 = (*date).tm_year + 1900; | |
442 | month2 = (*date).tm_mon + 1; | |
443 | day2 = (*date).tm_mday; | |
444 | @@ -1581,10 +1581,10 @@ | |
445 | if (*dst < 0) *dst = -1; | |
446 | else *dst = 1; | |
447 | } | |
448 | - return(true); | |
449 | + return(_true); | |
450 | } | |
451 | } | |
452 | - return(false); | |
453 | + return(_false); | |
454 | } | |
455 | ||
456 | /* MacOS (Classic): */ | |
457 | @@ -1629,10 +1629,10 @@ | |
458 | #endif | |
459 | (days > DateCalc_DAYS_TO_OVFLW) or | |
460 | ( (days == DateCalc_DAYS_TO_OVFLW) and (secs > DateCalc_SECS_TO_OVFLW) ) ) | |
461 | - return(false); | |
462 | + return(_false); | |
463 | ||
464 | *seconds = (time_t) (((days - DateCalc_DAYS_TO_EPOCH) * 86400L) + secs); | |
465 | - return(true); | |
466 | + return(_true); | |
467 | } | |
468 | ||
469 | /* Substitute for POSIX's gmtime(3) function: */ | |
470 | @@ -1658,7 +1658,7 @@ | |
471 | Z_long hh; | |
472 | Z_long dd; | |
473 | ||
474 | - if (ss < 0L) return(false); | |
475 | + if (ss < 0L) return(_false); | |
476 | dd = (Z_long) (ss / 86400L); | |
477 | ss -= dd * 86400L; | |
478 | mm = (Z_long) (ss / 60L); | |
479 | @@ -1693,7 +1693,7 @@ | |
480 | ||
481 | Z_int a, b, c, d, e, m, n; | |
482 | ||
483 | - if ((*year < 1583) or (*year > 2299)) return(false); | |
484 | + if ((*year < 1583) or (*year > 2299)) return(_false); | |
485 | ||
486 | if (*year < 1700) { m = 22; n = 2; } | |
487 | else if (*year < 1800) { m = 23; n = 3; } | |
488 | @@ -1717,7 +1717,7 @@ | |
489 | if ((*day == 26) and (*month == 4)) *day = 19; | |
490 | if ((*day == 25) and (*month == 4) and | |
491 | (d == 28) and (e == 6) and (a > 10)) *day = 18; | |
492 | - return(true); | |
493 | + return(_true); | |
494 | } | |
495 | ||
496 | /* Carnival Monday / Rosenmontag / Veille du Mardi Gras = easter sunday - 48 */ | |
497 | @@ -1751,10 +1751,10 @@ | |
498 | ||
499 | if ((lang < 1) or (lang > DateCalc_LANGUAGES)) lang = DateCalc_Language; | |
500 | month = 0; | |
501 | - ok = true; | |
502 | + ok = _true; | |
503 | for ( i = 1; ok and (i <= 12); i++ ) | |
504 | { | |
505 | - same = true; | |
506 | + same = _true; | |
507 | for ( j = 0; same and (j < length); j++ ) | |
508 | { | |
509 | same = ( DateCalc_ISO_UC(buffer[j]) == | |
510 | @@ -1762,7 +1762,7 @@ | |
511 | } | |
512 | if (same) | |
513 | { | |
514 | - if (month > 0) ok = false; | |
515 | + if (month > 0) ok = _false; | |
516 | else month = i; | |
517 | } | |
518 | } | |
519 | @@ -1789,10 +1789,10 @@ | |
520 | ||
521 | if ((lang < 1) or (lang > DateCalc_LANGUAGES)) lang = DateCalc_Language; | |
522 | day = 0; | |
523 | - ok = true; | |
524 | + ok = _true; | |
525 | for ( i = 1; ok and (i <= 7); i++ ) | |
526 | { | |
527 | - same = true; | |
528 | + same = _true; | |
529 | for ( j = 0; same and (j < length); j++ ) | |
530 | { | |
531 | same = ( DateCalc_ISO_UC(buffer[j]) == | |
532 | @@ -1800,7 +1800,7 @@ | |
533 | } | |
534 | if (same) | |
535 | { | |
536 | - if (day > 0) ok = false; | |
537 | + if (day > 0) ok = _false; | |
538 | else day = i; | |
539 | } | |
540 | } | |
541 | @@ -1826,10 +1826,10 @@ | |
542 | /*****************************************************************************/ | |
543 | ||
544 | lang = 0; | |
545 | - ok = true; | |
546 | + ok = _true; | |
547 | for ( i = 1; ok and (i <= DateCalc_LANGUAGES); i++ ) | |
548 | { | |
549 | - same = true; | |
550 | + same = _true; | |
551 | for ( j = 0; same and (j < length); j++ ) | |
552 | { | |
553 | same = ( DateCalc_ISO_UC(buffer[j]) == | |
554 | @@ -1837,7 +1837,7 @@ | |
555 | } | |
556 | if (same) | |
557 | { | |
558 | - if (lang > 0) ok = false; | |
559 | + if (lang > 0) ok = _false; | |
560 | else lang = i; | |
561 | } | |
562 | } | |
563 | @@ -1857,17 +1857,17 @@ | |
564 | if (length > 0) | |
565 | { | |
566 | i = 0; | |
567 | - while (DateCalc_scan9(buffer,length,i,true)) i++; | |
568 | + while (DateCalc_scan9(buffer,length,i,_true)) i++; | |
569 | j = length-1; | |
570 | - while (DateCalc_scan9(buffer,length,j,true)) j--; | |
571 | + while (DateCalc_scan9(buffer,length,j,_true)) j--; | |
572 | if (i+1 < j) /* at least 3 chars, else error! */ | |
573 | { | |
574 | buffer += i; | |
575 | length = j-i+1; | |
576 | i = 1; | |
577 | - while (DateCalc_scan9(buffer,length,i,false)) i++; | |
578 | + while (DateCalc_scan9(buffer,length,i,_false)) i++; | |
579 | j = length-2; | |
580 | - while (DateCalc_scan9(buffer,length,j,false)) j--; | |
581 | + while (DateCalc_scan9(buffer,length,j,_false)) j--; | |
582 | if (j < i) /* only numerical chars without delimiters */ | |
583 | { | |
584 | switch (length) | |
585 | @@ -1903,7 +1903,7 @@ | |
586 | *year = DateCalc_Str2Int(buffer+4,4); | |
587 | break; | |
588 | default: | |
589 | - return(false); | |
590 | + return(_false); | |
591 | break; | |
592 | } | |
593 | } | |
594 | @@ -1911,18 +1911,18 @@ | |
595 | { | |
596 | *day = DateCalc_Str2Int(buffer,i); | |
597 | *year = DateCalc_Str2Int(buffer+(j+1),length-(j+1)); | |
598 | - while (DateCalc_scanx(buffer,length,i,true)) i++; | |
599 | - while (DateCalc_scanx(buffer,length,j,true)) j--; | |
600 | + while (DateCalc_scanx(buffer,length,i,_true)) i++; | |
601 | + while (DateCalc_scanx(buffer,length,j,_true)) j--; | |
602 | if (i <= j) /* at least one char left for month */ | |
603 | { | |
604 | buffer += i; | |
605 | length = j-i+1; | |
606 | i = 1; | |
607 | - while (DateCalc_scanx(buffer,length,i,false)) i++; | |
608 | + while (DateCalc_scanx(buffer,length,i,_false)) i++; | |
609 | if (i >= length) /* ok, no more delimiters */ | |
610 | { | |
611 | i = 0; | |
612 | - while (DateCalc_scan9(buffer,length,i,false)) i++; | |
613 | + while (DateCalc_scan9(buffer,length,i,_false)) i++; | |
614 | if (i >= length) /* only digits for month */ | |
615 | { | |
616 | *month = DateCalc_Str2Int(buffer,length); | |
617 | @@ -1932,14 +1932,14 @@ | |
618 | *month = DateCalc_Decode_Month(buffer,length,lang); | |
619 | } | |
620 | } | |
621 | - else return(false); /* delimiters inside month string */ | |
622 | + else return(_false); /* delimiters inside month string */ | |
623 | } | |
624 | - else return(false); /* no chars left for month */ | |
625 | + else return(_false); /* no chars left for month */ | |
626 | } /* at least one non-numerical char (i <= j) */ | |
627 | } | |
628 | - else return(false); /* less than 3 chars in buffer */ | |
629 | + else return(_false); /* less than 3 chars in buffer */ | |
630 | } | |
631 | - else return(false); /* length <= 0 */ | |
632 | + else return(_false); /* length <= 0 */ | |
633 | *year = DateCalc_Moving_Window(*year); | |
634 | return( DateCalc_check_date(*year,*month,*day) ); | |
635 | } | |
636 | @@ -1956,17 +1956,17 @@ | |
637 | if (length > 0) | |
638 | { | |
639 | i = 0; | |
640 | - while (DateCalc_scanx(buffer,length,i,true)) i++; | |
641 | + while (DateCalc_scanx(buffer,length,i,_true)) i++; | |
642 | j = length-1; | |
643 | - while (DateCalc_scan9(buffer,length,j,true)) j--; | |
644 | + while (DateCalc_scan9(buffer,length,j,_true)) j--; | |
645 | if (i+1 < j) /* at least 3 chars, else error! */ | |
646 | { | |
647 | buffer += i; | |
648 | length = j-i+1; | |
649 | i = 1; | |
650 | - while (DateCalc_scanx(buffer,length,i,false)) i++; | |
651 | + while (DateCalc_scanx(buffer,length,i,_false)) i++; | |
652 | j = length-2; | |
653 | - while (DateCalc_scan9(buffer,length,j,false)) j--; | |
654 | + while (DateCalc_scan9(buffer,length,j,_false)) j--; | |
655 | if (i >= length) /* only alphanumeric chars left */ | |
656 | { | |
657 | if (j < 0) /* case 0 : xxxx999999xxxx */ | |
658 | @@ -2004,7 +2004,7 @@ | |
659 | *year = DateCalc_Str2Int(buffer+4,4); | |
660 | break; | |
661 | default: | |
662 | - return(false); | |
663 | + return(_false); | |
664 | break; | |
665 | } | |
666 | } | |
667 | @@ -2036,7 +2036,7 @@ | |
668 | *year = DateCalc_Str2Int(buffer+2,4); | |
669 | break; | |
670 | default: | |
671 | - return(false); | |
672 | + return(_false); | |
673 | break; | |
674 | } | |
675 | } | |
676 | @@ -2044,7 +2044,7 @@ | |
677 | else /* case 2 : xxxxAAAxxxx9999xxxx _OR_ */ | |
678 | { /* case 3 : xxxxAAAxx99xx9999xx */ | |
679 | k = 0; /* 0 i j l */ | |
680 | - while (DateCalc_scan9(buffer,length,k,false)) k++; | |
681 | + while (DateCalc_scan9(buffer,length,k,_false)) k++; | |
682 | if (k >= i) /* ok, only digits */ | |
683 | { | |
684 | *month = DateCalc_Str2Int(buffer,i); | |
685 | @@ -2052,16 +2052,16 @@ | |
686 | else /* no, some non-digits */ | |
687 | { | |
688 | *month = DateCalc_Decode_Month(buffer,i,lang); | |
689 | - if (*month == 0) return(false); | |
690 | + if (*month == 0) return(_false); | |
691 | } | |
692 | buffer += i; | |
693 | length -= i; | |
694 | j -= i; | |
695 | k = j+1; /* remember start posn of day+year(2)/year(3) */ | |
696 | i = 1; | |
697 | - while (DateCalc_scanx(buffer,length,i,true)) i++; | |
698 | + while (DateCalc_scanx(buffer,length,i,_true)) i++; | |
699 | j--; | |
700 | - while (DateCalc_scan9(buffer,length,j,true)) j--; | |
701 | + while (DateCalc_scan9(buffer,length,j,_true)) j--; | |
702 | if (j < i) /* case 2 : xxxxAAAxxxx9999xxxx */ | |
703 | { /* j0 i l */ | |
704 | buffer += k; /* k */ | |
705 | @@ -2089,7 +2089,7 @@ | |
706 | *year = DateCalc_Str2Int(buffer+2,4); | |
707 | break; | |
708 | default: | |
709 | - return(false); | |
710 | + return(_false); | |
711 | break; | |
712 | } | |
713 | } | |
714 | @@ -2097,18 +2097,18 @@ | |
715 | { /* 0 ij k l */ | |
716 | *year = DateCalc_Str2Int(buffer+k,length-k); | |
717 | k = i; | |
718 | - while (DateCalc_scan9(buffer,length,k,false)) k++; | |
719 | + while (DateCalc_scan9(buffer,length,k,_false)) k++; | |
720 | if (k > j) /* ok, only digits */ | |
721 | { | |
722 | *day = DateCalc_Str2Int(buffer+i,j-i+1); | |
723 | } | |
724 | - else return(false); /* non-digits inside day */ | |
725 | + else return(_false); /* non-digits inside day */ | |
726 | } | |
727 | } /* i < length */ | |
728 | } | |
729 | - else return(false); /* less than 3 chars in buffer */ | |
730 | + else return(_false); /* less than 3 chars in buffer */ | |
731 | } | |
732 | - else return(false); /* length <= 0 */ | |
733 | + else return(_false); /* length <= 0 */ | |
734 | *year = DateCalc_Moving_Window(*year); | |
735 | return( DateCalc_check_date(*year,*month,*day) ); | |
736 | } | |
737 | @@ -2202,7 +2202,7 @@ | |
738 | return( DateCalc_check_date(*century+*year,*month,*day) ); | |
739 | } | |
740 | } | |
741 | - return(false); | |
742 | + return(_false); | |
743 | } | |
744 | ||
745 | boolean DateCalc_check_compressed(Z_int date) |