#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <sys/types.h>
#include <time.h>
Go to the source code of this file.
Data Structures | |
struct | timeb |
struct | _TABLE |
union | YYSTYPE |
Defines | |
#define | YYBYACC 1 |
#define | YYMAJOR 1 |
#define | YYMINOR 9 |
#define | YYLEX yylex() |
#define | YYEMPTY -1 |
#define | yyclearin (yychar=(YYEMPTY)) |
#define | yyerrok (yyerrflag=0) |
#define | YYRECOVERING() (yyerrflag!=0) |
#define | YYPREFIX "yy" |
#define | yyparse getdate_yyparse |
#define | yylex getdate_yylex |
#define | yyerror getdate_yyerror |
#define | EPOCH 1970 |
#define | HOUR(x) ((time_t)(x) * 60) |
#define | SECSPERDAY (24L * 60L * 60L) |
#define | YYERRCODE 256 |
#define | tAGO 257 |
#define | tDAY 258 |
#define | tDAYZONE 259 |
#define | tID 260 |
#define | tMERIDIAN 261 |
#define | tMINUTE_UNIT 262 |
#define | tMONTH 263 |
#define | tMONTH_UNIT 264 |
#define | tSEC_UNIT 265 |
#define | tSNUMBER 266 |
#define | tUNUMBER 267 |
#define | tZONE 268 |
#define | tDST 269 |
#define | YYTABLESIZE 337 |
#define | YYFINAL 1 |
#define | YYDEBUG 0 |
#define | YYMAXTOKEN 269 |
#define | YYSTACKSIZE 10000 |
#define | YYMAXDEPTH 10000 |
#define | YYINITSTACKSIZE 200 |
#define | TM_YEAR_ORIGIN 1900 |
#define | YYABORT goto yyabort |
#define | YYREJECT goto yyabort |
#define | YYACCEPT goto yyaccept |
#define | YYERROR goto yyerrlab |
#define | YYPARSE_PARAM_ARG |
#define | YYPARSE_PARAM_DECL |
Typedefs | |
typedef _TABLE | TABLE |
typedef enum _DSTMODE | DSTMODE |
typedef enum _MERIDIAN | MERIDIAN |
Enumerations | |
enum | _DSTMODE { DSTon, DSToff, DSTmaybe } |
enum | _MERIDIAN { MERam, MERpm, MER24 } |
Functions | |
static int | yygrowstack () |
time_t | get_date (char *p, struct timeb *now) |
static int | getdate_yyparse (void) |
static int | getdate_yylex (void) |
static int | getdate_yyerror (const char *s) |
static time_t | ToSeconds (time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian) |
static time_t | Convert (time_t Month, time_t Day, time_t Year, time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian, DSTMODE DSTmode) |
static time_t | DSTcorrect (time_t Start, time_t Future) |
static time_t | RelativeDate (time_t Start, time_t DayOrdinal, time_t DayNumber) |
static time_t | RelativeMonth (time_t Start, time_t RelMonth) |
static int | LookupWord (char *buff) |
static long | difftm (const struct tm *a, const struct tm *b) |
Variables | |
static char const | yyrcsid [] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $" |
static char * | yyInput |
static DSTMODE | yyDSTmode |
static time_t | yyDayOrdinal |
static time_t | yyDayNumber |
static int | yyHaveDate |
static int | yyHaveDay |
static int | yyHaveRel |
static int | yyHaveTime |
static int | yyHaveZone |
static time_t | yyTimezone |
static time_t | yyDay |
static time_t | yyHour |
static time_t | yyMinutes |
static time_t | yyMonth |
static time_t | yySeconds |
static time_t | yyYear |
static MERIDIAN | yyMeridian |
static time_t | yyRelMonth |
static time_t | yyRelSeconds |
static const short | yylhs [] |
static const short | yylen [] |
static const short | yydefred [] |
static const short | yydgoto [] |
static const short | yysindex [] |
static const short | yyrindex [] |
static const short | yygindex [] |
static const short | yytable [] |
static const short | yycheck [] |
static int | yydebug |
static int | yynerrs |
static int | yyerrflag |
static int | yychar |
static short * | yyssp |
static YYSTYPE * | yyvsp |
static YYSTYPE | yyval |
static YYSTYPE | yylval |
static short * | yyss |
static short * | yysslim |
static YYSTYPE * | yyvs |
static int | yystacksize |
static TABLE const | MonthDayTable [] |
static TABLE const | UnitsTable [] |
static TABLE const | OtherTable [] |
static TABLE const | TimezoneTable [] |
static TABLE const | MilitaryTable [] |
#define SECSPERDAY (24L * 60L * 60L) |
#define tMERIDIAN 261 |
#define tSNUMBER 266 |
#define tUNUMBER 267 |
#define YYDEBUG 0 |
#define YYERRCODE 256 |
#define yyerror getdate_yyerror |
#define YYFINAL 1 |
#define YYINITSTACKSIZE 200 |
#define yylex getdate_yylex |
#define YYMAXDEPTH 10000 |
#define YYMAXTOKEN 269 |
#define yyparse getdate_yyparse |
#define YYPREFIX "yy" |
#define YYTABLESIZE 337 |
static time_t Convert | ( | time_t | Month, | |
time_t | Day, | |||
time_t | Year, | |||
time_t | Hours, | |||
time_t | Minutes, | |||
time_t | Seconds, | |||
MERIDIAN | Meridian, | |||
DSTMODE | DSTmode | |||
) | [static] |
Definition at line 659 of file getdate.c.
References DSTmaybe, DSTon, EPOCH, SECSPERDAY, ToSeconds(), and yyTimezone.
Referenced by get_date(), and RelativeMonth().
static long difftm | ( | const struct tm * | a, | |
const struct tm * | b | |||
) | [static] |
static time_t DSTcorrect | ( | time_t | Start, | |
time_t | Future | |||
) | [static] |
time_t get_date | ( | char * | p, | |
struct timeb * | now | |||
) |
Definition at line 932 of file getdate.c.
References Convert(), difftm(), DSTmaybe, MER24, RelativeDate(), RelativeMonth(), timeb::time, timeb::timezone, yyDay, yyDayNumber, yyDayOrdinal, yyDSTmode, yyHaveDate, yyHaveDay, yyHaveRel, yyHaveTime, yyHaveZone, yyHour, yyInput, yyMeridian, yyMinutes, yyMonth, yyparse, yyRelMonth, yyRelSeconds, yySeconds, yyTimezone, and yyYear.
Referenced by installArgCallback().
static int getdate_yylex | ( | void | ) | [static] |
Definition at line 855 of file getdate.c.
References LookupWord(), YYSTYPE::Number, tSNUMBER, tUNUMBER, yyInput, and yylval.
int getdate_yyparse | ( | void | ) | [static] |
Definition at line 1116 of file getdate.c.
References DSToff, DSTon, getenv(), MER24, YYSTYPE::Meridian, YYSTYPE::Number, yychar, yycheck, yyDay, yyDayNumber, yyDayOrdinal, YYDEBUG, yydebug, yydefred, yydgoto, yyDSTmode, YYERRCODE, yyerrflag, yyerror, YYFINAL, yygindex, yygrowstack(), yyHaveDate, yyHaveDay, yyHaveRel, yyHaveTime, yyHaveZone, yyHour, yylen, yylex, yylhs, yylval, YYMAXTOKEN, yyMeridian, yyMinutes, yyMonth, yynerrs, YYPREFIX, yyRelMonth, yyRelSeconds, yyrindex, yySeconds, yysindex, yyss, yysslim, yyssp, yytable, YYTABLESIZE, yyTimezone, yyval, yyvs, yyvsp, and yyYear.
static int LookupWord | ( | char * | buff | ) | [static] |
Definition at line 749 of file getdate.c.
References MERam, YYSTYPE::Meridian, MERpm, MonthDayTable, _TABLE::name, YYSTYPE::Number, tMERIDIAN, _TABLE::type, _TABLE::value, and yylval.
Referenced by getdate_yylex().
static time_t RelativeDate | ( | time_t | Start, | |
time_t | DayOrdinal, | |||
time_t | DayNumber | |||
) | [static] |
Definition at line 715 of file getdate.c.
References DSTcorrect(), and SECSPERDAY.
Referenced by get_date().
static time_t RelativeMonth | ( | time_t | Start, | |
time_t | RelMonth | |||
) | [static] |
Definition at line 729 of file getdate.c.
References Convert(), DSTcorrect(), DSTmaybe, and MER24.
Referenced by get_date().
static time_t ToSeconds | ( | time_t | Hours, | |
time_t | Minutes, | |||
time_t | Seconds, | |||
MERIDIAN | Meridian | |||
) | [static] |
static int yygrowstack | ( | ) | [static] |
Definition at line 1059 of file getdate.c.
References YYINITSTACKSIZE, YYMAXDEPTH, yyss, yysslim, yyssp, yystacksize, yyvs, and yyvsp.
Referenced by getdate_yyparse().
TABLE const MilitaryTable[] [static] |
Initial value:
{ { "a", 268 , ((time_t)( 1 ) * 60) }, { "b", 268 , ((time_t)( 2 ) * 60) }, { "c", 268 , ((time_t)( 3 ) * 60) }, { "d", 268 , ((time_t)( 4 ) * 60) }, { "e", 268 , ((time_t)( 5 ) * 60) }, { "f", 268 , ((time_t)( 6 ) * 60) }, { "g", 268 , ((time_t)( 7 ) * 60) }, { "h", 268 , ((time_t)( 8 ) * 60) }, { "i", 268 , ((time_t)( 9 ) * 60) }, { "k", 268 , ((time_t)( 10 ) * 60) }, { "l", 268 , ((time_t)( 11 ) * 60) }, { "m", 268 , ((time_t)( 12 ) * 60) }, { "n", 268 , ((time_t)( - 1 ) * 60) }, { "o", 268 , ((time_t)( - 2 ) * 60) }, { "p", 268 , ((time_t)( - 3 ) * 60) }, { "q", 268 , ((time_t)( - 4 ) * 60) }, { "r", 268 , ((time_t)( - 5 ) * 60) }, { "s", 268 , ((time_t)( - 6 ) * 60) }, { "t", 268 , ((time_t)( - 7 ) * 60) }, { "u", 268 , ((time_t)( - 8 ) * 60) }, { "v", 268 , ((time_t)( - 9 ) * 60) }, { "w", 268 , ((time_t)( -10 ) * 60) }, { "x", 268 , ((time_t)( -11 ) * 60) }, { "y", 268 , ((time_t)( -12 ) * 60) }, { "z", 268 , ((time_t)( 0 ) * 60) }, { NULL, 0, 0 } }
TABLE const MonthDayTable[] [static] |
Initial value:
{ { "january", 263 , 1 }, { "february", 263 , 2 }, { "march", 263 , 3 }, { "april", 263 , 4 }, { "may", 263 , 5 }, { "june", 263 , 6 }, { "july", 263 , 7 }, { "august", 263 , 8 }, { "september", 263 , 9 }, { "sept", 263 , 9 }, { "october", 263 , 10 }, { "november", 263 , 11 }, { "december", 263 , 12 }, { "sunday", 258 , 0 }, { "monday", 258 , 1 }, { "tuesday", 258 , 2 }, { "tues", 258 , 2 }, { "wednesday", 258 , 3 }, { "wednes", 258 , 3 }, { "thursday", 258 , 4 }, { "thur", 258 , 4 }, { "thurs", 258 , 4 }, { "friday", 258 , 5 }, { "saturday", 258 , 6 }, { NULL, 0, 0 } }
Definition at line 431 of file getdate.c.
Referenced by LookupWord().
TABLE const OtherTable[] [static] |
Initial value:
{ { "tomorrow", 262 , 1 * 24 * 60 }, { "yesterday", 262 , -1 * 24 * 60 }, { "today", 262 , 0 }, { "now", 262 , 0 }, { "last", 267 , -1 }, { "this", 262 , 0 }, { "next", 267 , 2 }, { "first", 267 , 1 }, { "third", 267 , 3 }, { "fourth", 267 , 4 }, { "fifth", 267 , 5 }, { "sixth", 267 , 6 }, { "seventh", 267 , 7 }, { "eighth", 267 , 8 }, { "ninth", 267 , 9 }, { "tenth", 267 , 10 }, { "eleventh", 267 , 11 }, { "twelfth", 267 , 12 }, { "ago", 257 , 1 }, { NULL, 0, 0 } }
TABLE const TimezoneTable[] [static] |
TABLE const UnitsTable[] [static] |
Initial value:
{ { "year", 264 , 12 }, { "month", 264 , 1 }, { "fortnight", 262 , 14 * 24 * 60 }, { "week", 262 , 7 * 24 * 60 }, { "day", 262 , 1 * 24 * 60 }, { "hour", 262 , 60 }, { "minute", 262 , 1 }, { "min", 262 , 1 }, { "second", 265 , 1 }, { "sec", 265 , 1 }, { NULL, 0, 0 } }
int yychar [static] |
const short yycheck[] [static] |
time_t yyDay [static] |
time_t yyDayNumber [static] |
time_t yyDayOrdinal [static] |
int yydebug [static] |
const short yydefred[] [static] |
Initial value:
{ 1, 0, 0, 15, 32, 0, 38, 35, 0, 0, 0, 2, 3, 4, 5, 6, 7, 8, 0, 18, 0, 31, 36, 33, 19, 9, 30, 0, 37, 34, 0, 0, 0, 16, 28, 0, 23, 27, 22, 0, 0, 25, 41, 11, 0, 10, 0, 0, 21, 13, 12, }
Definition at line 239 of file getdate.c.
Referenced by getdate_yyparse().
const short yydgoto[] [static] |
Initial value:
{ 1, 45, 11, 12, 13, 14, 15, 16, 17, 18, }
Definition at line 246 of file getdate.c.
Referenced by getdate_yyparse().
int yyerrflag [static] |
const short yygindex[] [static] |
Initial value:
{ 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, }
Definition at line 263 of file getdate.c.
Referenced by getdate_yyparse().
int yyHaveDate [static] |
int yyHaveDay [static] |
int yyHaveRel [static] |
int yyHaveTime [static] |
int yyHaveZone [static] |
time_t yyHour [static] |
char* yyInput [static] |
const short yylen[] [static] |
Initial value:
{ 2, 0, 2, 1, 1, 1, 1, 1, 1, 2, 4, 4, 6, 6, 1, 1, 2, 1, 2, 2, 3, 5, 3, 3, 2, 4, 2, 3, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 1, 0, 1, }
Definition at line 232 of file getdate.c.
Referenced by getdate_yyparse().
const short yylhs[] [static] |
Initial value:
{ -1, 0, 0, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 7, 7, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 1, 1, }
Definition at line 225 of file getdate.c.
Referenced by getdate_yyparse().
Definition at line 423 of file getdate.c.
Referenced by getdate_yylex(), getdate_yyparse(), and LookupWord().
MERIDIAN yyMeridian [static] |
time_t yyMinutes [static] |
time_t yyMonth [static] |
int yynerrs [static] |
char const yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $" [static] |
time_t yyRelMonth [static] |
time_t yyRelSeconds [static] |
const short yyrindex[] [static] |
Initial value:
{ 0, 0, 1, 0, 0, 0, 0, 0, 0, 69, 12, 0, 0, 0, 0, 0, 0, 0, 23, 0, 34, 0, 0, 0, 0, 0, 0, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 45, 0, 0, 0, 0, 0, 0, 56, 0, 0, 0, }
Definition at line 256 of file getdate.c.
Referenced by getdate_yyparse().
time_t yySeconds [static] |
const short yysindex[] [static] |
Initial value:
{ 0, -249, -38, 0, 0, -260, 0, 0, -240, -47, -248, 0, 0, 0, 0, 0, 0, 0, -237, 0, -18, 0, 0, 0, 0, 0, 0, -262, 0, 0, -239, -238, -236, 0, 0, -235, 0, 0, 0, -56, -19, 0, 0, 0, -234, 0, -232, -258, 0, 0, 0, }
Definition at line 249 of file getdate.c.
Referenced by getdate_yyparse().
short* yyss [static] |
short* yysslim [static] |
short* yyssp [static] |
int yystacksize [static] |
const short yytable[] [static] |
time_t yyTimezone [static] |
Definition at line 194 of file getdate.c.
Referenced by Convert(), get_date(), and getdate_yyparse().
time_t yyYear [static] |