aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/getdate.c124
1 files changed, 63 insertions, 61 deletions
diff --git a/lib/getdate.c b/lib/getdate.c
index e3342ff3a..6de85b4eb 100644
--- a/lib/getdate.c
+++ b/lib/getdate.c
@@ -1,7 +1,6 @@
/* A Bison parser, made from getdate.y
- by GNU Bison version 1.27
- */
+ by GNU Bison version 1.28 */
#define YYBISON 1 /* Identify Bison output. */
@@ -50,7 +49,12 @@
# undef static
#endif
+#ifdef __APPLE__
+#include <sys/types.h>
+#include <sys/malloc.h>
+#else
#include <malloc.h>
+#endif
#include <string.h>
#include <stdio.h>
#include <ctype.h>
@@ -202,7 +206,7 @@ static int yyRelSeconds;
static int yyRelYear;
-#line 184 "getdate.y"
+#line 189 "getdate.y"
typedef union {
int Number;
enum _MERIDIAN Meridian;
@@ -211,11 +215,9 @@ typedef union {
#ifndef __cplusplus
#ifndef __STDC__
-#ifndef const
#define const
#endif
#endif
-#endif
@@ -287,11 +289,11 @@ static const short yyrhs[] = { -1,
#if YYDEBUG != 0
static const short yyrline[] = { 0,
- 200, 201, 204, 207, 210, 213, 216, 219, 222, 228,
- 234, 243, 249, 261, 264, 267, 273, 277, 281, 287,
- 291, 309, 315, 321, 325, 330, 334, 341, 349, 352,
- 355, 358, 361, 364, 367, 370, 373, 376, 379, 382,
- 385, 388, 391, 394, 397, 400, 403, 408, 441, 445
+ 205, 206, 209, 212, 215, 218, 221, 224, 227, 233,
+ 239, 248, 254, 266, 269, 272, 278, 282, 286, 292,
+ 296, 314, 320, 326, 330, 335, 339, 346, 354, 357,
+ 360, 363, 366, 369, 372, 375, 378, 381, 384, 387,
+ 390, 393, 396, 399, 402, 405, 408, 413, 446, 450
};
#endif
@@ -372,8 +374,8 @@ static const short yycheck[] = { 0,
56
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
-#line 3 "/boot/apps/GeekGadgets/share/bison.simple"
-/* This file comes from bison-1.27. */
+#line 3 "/usr/lib/bison.simple"
+/* This file comes from bison-1.28. */
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
@@ -586,7 +588,7 @@ __yy_memcpy (char *to, char *from, unsigned int count)
#endif
#endif
-#line 216 "/boot/apps/GeekGadgets/share/bison.simple"
+#line 217 "/usr/lib/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *.
@@ -915,37 +917,37 @@ yyreduce:
switch (yyn) {
case 3:
-#line 204 "getdate.y"
+#line 209 "getdate.y"
{
yyHaveTime++;
;
break;}
case 4:
-#line 207 "getdate.y"
+#line 212 "getdate.y"
{
yyHaveZone++;
;
break;}
case 5:
-#line 210 "getdate.y"
+#line 215 "getdate.y"
{
yyHaveDate++;
;
break;}
case 6:
-#line 213 "getdate.y"
+#line 218 "getdate.y"
{
yyHaveDay++;
;
break;}
case 7:
-#line 216 "getdate.y"
+#line 221 "getdate.y"
{
yyHaveRel++;
;
break;}
case 9:
-#line 222 "getdate.y"
+#line 227 "getdate.y"
{
yyHour = yyvsp[-1].Number;
yyMinutes = 0;
@@ -954,7 +956,7 @@ case 9:
;
break;}
case 10:
-#line 228 "getdate.y"
+#line 233 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
@@ -963,7 +965,7 @@ case 10:
;
break;}
case 11:
-#line 234 "getdate.y"
+#line 239 "getdate.y"
{
yyHour = yyvsp[-3].Number;
yyMinutes = yyvsp[-1].Number;
@@ -975,7 +977,7 @@ case 11:
;
break;}
case 12:
-#line 243 "getdate.y"
+#line 248 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
@@ -984,7 +986,7 @@ case 12:
;
break;}
case 13:
-#line 249 "getdate.y"
+#line 254 "getdate.y"
{
yyHour = yyvsp[-5].Number;
yyMinutes = yyvsp[-3].Number;
@@ -997,53 +999,53 @@ case 13:
;
break;}
case 14:
-#line 261 "getdate.y"
+#line 266 "getdate.y"
{
yyTimezone = yyvsp[0].Number;
;
break;}
case 15:
-#line 264 "getdate.y"
+#line 269 "getdate.y"
{
yyTimezone = yyvsp[0].Number - 60;
;
break;}
case 16:
-#line 268 "getdate.y"
+#line 273 "getdate.y"
{
yyTimezone = yyvsp[-1].Number - 60;
;
break;}
case 17:
-#line 273 "getdate.y"
+#line 278 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 18:
-#line 277 "getdate.y"
+#line 282 "getdate.y"
{
yyDayOrdinal = 1;
yyDayNumber = yyvsp[-1].Number;
;
break;}
case 19:
-#line 281 "getdate.y"
+#line 286 "getdate.y"
{
yyDayOrdinal = yyvsp[-1].Number;
yyDayNumber = yyvsp[0].Number;
;
break;}
case 20:
-#line 287 "getdate.y"
+#line 292 "getdate.y"
{
yyMonth = yyvsp[-2].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 21:
-#line 291 "getdate.y"
+#line 296 "getdate.y"
{
/* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY.
The goal in recognizing YYYY/MM/DD is solely to support legacy
@@ -1064,7 +1066,7 @@ case 21:
;
break;}
case 22:
-#line 309 "getdate.y"
+#line 314 "getdate.y"
{
/* ISO 8601 format. yyyy-mm-dd. */
yyYear = yyvsp[-2].Number;
@@ -1073,7 +1075,7 @@ case 22:
;
break;}
case 23:
-#line 315 "getdate.y"
+#line 320 "getdate.y"
{
/* e.g. 17-JUN-1992. */
yyDay = yyvsp[-2].Number;
@@ -1082,14 +1084,14 @@ case 23:
;
break;}
case 24:
-#line 321 "getdate.y"
+#line 326 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[0].Number;
;
break;}
case 25:
-#line 325 "getdate.y"
+#line 330 "getdate.y"
{
yyMonth = yyvsp[-3].Number;
yyDay = yyvsp[-2].Number;
@@ -1097,14 +1099,14 @@ case 25:
;
break;}
case 26:
-#line 330 "getdate.y"
+#line 335 "getdate.y"
{
yyMonth = yyvsp[0].Number;
yyDay = yyvsp[-1].Number;
;
break;}
case 27:
-#line 334 "getdate.y"
+#line 339 "getdate.y"
{
yyMonth = yyvsp[-1].Number;
yyDay = yyvsp[-2].Number;
@@ -1112,7 +1114,7 @@ case 27:
;
break;}
case 28:
-#line 341 "getdate.y"
+#line 346 "getdate.y"
{
yyRelSeconds = -yyRelSeconds;
yyRelMinutes = -yyRelMinutes;
@@ -1123,115 +1125,115 @@ case 28:
;
break;}
case 30:
-#line 352 "getdate.y"
+#line 357 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 31:
-#line 355 "getdate.y"
+#line 360 "getdate.y"
{
yyRelYear += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 32:
-#line 358 "getdate.y"
+#line 363 "getdate.y"
{
yyRelYear += yyvsp[0].Number;
;
break;}
case 33:
-#line 361 "getdate.y"
+#line 366 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 34:
-#line 364 "getdate.y"
+#line 369 "getdate.y"
{
yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 35:
-#line 367 "getdate.y"
+#line 372 "getdate.y"
{
yyRelMonth += yyvsp[0].Number;
;
break;}
case 36:
-#line 370 "getdate.y"
+#line 375 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 37:
-#line 373 "getdate.y"
+#line 378 "getdate.y"
{
yyRelDay += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 38:
-#line 376 "getdate.y"
+#line 381 "getdate.y"
{
yyRelDay += yyvsp[0].Number;
;
break;}
case 39:
-#line 379 "getdate.y"
+#line 384 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 40:
-#line 382 "getdate.y"
+#line 387 "getdate.y"
{
yyRelHour += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 41:
-#line 385 "getdate.y"
+#line 390 "getdate.y"
{
yyRelHour += yyvsp[0].Number;
;
break;}
case 42:
-#line 388 "getdate.y"
+#line 393 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 43:
-#line 391 "getdate.y"
+#line 396 "getdate.y"
{
yyRelMinutes += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 44:
-#line 394 "getdate.y"
+#line 399 "getdate.y"
{
yyRelMinutes += yyvsp[0].Number;
;
break;}
case 45:
-#line 397 "getdate.y"
+#line 402 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 46:
-#line 400 "getdate.y"
+#line 405 "getdate.y"
{
yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number;
;
break;}
case 47:
-#line 403 "getdate.y"
+#line 408 "getdate.y"
{
yyRelSeconds += yyvsp[0].Number;
;
break;}
case 48:
-#line 409 "getdate.y"
+#line 414 "getdate.y"
{
if (yyHaveTime && yyHaveDate && !yyHaveRel)
yyYear = yyvsp[0].Number;
@@ -1264,20 +1266,20 @@ case 48:
;
break;}
case 49:
-#line 442 "getdate.y"
+#line 447 "getdate.y"
{
yyval.Meridian = MER24;
;
break;}
case 50:
-#line 446 "getdate.y"
+#line 451 "getdate.y"
{
yyval.Meridian = yyvsp[0].Meridian;
;
break;}
}
/* the action file gets copied in in place of this dollarsign */
-#line 542 "/boot/apps/GeekGadgets/share/bison.simple"
+#line 543 "/usr/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
@@ -1497,7 +1499,7 @@ yyerrhandle:
}
return 1;
}
-#line 451 "getdate.y"
+#line 456 "getdate.y"
/* Include this file down here because bison inserts code above which