3 #pragma warning( disable: 4028 )
16 #define tHOUR_UNIT 262
19 #define tMINUTE_UNIT 265
21 #define tMONTH_UNIT 267
25 #define tYEAR_UNIT 271
68 #include <sys/types.h>
69 #include <sys/malloc.h>
87 #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
88 # define IN_CTYPE_DOMAIN(c) 1
90 # define IN_CTYPE_DOMAIN(c) isascii(c)
93 #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
94 #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
95 #define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c))
96 #define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c))
106 #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
108 #if defined (STDC_HEADERS) || defined (USG)
121 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
122 # define __attribute__(x)
125 #ifndef ATTRIBUTE_UNUSED
126 # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
132 #if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
133 # define bcopy(from, to, len) memcpy ((to), (from), (len))
144 #define yymaxdepth Curl_gd_maxdepth
145 #define yyparse Curl_gd_parse
146 #define yylex Curl_gd_lex
147 #define yyerror Curl_gd_error
148 #define yylval Curl_gd_lval
149 #define yychar Curl_gd_char
150 #define yydebug Curl_gd_debug
151 #define yypact Curl_gd_pact
152 #define yyr1 Curl_gd_r1
153 #define yyr2 Curl_gd_r2
154 #define yydef Curl_gd_def
155 #define yychk Curl_gd_chk
156 #define yypgo Curl_gd_pgo
157 #define yyact Curl_gd_act
158 #define yyexca Curl_gd_exca
159 #define yyerrflag Curl_gd_errflag
160 #define yynerrs Curl_gd_nerrs
161 #define yyps Curl_gd_ps
162 #define yypv Curl_gd_pv
163 #define yys Curl_gd_s
164 #define yy_yys Curl_gd_yys
165 #define yystate Curl_gd_state
166 #define yytmp Curl_gd_tmp
167 #define yyv Curl_gd_v
168 #define yy_yyv Curl_gd_yyv
169 #define yyval Curl_gd_val
170 #define yylloc Curl_gd_lloc
171 #define yyreds Curl_gd_reds
172 #define yytoks Curl_gd_toks
173 #define yylhs Curl_gd_yylhs
174 #define yylen Curl_gd_yylen
175 #define yydefred Curl_gd_yydefred
176 #define yydgoto Curl_gd_yydgoto
177 #define yysindex Curl_gd_yysindex
178 #define yyrindex Curl_gd_yyrindex
179 #define yygindex Curl_gd_yygindex
180 #define yytable Curl_gd_yytable
181 #define yycheck Curl_gd_yycheck
184 #define HOUR(x) ((x) * 60)
186 #define MAX_BUFF_LEN 128
234 #define YYPARSE_PARAM cookie
235 #define YYLEX_PARAM cookie
236 #define context ((CURL_CONTEXT *) cookie)
238 #line 219 "getdate.y"
243 #line 224 "getdate.y"
258 #define YYFLAG -32768
261 #define YYTRANSLATE(x) ((unsigned)(x) <= 272 ? yytranslate[x] : 32)
263 static const char yytranslate[] = { 0,
264 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
265 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
266 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
267 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
268 2, 2, 2, 20, 2, 2, 21, 2, 2, 2,
269 2, 2, 2, 2, 2, 2, 2, 19, 2, 2,
270 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
271 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
272 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
273 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
274 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
275 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
276 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
278 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
279 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
280 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
281 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
282 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
283 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
284 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
285 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
286 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
287 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
288 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
289 2, 2, 2, 2, 2, 1, 3, 4, 5, 6,
290 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
295 static const short yyprhs[] = { 0,
296 0, 1, 4, 6, 8, 10, 12, 14, 16, 19,
297 24, 29, 36, 43, 45, 47, 50, 52, 55, 58,
298 62, 68, 72, 76, 79, 84, 87, 91, 94, 96,
299 99, 102, 104, 107, 110, 112, 115, 118, 120, 123,
300 126, 128, 131, 134, 136, 139, 142, 144, 146, 147
303 static const short yyrhs[] = { -1,
304 22, 23, 0, 24, 0, 25, 0, 27, 0, 26,
305 0, 28, 0, 30, 0, 16, 10, 0, 16, 19,
306 16, 31, 0, 16, 19, 16, 15, 0, 16, 19,
307 16, 19, 16, 31, 0, 16, 19, 16, 19, 16,
308 15, 0, 18, 0, 6, 0, 18, 7, 0, 4,
309 0, 4, 20, 0, 16, 4, 0, 16, 21, 16,
310 0, 16, 21, 16, 21, 16, 0, 16, 15, 15,
311 0, 16, 12, 15, 0, 12, 16, 0, 12, 16,
312 20, 16, 0, 16, 12, 0, 16, 12, 16, 0,
313 29, 3, 0, 29, 0, 16, 17, 0, 15, 17,
314 0, 17, 0, 16, 13, 0, 15, 13, 0, 13,
315 0, 16, 5, 0, 15, 5, 0, 5, 0, 16,
316 8, 0, 15, 8, 0, 8, 0, 16, 11, 0,
317 15, 11, 0, 11, 0, 16, 14, 0, 15, 14,
318 0, 14, 0, 16, 0, 0, 10, 0
324 static const short yyrline[] = { 0,
325 240, 241, 244, 247, 250, 253, 256, 259, 262, 268,
326 274, 283, 289, 301, 304, 307, 313, 317, 321, 327,
327 331, 349, 355, 361, 365, 370, 374, 381, 389, 392,
328 395, 398, 401, 404, 407, 410, 413, 416, 419, 422,
329 425, 428, 431, 434, 437, 440, 443, 448, 482, 486
334 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
336 static const char *
const yytname[] = {
"$",
"error",
"$undefined.",
"tAGO",
"tDAY",
337 "tDAY_UNIT",
"tDAYZONE",
"tDST",
"tHOUR_UNIT",
"tID",
"tMERIDIAN",
"tMINUTE_UNIT",
338 "tMONTH",
"tMONTH_UNIT",
"tSEC_UNIT",
"tSNUMBER",
"tUNUMBER",
"tYEAR_UNIT",
"tZONE",
339 "':'",
"','",
"'/'",
"spec",
"item",
"time",
"zone",
"day",
"date",
"rel",
"relunit",
"number",
344 static const short yyr1[] = { 0,
345 22, 22, 23, 23, 23, 23, 23, 23, 24, 24,
346 24, 24, 24, 25, 25, 25, 26, 26, 26, 27,
347 27, 27, 27, 27, 27, 27, 27, 28, 28, 29,
348 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
349 29, 29, 29, 29, 29, 29, 29, 30, 31, 31
352 static const short yyr2[] = { 0,
353 0, 2, 1, 1, 1, 1, 1, 1, 2, 4,
354 4, 6, 6, 1, 1, 2, 1, 2, 2, 3,
355 5, 3, 3, 2, 4, 2, 3, 2, 1, 2,
356 2, 1, 2, 2, 1, 2, 2, 1, 2, 2,
357 1, 2, 2, 1, 2, 2, 1, 1, 0, 1
360 static const short yydefact[] = { 1,
361 0, 17, 38, 15, 41, 44, 0, 35, 47, 0,
362 48, 32, 14, 2, 3, 4, 6, 5, 7, 29,
363 8, 18, 24, 37, 40, 43, 34, 46, 31, 19,
364 36, 39, 9, 42, 26, 33, 45, 0, 30, 0,
365 0, 16, 28, 0, 23, 27, 22, 49, 20, 25,
366 50, 11, 0, 10, 0, 49, 21, 13, 12, 0,
370 static const short yydefgoto[] = { 1,
371 14, 15, 16, 17, 18, 19, 20, 21, 54
374 static const short yypact[] = {-32768,
375 0, -19,-32768,-32768,-32768,-32768, -13,-32768,-32768, 30,
376 15,-32768, 14,-32768,-32768,-32768,-32768,-32768,-32768, 19,
377 -32768,-32768, 4,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
378 -32768,-32768,-32768,-32768, -6,-32768,-32768, 16,-32768, 17,
379 23,-32768,-32768, 24,-32768,-32768,-32768, 27, 28,-32768,
380 -32768,-32768, 29,-32768, 32, -8,-32768,-32768,-32768, 50,
384 static const short yypgoto[] = {-32768,
385 -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -5
392 static const short yytable[] = { 60,
393 22, 51, 23, 2, 3, 4, 58, 5, 45, 46,
394 6, 7, 8, 9, 10, 11, 12, 13, 30, 31,
395 42, 43, 32, 44, 33, 34, 35, 36, 37, 38,
396 47, 39, 48, 40, 24, 41, 51, 25, 49, 50,
397 26, 52, 27, 28, 56, 53, 29, 57, 55, 61,
401 static const short yycheck[] = { 0,
402 20, 10, 16, 4, 5, 6, 15, 8, 15, 16,
403 11, 12, 13, 14, 15, 16, 17, 18, 4, 5,
404 7, 3, 8, 20, 10, 11, 12, 13, 14, 15,
405 15, 17, 16, 19, 5, 21, 10, 8, 16, 16,
406 11, 15, 13, 14, 16, 19, 17, 16, 21, 0,
412 #line 3 "/usr/lib/bison.simple"
443 #ifndef YYSTACK_USE_ALLOCA
445 #define YYSTACK_USE_ALLOCA
448 #define YYSTACK_USE_ALLOCA
449 #define alloca __builtin_alloca
451 #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
452 #define YYSTACK_USE_ALLOCA
458 #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
469 #define YYSTACK_USE_ALLOCA
474 #define YYSTACK_USE_ALLOCA
475 #define alloca __builtin_alloca
485 #ifdef YYSTACK_USE_ALLOCA
486 #define YYSTACK_ALLOC alloca
488 #define YYSTACK_ALLOC malloc
495 #define yyerrok (yyerrstatus = 0)
496 #define yyclearin (yychar = YYEMPTY)
499 #define YYACCEPT goto yyacceptlab
500 #define YYABORT goto yyabortlab
501 #define YYERROR goto yyerrlab1
506 #define YYFAIL goto yyerrlab
507 #define YYRECOVERING() (!!yyerrstatus)
508 #define YYBACKUP(token, value) \
510 if (yychar == YYEMPTY && yylen == 1) \
511 { yychar = (token), yylval = (value); \
512 yychar1 = YYTRANSLATE (yychar); \
517 { yyerror ("syntax error: cannot back up"); YYERROR; } \
521 #define YYERRCODE 256
524 #define YYLEX yylex()
530 #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM)
532 #define YYLEX yylex(&yylval, &yylloc)
536 #define YYLEX yylex(&yylval, YYLEX_PARAM)
538 #define YYLEX yylex(&yylval)
568 #define YYINITDEPTH 200
579 #define YYMAXDEPTH 10000
588 #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT)
595 __yy_memcpy (to, from,
count)
600 register char *
f = from;
601 register char *
t = to;
613 __yy_memcpy (
char *to,
char *from,
unsigned int count)
615 register char *
t = to;
616 register char *
f = from;
626 #line 217 "/usr/lib/bison.simple"
636 #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
637 #define YYPARSE_PARAM_DECL
639 #define YYPARSE_PARAM_ARG YYPARSE_PARAM
640 #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
643 #define YYPARSE_PARAM_ARG
644 #define YYPARSE_PARAM_DECL
662 register short *yyssp;
675 YYLTYPE *yyls = yylsa;
678 #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
680 #define YYPOPSTACK (yyvsp--, yyssp--)
684 int yyfree_stacks = 0;
703 fprintf(stderr,
"Starting parse\n");
729 if (yyssp >= yyss + yystacksize - 1)
736 YYLTYPE *yyls1 = yyls;
740 int size = yyssp - yyss + 1;
748 yyoverflow(
"parser stack overflow",
749 &yyss1, size *
sizeof (*yyssp),
750 &yyvs1, size *
sizeof (*yyvsp),
751 &yyls1, size *
sizeof (*yylsp),
754 yyoverflow(
"parser stack overflow",
755 &yyss1, size *
sizeof (*yyssp),
756 &yyvs1, size *
sizeof (*yyvsp),
760 yyss = yyss1; yyvs = yyvs1;
768 yyerror(
"parser stack overflow");
782 #ifndef YYSTACK_USE_ALLOCA
785 yyss = (
short *)
YYSTACK_ALLOC (yystacksize *
sizeof (*yyssp));
786 __yy_memcpy ((
char *)yyss, (
char *)yyss1,
787 size * (
unsigned int)
sizeof (*yyssp));
789 __yy_memcpy ((
char *)yyvs, (
char *)yyvs1,
790 size * (
unsigned int)
sizeof (*yyvsp));
792 yyls = (YYLTYPE *)
YYSTACK_ALLOC (yystacksize *
sizeof (*yylsp));
793 __yy_memcpy ((
char *)yyls, (
char *)yyls1,
794 size * (
unsigned int)
sizeof (*yylsp));
798 yyssp = yyss + size - 1;
799 yyvsp = yyvs + size - 1;
801 yylsp = yyls + size - 1;
806 fprintf(stderr,
"Stack size increased to %d\n", yystacksize);
809 if (yyssp >= yyss + yystacksize - 1)
815 fprintf(stderr,
"Entering state %d\n", yystate);
840 fprintf(stderr,
"Reading a token: ");
854 fprintf(stderr,
"Now at end of input.\n");
864 fprintf (stderr,
"Next token is %d (%s", yychar, yytname[yychar1]);
868 YYPRINT (stderr, yychar, yylval);
870 fprintf (stderr,
")\n");
905 fprintf(stderr,
"Shifting token %d (%s), ", yychar, yytname[yychar1]);
918 if (yyerrstatus) yyerrstatus--;
934 yyval = yyvsp[1-
yylen];
941 fprintf (stderr,
"Reducing via rule %d (line %d), ",
945 for (i = yyprhs[yyn]; yyrhs[
i] > 0; i++)
946 fprintf (stderr,
"%s ", yytname[yyrhs[i]]);
947 fprintf (stderr,
" -> %s\n", yytname[
yyr1[yyn]]);
955 #line 244 "getdate.y"
961 #line 247 "getdate.y"
967 #line 250 "getdate.y"
973 #line 253 "getdate.y"
979 #line 256 "getdate.y"
985 #line 262 "getdate.y"
994 #line 268 "getdate.y"
1003 #line 274 "getdate.y"
1010 ? -yyvsp[0].
Number % 100 + (-yyvsp[0].
Number / 100) * 60
1011 : - (yyvsp[0].Number % 100 + (yyvsp[0].Number / 100) * 60));
1015 #line 283 "getdate.y"
1024 #line 289 "getdate.y"
1032 ? -yyvsp[0].
Number % 100 + (-yyvsp[0].
Number / 100) * 60
1033 : - (yyvsp[0].Number % 100 + (yyvsp[0].Number / 100) * 60));
1037 #line 301 "getdate.y"
1043 #line 304 "getdate.y"
1049 #line 308 "getdate.y"
1055 #line 313 "getdate.y"
1062 #line 317 "getdate.y"
1069 #line 321 "getdate.y"
1076 #line 327 "getdate.y"
1083 #line 331 "getdate.y"
1089 if (yyvsp[-4].Number >= 1000)
1104 #line 349 "getdate.y"
1113 #line 355 "getdate.y"
1122 #line 361 "getdate.y"
1129 #line 365 "getdate.y"
1137 #line 370 "getdate.y"
1144 #line 374 "getdate.y"
1152 #line 381 "getdate.y"
1163 #line 392 "getdate.y"
1169 #line 395 "getdate.y"
1175 #line 398 "getdate.y"
1181 #line 401 "getdate.y"
1187 #line 404 "getdate.y"
1193 #line 407 "getdate.y"
1199 #line 410 "getdate.y"
1205 #line 413 "getdate.y"
1211 #line 416 "getdate.y"
1217 #line 419 "getdate.y"
1223 #line 422 "getdate.y"
1229 #line 425 "getdate.y"
1235 #line 428 "getdate.y"
1241 #line 431 "getdate.y"
1247 #line 434 "getdate.y"
1253 #line 437 "getdate.y"
1259 #line 440 "getdate.y"
1265 #line 443 "getdate.y"
1271 #line 449 "getdate.y"
1278 if (yyvsp[0].Number>10000)
1288 if (yyvsp[0].Number < 100)
1305 #line 483 "getdate.y"
1311 #line 487 "getdate.y"
1318 #line 543 "/usr/lib/bison.simple"
1329 short *ssp1 = yyss - 1;
1330 fprintf (stderr,
"state stack now");
1331 while (ssp1 != yyssp)
1332 fprintf (stderr,
" %d", *++ssp1);
1333 fprintf (stderr,
"\n");
1343 yylsp->first_line = yylloc.first_line;
1344 yylsp->first_column = yylloc.first_column;
1345 yylsp->last_line = (yylsp-1)->last_line;
1346 yylsp->last_column = (yylsp-1)->last_column;
1351 yylsp->last_line = (yylsp+yylen-1)->last_line;
1352 yylsp->last_column = (yylsp+yylen-1)->last_column;
1363 yystate = yypgoto[yyn -
YYNTBASE] + *yyssp;
1364 if (yystate >= 0 && yystate <=
YYLAST &&
yycheck[yystate] == *yyssp)
1367 yystate = yydefgoto[yyn -
YYNTBASE];
1378 #ifdef YYERROR_VERBOSE
1389 for (x = (yyn < 0 ? -yyn : 0);
1390 x < (
sizeof(yytname) /
sizeof(
char *)); x++)
1392 size += strlen(yytname[x]) + 15, count++;
1393 msg = (
char *) malloc(size + 15);
1396 strcpy(msg,
"parse error");
1401 for (x = (yyn < 0 ? -yyn : 0);
1402 x < (
sizeof(yytname) /
sizeof(
char *)); x++)
1405 strcat(msg, count == 0 ?
", expecting `" :
" or `");
1406 strcat(msg, yytname[x]);
1415 yyerror (
"parse error; also virtual memory exceeded");
1425 if (yyerrstatus == 3)
1430 if (yychar ==
YYEOF)
1435 fprintf(stderr,
"Discarding token %d (%s).\n", yychar, yytname[yychar1]);
1454 if (yyn)
goto yydefault;
1469 short *ssp1 = yyss - 1;
1470 fprintf (stderr,
"Error: state stack now");
1471 while (ssp1 != yyssp)
1472 fprintf (stderr,
" %d", *++ssp1);
1473 fprintf (stderr,
"\n");
1503 fprintf(stderr,
"Shifting error token, ");
1538 #line 492 "getdate.y"
1547 extern struct tm *
gmtime (
const time_t *);
1548 extern struct tm *
localtime (
const time_t *);
1549 extern time_t
mktime (
struct tm *);
1553 static TABLE const MonthDayTable[] = {
1554 {
"january",
tMONTH, 1 },
1555 {
"february",
tMONTH, 2 },
1562 {
"september",
tMONTH, 9 },
1564 {
"october",
tMONTH, 10 },
1565 {
"november",
tMONTH, 11 },
1566 {
"december",
tMONTH, 12 },
1567 {
"sunday",
tDAY, 0 },
1568 {
"monday",
tDAY, 1 },
1569 {
"tuesday",
tDAY, 2 },
1570 {
"tues",
tDAY, 2 },
1571 {
"wednesday",
tDAY, 3 },
1572 {
"wednes",
tDAY, 3 },
1573 {
"thursday",
tDAY, 4 },
1574 {
"thur",
tDAY, 4 },
1575 {
"thurs",
tDAY, 4 },
1576 {
"friday",
tDAY, 5 },
1577 {
"saturday",
tDAY, 6 },
1582 static TABLE const UnitsTable[] = {
1597 static TABLE const OtherTable[] = {
1622 static TABLE const TimezoneTable[] = {
1707 static TABLE const MilitaryTable[] = {
1747 ToHour (
int Hours,
MERIDIAN Meridian)
1752 if (Hours < 0 || Hours > 23)
1756 if (Hours < 1 || Hours > 12)
1762 if (Hours < 1 || Hours > 12)
1783 else if (Year < 100)
1790 LookupWord (
YYSTYPE *yylval,
char *buff)
1794 register const TABLE *tp;
1799 for (p = buff; *
p; p++)
1800 if (
ISUPPER ((
unsigned char) *p))
1803 if (
strcmp (buff,
"am") == 0 ||
strcmp (buff,
"a.m.") == 0)
1808 if (
strcmp (buff,
"pm") == 0 ||
strcmp (buff,
"p.m.") == 0)
1815 if (strlen (buff) == 3)
1817 else if (strlen (buff) == 4 && buff[3] ==
'.')
1825 for (tp = MonthDayTable; tp->
name; tp++)
1842 for (tp = TimezoneTable; tp->
name; tp++)
1849 if (
strcmp (buff,
"dst") == 0)
1852 for (tp = UnitsTable; tp->
name; tp++)
1860 i = strlen (buff) - 1;
1864 for (tp = UnitsTable; tp->
name; tp++)
1873 for (tp = OtherTable; tp->
name; tp++)
1881 if (buff[1] ==
'\0' &&
ISALPHA ((
unsigned char) *buff))
1883 for (tp = MilitaryTable; tp->
name; tp++)
1892 for (i = 0, p = q = buff; *
q; q++)
1899 for (tp = TimezoneTable; tp->
name; tp++)
1912 register unsigned char c;
1925 if (c ==
'-' || c ==
'+')
1927 sign = c ==
'-' ? -1 : 1;
1943 for (p = buff; (c = *
context->yyInput++,
ISALPHA (c)) || c ==
'.';)
1944 if (p < &buff[
sizeof buff - 1])
1948 return LookupWord (yylval, buff);
1967 #define TM_YEAR_ORIGIN 1900
1971 difftm (
struct tm *
a,
struct tm *
b)
1977 a->tm_yday - b->tm_yday
1979 + ((ay >> 2) - (by >> 2))
1980 - (ay / 100 - by / 100)
1981 + ((ay / 100 >> 2) - (by / 100 >> 2))
1983 + (
long) (ay -
by) * 365
1985 return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour))
1986 + (a->tm_min - b->tm_min))
1987 + (a->tm_sec - b->tm_sec));
1993 struct tm tm, tm0, *tmp;
1996 #ifdef HAVE_LOCALTIME_R
2000 Start = now ? *now : time ((time_t *)
NULL);
2001 #ifdef HAVE_LOCALTIME_R
2002 tmp = (
struct tm *)localtime_r(&Start, &keeptime);
2009 cookie.
yyMonth = tmp->tm_mon + 1;
2010 cookie.
yyDay = tmp->tm_mday;
2011 cookie.
yyHour = tmp->tm_hour;
2014 tm.tm_isdst = tmp->tm_isdst;
2047 tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
2063 if (Start == (time_t) -1)
2090 if (Start == (time_t) -1)
2096 tm.tm_mday += ((cookie.
yyDayNumber - tm.tm_wday + 7) % 7
2099 if (Start == (time_t) -1)
2107 #ifdef HAVE_GMTIME_R
2109 struct tm keeptime2;
2110 gmt = (
struct tm *)gmtime_r(&Start, &keeptime2);
2116 delta = cookie.
yyTimezone * 60
L + difftm (&tm, gmt);
2117 if ((Start + delta < Start) != (delta < 0))
2129 main (
int ac,
char *av[])
2134 (
void) printf (
"Enter date, or blank line to exit.\n\t> ");
2135 (
void) fflush (stdout);
2142 (
void) printf (
"Bad format - couldn't convert.\n");
2144 (
void) printf (
"%s", ctime (&d));
2145 (
void) printf (
"\t> ");
2146 (
void) fflush (stdout);
GLdouble GLdouble GLdouble GLdouble q
GLuint GLuint GLsizei count
struct _CURL_CONTEXT CURL_CONTEXT
struct tm * gmtime(const time_t *)
GLubyte GLubyte GLubyte a
time_t curl_getdate(const char *p, const time_t *now)
time_t mktime(struct tm *)
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
#define YYPARSE_PARAM_ARG
#define YYPARSE_PARAM_DECL
struct tm * localtime(const time_t *)