* More SMTP implementation
[citadel.git] / citadel / parsedate.y
index e167f59b73ec9d93d9e5f4e60217442a41572474..5663c6d21fe285aa5573389fb64a13fc6aa82831 100644 (file)
@@ -7,7 +7,8 @@
 **  <rsalz@osf.org> and Jim Berets <jberets@bbn.com> in August, 1990.
 **  Further revised (removed obsolete constructs and cleaned up timezone
 **  names) in August, 1991, by Rich.  Paul Eggert <eggert@twinsun.com>
-**  helped in September, 1992.
+**  helped in September, 1992.  Art Cancro <ajc@uncnsrd.mt-kisco.ny.us> cleaned
+**  it up for ANSI C in December, 1999.
 **
 **  This grammar has six shift/reduce conflicts.
 **
@@ -22,7 +23,7 @@
 #include <ctype.h>
 #include <time.h>
 
-int date_lex();
+int date_lex(void);
 
 #define yyparse                date_parse
 #define yylex          date_lex
@@ -92,9 +93,7 @@ static time_t yyRelMonth;
 static time_t  yyRelSeconds;
 
 
-extern struct tm       *localtime();
-
-static void            date_error();
+static void            date_error(char *);
 %}
 
 %union {
@@ -446,11 +445,7 @@ date_error(s)
 
 
 static time_t
-ToSeconds(Hours, Minutes, Seconds, Meridian)
-    time_t     Hours;
-    time_t     Minutes;
-    time_t     Seconds;
-    MERIDIAN   Meridian;
+ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian)
 {
     if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 61)
        return -1;
@@ -471,15 +466,9 @@ ToSeconds(Hours, Minutes, Seconds, Meridian)
 
 
 static time_t
-Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst)
-    time_t     Month;
-    time_t     Day;
-    time_t     Year;
-    time_t     Hours;
-    time_t     Minutes;
-    time_t     Seconds;
-    MERIDIAN   Meridian;
-    DSTMODE    dst;
+Convert(time_t Month, time_t Day, time_t Year,
+       time_t Hours, time_t Minutes, time_t Seconds,
+       MERIDIAN Meridian, DSTMODE dst)
 {
     static int DaysNormal[13] = {
        0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
@@ -533,9 +522,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, dst)
 
 
 static time_t
-DSTcorrect(Start, Future)
-    time_t     Start;
-    time_t     Future;
+DSTcorrect(time_t Start, time_t Future)
 {
     time_t     StartDay;
     time_t     FutureDay;
@@ -547,9 +534,7 @@ DSTcorrect(Start, Future)
 
 
 static time_t
-RelativeMonth(Start, RelMonth)
-    time_t     Start;
-    time_t     RelMonth;
+RelativeMonth(time_t Start, time_t RelMonth)
 {
     struct tm  *tm;
     time_t     Month;
@@ -567,9 +552,7 @@ RelativeMonth(Start, RelMonth)
 
 
 static int
-LookupWord(buff, length)
-    char               *buff;
-    register int       length;
+LookupWord(char *buff, register int length)
 {
     register char      *p;
     register char      *q;
@@ -659,7 +642,7 @@ LookupWord(buff, length)
 
 
 int
-date_lex()
+date_lex(void)
 {
     register char      c;
     register char      *p;
@@ -722,10 +705,9 @@ date_lex()
 
 
 time_t
-parsedate(p)
-    char               *p;
+parsedate(char *p)
 {
-    extern int         date_parse();
+    extern int         date_parse(void);
     time_t             Start;
 
     yyInput = p;
@@ -775,9 +757,7 @@ extern int  yydebug;
 
 /* ARGSUSED */
 int
-main(ac, av)
-    int                ac;
-    char       *av[];
+main(int ac, char *av[])
 {
     char       buff[128];
     time_t     d;