summaryrefslogtreecommitdiffstats
path: root/conf/confbase.Y
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-03-01 12:42:13 +0100
committerMartin Mares <mj@ucw.cz>2000-03-01 12:42:13 +0100
commitaee539f241dd233eb9e716e11ee2c449ab482a75 (patch)
tree4e3ca622427a69ef1f4e8a4f21c1803d9c804070 /conf/confbase.Y
parentdb1326aa5e39711d88d305ac08a0afa137ab77f0 (diff)
downloadbird-aee539f241dd233eb9e716e11ee2c449ab482a75.tar
bird-aee539f241dd233eb9e716e11ee2c449ab482a75.zip
Made `datetime' more user friendly. Now it should be a quoted string
of type "dd-mm-yyyy".
Diffstat (limited to 'conf/confbase.Y')
-rw-r--r--conf/confbase.Y14
1 files changed, 10 insertions, 4 deletions
diff --git a/conf/confbase.Y b/conf/confbase.Y
index 49d3b12..ba60fb2 100644
--- a/conf/confbase.Y
+++ b/conf/confbase.Y
@@ -1,7 +1,7 @@
/*
* BIRD -- Configuration Parser Top
*
- * (c) 1998--1999 Martin Mares <mj@ucw.cz>
+ * (c) 1998--2000 Martin Mares <mj@ucw.cz>
*
* Can be freely distributed and used under the terms of the GNU GPL.
*/
@@ -37,6 +37,7 @@ CF_DECLS
struct password_item *p;
struct rt_show_data *ra;
void *g;
+ bird_clock_t time;
}
%token END CLI_MARKER INVALID_TOKEN
@@ -46,7 +47,8 @@ CF_DECLS
%token <s> SYM
%token <t> TEXT
-%type <i> expr bool pxlen datetime
+%type <i> expr bool pxlen
+%type <time> datetime
%nonassoc '=' '<' '>' '~' '.'
%left '+' '-'
@@ -115,8 +117,12 @@ pxlen:
}
;
-datetime: /* Return seconds from epoch, FIXME we want be more user friendly */
- NUM { $$ = $1; }
+datetime: /* Return seconds from epoch, FIXME we want be more user friendly */
+ TEXT {
+ $$ = tm_parse_date($1);
+ if (!$$)
+ cf_error("Invalid date");
+ }
;
CF_CODE