Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

getdate.c File Reference

#include "common.h"
#include "getdate.h"

Data Structures

struct  _TABLE
union  YYSTYPE

Defines

#define YYBYACC   1
#define IN_CTYPE_DOMAIN(c)   1
#define ISSPACE(c)   (IN_CTYPE_DOMAIN (c) && isspace (c))
#define ISALPHA(c)   (IN_CTYPE_DOMAIN (c) && isalpha (c))
#define ISUPPER(c)   (IN_CTYPE_DOMAIN (c) && isupper (c))
#define ISDIGIT_LOCALE(c)   (IN_CTYPE_DOMAIN (c) && isdigit (c))
#define ISDIGIT(c)   ((unsigned) (c) - '0' <= 9)
#define yymaxdepth   gd_maxdepth
#define yyparse   gd_parse
#define yylex   gd_lex
#define yyerror   gd_error
#define yylval   gd_lval
#define yychar   gd_char
#define yydebug   gd_debug
#define yypact   gd_pact
#define yyr1   gd_r1
#define yyr2   gd_r2
#define yydef   gd_def
#define yychk   gd_chk
#define yypgo   gd_pgo
#define yyact   gd_act
#define yyexca   gd_exca
#define yyerrflag   gd_errflag
#define yynerrs   gd_nerrs
#define yyps   gd_ps
#define yypv   gd_pv
#define yys   gd_s
#define yy_yys   gd_yys
#define yystate   gd_state
#define yytmp   gd_tmp
#define yyv   gd_v
#define yy_yyv   gd_yyv
#define yyval   gd_val
#define yylloc   gd_lloc
#define yyreds   gd_reds /* With YYDEBUG defined */
#define yytoks   gd_toks /* With YYDEBUG defined */
#define yylhs   gd_yylhs
#define yylen   gd_yylen
#define yydefred   gd_yydefred
#define yydgoto   gd_yydgoto
#define yysindex   gd_yysindex
#define yyrindex   gd_yyrindex
#define yygindex   gd_yygindex
#define yytable   gd_yytable
#define yycheck   gd_yycheck
#define EPOCH   1970
#define HOUR(x)   ((x) * 60)
#define MAX_BUFF_LEN   128 /* size of buffer to read the date into */
#define tAGO   257
#define tDAY   258
#define tDAY_UNIT   259
#define tDAYZONE   260
#define tDST   261
#define tHOUR_UNIT   262
#define tID   263
#define tMERIDIAN   264
#define tMINUTE_UNIT   265
#define tMONTH   266
#define tMONTH_UNIT   267
#define tSEC_UNIT   268
#define tSNUMBER   269
#define tUNUMBER   270
#define tYEAR_UNIT   271
#define tZONE   272
#define tNUMBER_T   273
#define tNUMBER_DOT   274
#define YYERRCODE   256
#define YYTABLESIZE   396
#define YYFINAL   1
#define YYDEBUG   0
#define YYMAXTOKEN   274
#define yyclearin   (yychar=(-1))
#define yyerrok   (yyerrflag=0)
#define YYSTACKSIZE   500
#define YYMAXDEPTH   500
#define yystacksize   YYSTACKSIZE
#define TM_YEAR_ORIGIN   1900
#define YYABORT   goto yyabort
#define YYACCEPT   goto yyaccept
#define YYERROR   goto yyerrlab

Typedefs

typedef _TABLE TABLE
typedef enum _MERIDIAN MERIDIAN

Enumerations

enum  _MERIDIAN { MERam, MERpm, MER24 }

Functions

int yylex (void)
int yyerror (char *s)
int yyparse (void)
int ToHour (int Hours, MERIDIAN Meridian)
int ToYear (int Year)
int LookupWord (char *buff)
long difftm (struct tm *a, struct tm *b)
time_t date2time (const char *p, time_t now)

Variables

char yysccsid [] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"
const unsigned char * yyInput
int yyDayOrdinal
int yyDayNumber
int yyHaveDate
int yyHaveDay
int yyHaveRel
int yyHaveTime
int yyHaveZone
int yyTimezone
int yyDay
int yyHour
int yyMinutes
int yyMonth
int yySeconds
int yyYear
MERIDIAN yyMeridian
int yyRelDay
int yyRelHour
int yyRelMinutes
int yyRelMonth
int yyRelSeconds
int yyRelYear
short yylhs []
short yylen []
short yydefred []
short yydgoto []
short yysindex []
short yyrindex []
short yygindex []
short yytable []
short yycheck []
int yydebug
int yynerrs
int yyerrflag
int yychar
short * yyssp
YYSTYPEyyvsp
YYSTYPE yyval
YYSTYPE yylval
short yyss [YYSTACKSIZE]
YYSTYPE yyvs [YYSTACKSIZE]
TABLE const  MonthDayTable []
TABLE const  UnitsTable []
TABLE const  OtherTable []
TABLE const  TimezoneTable []
TABLE const  MilitaryTable []


Define Documentation

#define EPOCH   1970
 

#define HOUR  )     ((x) * 60)
 

#define IN_CTYPE_DOMAIN  )     1
 

#define ISALPHA  )     (IN_CTYPE_DOMAIN (c) && isalpha (c))
 

#define ISDIGIT  )     ((unsigned) (c) - '0' <= 9)
 

#define ISDIGIT_LOCALE  )     (IN_CTYPE_DOMAIN (c) && isdigit (c))
 

#define ISSPACE  )     (IN_CTYPE_DOMAIN (c) && isspace (c))
 

#define ISUPPER  )     (IN_CTYPE_DOMAIN (c) && isupper (c))
 

#define MAX_BUFF_LEN   128 /* size of buffer to read the date into */
 

#define tAGO   257
 

#define tDAY   258
 

#define tDAY_UNIT   259
 

#define tDAYZONE   260
 

#define tDST   261
 

#define tHOUR_UNIT   262
 

#define tID   263
 

#define TM_YEAR_ORIGIN   1900
 

#define tMERIDIAN   264
 

#define tMINUTE_UNIT   265
 

#define tMONTH   266
 

#define tMONTH_UNIT   267
 

#define tNUMBER_DOT   274
 

#define tNUMBER_T   273
 

#define tSEC_UNIT   268
 

#define tSNUMBER   269
 

#define tUNUMBER   270
 

#define tYEAR_UNIT   271
 

#define tZONE   272
 

#define yy_yys   gd_yys
 

#define yy_yyv   gd_yyv
 

#define YYABORT   goto yyabort
 

#define YYACCEPT   goto yyaccept
 

#define yyact   gd_act
 

#define YYBYACC   1
 

#define yychar   gd_char
 

#define yycheck   gd_yycheck
 

#define yychk   gd_chk
 

#define yyclearin   (yychar=(-1))
 

#define YYDEBUG   0
 

#define yydebug   gd_debug
 

#define yydef   gd_def
 

#define yydefred   gd_yydefred
 

#define yydgoto   gd_yydgoto
 

#define YYERRCODE   256
 

#define yyerrflag   gd_errflag
 

#define yyerrok   (yyerrflag=0)
 

#define YYERROR   goto yyerrlab
 

#define yyerror   gd_error
 

#define yyexca   gd_exca
 

#define YYFINAL   1
 

#define yygindex   gd_yygindex
 

#define yylen   gd_yylen
 

#define yylex   gd_lex
 

#define yylhs   gd_yylhs
 

#define yylloc   gd_lloc
 

#define yylval   gd_lval
 

#define YYMAXDEPTH   500
 

#define yymaxdepth   gd_maxdepth
 

#define YYMAXTOKEN   274
 

#define yynerrs   gd_nerrs
 

#define yypact   gd_pact
 

#define yyparse   gd_parse
 

#define yypgo   gd_pgo
 

#define yyps   gd_ps
 

#define yypv   gd_pv
 

#define yyr1   gd_r1
 

#define yyr2   gd_r2
 

#define yyreds   gd_reds /* With YYDEBUG defined */
 

#define yyrindex   gd_yyrindex
 

#define yys   gd_s
 

#define yysindex   gd_yysindex
 

#define yystacksize   YYSTACKSIZE
 

#define YYSTACKSIZE   500
 

#define yystate   gd_state
 

#define yytable   gd_yytable
 

#define YYTABLESIZE   396
 

#define yytmp   gd_tmp
 

#define yytoks   gd_toks /* With YYDEBUG defined */
 

#define yyv   gd_v
 

#define yyval   gd_val
 


Typedef Documentation

typedef enum _MERIDIAN MERIDIAN
 

typedef struct _TABLE TABLE
 


Enumeration Type Documentation

enum _MERIDIAN
 

Enumeration values:
MERam 
MERpm 
MER24 


Function Documentation

time_t date2time const char *  p,
time_t  now
 

long difftm struct tm *  a,
struct tm *  b
[static]
 

int LookupWord char *  buff  )  [static]
 

int ToHour int  Hours,
MERIDIAN  Meridian
[static]
 

int ToYear int  Year  )  [static]
 

int yyerror char *  s  )  [static]
 

int yylex void   )  [static]
 

int yyparse void   ) 
 


Variable Documentation

TABLE const MilitaryTable[] [static]
 

Initial value:

 {
    { "a",  tZONE,  HOUR (  1) },
    { "b",  tZONE,  HOUR (  2) },
    { "c",  tZONE,  HOUR (  3) },
    { "d",  tZONE,  HOUR (  4) },
    { "e",  tZONE,  HOUR (  5) },
    { "f",  tZONE,  HOUR (  6) },
    { "g",  tZONE,  HOUR (  7) },
    { "h",  tZONE,  HOUR (  8) },
    { "i",  tZONE,  HOUR (  9) },
    { "k",  tZONE,  HOUR ( 10) },
    { "l",  tZONE,  HOUR ( 11) },
    { "m",  tZONE,  HOUR ( 12) },
    { "n",  tZONE,  HOUR (- 1) },
    { "o",  tZONE,  HOUR (- 2) },
    { "p",  tZONE,  HOUR (- 3) },
    { "q",  tZONE,  HOUR (- 4) },
    { "r",  tZONE,  HOUR (- 5) },
    { "s",  tZONE,  HOUR (- 6) },
    { "t",  tZONE,  HOUR (- 7) },
    { "u",  tZONE,  HOUR (- 8) },
    { "v",  tZONE,  HOUR (- 9) },
    { "w",  tZONE,  HOUR (-10) },
    { "x",  tZONE,  HOUR (-11) },
    { "y",  tZONE,  HOUR (-12) },
    { "z",  tZONE,  HOUR (  0) },
    { NULL, 0,  0 }
}

TABLE const MonthDayTable[] [static]
 

Initial value:

 {
    { "january",    tMONTH,  1 },
    { "february",   tMONTH,  2 },
    { "march",      tMONTH,  3 },
    { "april",      tMONTH,  4 },
    { "may",        tMONTH,  5 },
    { "june",       tMONTH,  6 },
    { "july",       tMONTH,  7 },
    { "august",     tMONTH,  8 },
    { "september",  tMONTH,  9 },
    { "sept",       tMONTH,  9 },
    { "october",    tMONTH, 10 },
    { "november",   tMONTH, 11 },
    { "december",   tMONTH, 12 },
    { "sunday",     tDAY, 0 },
    { "monday",     tDAY, 1 },
    { "tuesday",    tDAY, 2 },
    { "tues",       tDAY, 2 },
    { "wednesday",  tDAY, 3 },
    { "wednes",     tDAY, 3 },
    { "thursday",   tDAY, 4 },
    { "thur",       tDAY, 4 },
    { "thurs",      tDAY, 4 },
    { "friday",     tDAY, 5 },
    { "saturday",   tDAY, 6 },
    { NULL,     0, 0 }
}

TABLE const OtherTable[] [static]
 

Initial value:

 {
    { "tomorrow",   tMINUTE_UNIT,   1 * 24 * 60 },
    { "yesterday",  tMINUTE_UNIT,   -1 * 24 * 60 },
    { "today",      tMINUTE_UNIT,   0 },
    { "now",        tMINUTE_UNIT,   0 },
    { "last",       tUNUMBER,   -1 },
    { "this",       tMINUTE_UNIT,   0 },
    { "next",       tUNUMBER,   2 },
    { "first",      tUNUMBER,   1 },

    { "third",      tUNUMBER,   3 },
    { "fourth",     tUNUMBER,   4 },
    { "fifth",      tUNUMBER,   5 },
    { "sixth",      tUNUMBER,   6 },
    { "seventh",    tUNUMBER,   7 },
    { "eighth",     tUNUMBER,   8 },
    { "ninth",      tUNUMBER,   9 },
    { "tenth",      tUNUMBER,   10 },
    { "eleventh",   tUNUMBER,   11 },
    { "twelfth",    tUNUMBER,   12 },
    { "ago",        tAGO,   1 },
    { NULL,     0,  0 }
}

TABLE const TimezoneTable[] [static]
 

TABLE const UnitsTable[] [static]
 

Initial value:

 {
    { "year",       tYEAR_UNIT, 1 },
    { "month",      tMONTH_UNIT,    1 },
    { "fortnight",  tDAY_UNIT,  14 },
    { "week",       tDAY_UNIT,  7 },
    { "day",        tDAY_UNIT,  1 },
    { "hour",       tHOUR_UNIT, 1 },
    { "minute",     tMINUTE_UNIT,   1 },
    { "min",        tMINUTE_UNIT,   1 },
    { "second",     tSEC_UNIT,  1 },
    { "sec",        tSEC_UNIT,  1 },
    { NULL,     0,      0 }
}

int yychar
 

short yycheck[]
 

int yyDay [static]
 

int yyDayNumber [static]
 

int yyDayOrdinal [static]
 

int yydebug
 

short yydefred[]
 

Initial value:

 {                                      1,
    0,    0,   43,   18,   46,   49,    0,   40,   52,    0,
    0,   37,    0,    2,    3,    4,    5,    6,    7,    8,
    0,   22,    0,   42,   45,   48,   39,   51,   36,   23,
   41,   44,    9,   47,    0,   38,   50,    0,   35,    0,
    0,   19,   33,    0,   28,   32,   26,   27,    0,    0,
   30,   55,   11,    0,   10,    0,    0,    0,   25,    0,
   12,   13,    0,    0,    0,   15,   20,
}

short yydgoto[]
 

Initial value:

 {                                       1,
   55,   14,   15,   16,   17,   18,   19,   20,   62,   21,
}

int yyerrflag
 

short yygindex[]
 

Initial value:

 {                                      0,
  -12,    0,    0,    0,    0,    0,    0,    0,  -15,    0,
}

int yyHaveDate [static]
 

int yyHaveDay [static]
 

int yyHaveRel [static]
 

int yyHaveTime [static]
 

int yyHaveZone [static]
 

int yyHour [static]
 

const unsigned char* yyInput [static]
 

short yylen[]
 

Initial value:

 {                                         2,
    0,    2,    1,    1,    1,    1,    1,    1,    2,    4,
    4,    6,    6,    6,    7,    6,    1,    1,    2,    3,
    1,    2,    2,    3,    5,    3,    3,    3,    2,    4,
    2,    3,    2,    1,    2,    2,    1,    2,    2,    1,
    2,    2,    1,    2,    2,    1,    2,    2,    1,    2,
    2,    1,    1,    0,    1,
}

short yylhs[]
 

Initial value:

 {                                        -1,
    0,    0,    2,    2,    2,    2,    2,    2,    3,    3,
    3,    3,    3,    3,    3,    3,    4,    4,    4,    9,
    6,    6,    6,    5,    5,    5,    5,    5,    5,    5,
    5,    5,    7,    7,   10,   10,   10,   10,   10,   10,
   10,   10,   10,   10,   10,   10,   10,   10,   10,   10,
   10,   10,    8,    1,    1,
}

YYSTYPE yylval
 

MERIDIAN yyMeridian [static]
 

int yyMinutes [static]
 

int yyMonth [static]
 

int yynerrs
 

int yyRelDay [static]
 

int yyRelHour [static]
 

int yyRelMinutes [static]
 

int yyRelMonth [static]
 

int yyRelSeconds [static]
 

int yyRelYear [static]
 

short yyrindex[]
 

Initial value:

 {                                      0,
    0,    1,    0,    0,    0,    0,    0,    0,    0,    0,
  124,    0,   16,    0,    0,    0,    0,    0,    0,    0,
   31,    0,   46,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0,  121,    0,    0,    0,    0,    0,
    0,    0,    0,    0,    0,    0,    0,    0,   91,   61,
    0,    0,    0,    0,    0,    0,   91,    0,    0,   76,
    0,    0,  106,    0,    0,    0,    0,
}

char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91" [static]
 

int yySeconds [static]
 

short yysindex[]
 

Initial value:

 {                                      0,
 -245,  -40,    0,    0,    0,    0, -260,    0,    0, -230,
  -47,    0, -249,    0,    0,    0,    0,    0,    0,    0,
 -239,    0,  -25,    0,    0,    0,    0,    0,    0,    0,
    0,    0,    0,    0, -263,    0,    0, -264,    0, -242,
 -237,    0,    0, -234,    0,    0,    0,    0,  -56,   -8,
    0,    0,    0, -240,    0, -228, -261, -227,    0,  -18,
    0,    0, -225, -223,  -18,    0,    0,
}

short yyss[YYSTACKSIZE]
 

short* yyssp
 

short yytable[]
 

int yyTimezone [static]
 

YYSTYPE yyval
 

YYSTYPE yyvs[YYSTACKSIZE]
 

YYSTYPE* yyvsp
 

int yyYear [static]
 


Generated on Sun Feb 12 10:50:01 2006 for Gtk-Gnutella by doxygen 1.3.6