diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-03 00:19:24 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2010-02-03 00:19:24 +0100 |
commit | c37e78510f2ac4d9bb4c44eddf33352eda72fd0f (patch) | |
tree | 82153f7a851aeeaf6999ee59b3bd18ebbc761254 /sysdep/unix/config.Y | |
parent | 44f26560ec9f108039e6736d6de929f899bf20ea (diff) |
Makes date/time formats configurable.
Diffstat (limited to 'sysdep/unix/config.Y')
-rw-r--r-- | sysdep/unix/config.Y | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sysdep/unix/config.Y b/sysdep/unix/config.Y index 46c5862b..8c2b6903 100644 --- a/sysdep/unix/config.Y +++ b/sysdep/unix/config.Y @@ -14,10 +14,12 @@ CF_HDR CF_DECLS CF_KEYWORDS(LOG, SYSLOG, ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG, STDERR, SOFT) +CF_KEYWORDS(TIMEFORMAT, ISO, SHORT, LONG, BASE) %type <i> log_mask log_mask_list log_cat %type <g> log_file %type <t> cfg_name +%type <tf> timeformat_which CF_GRAMMAR @@ -75,7 +77,24 @@ mrtdump_base: } ; +CF_ADDTO(conf, timeformat_base) +timeformat_which: + ROUTE { $$ = &new_config->tf_route; } + | PROTOCOL { $$ = &new_config->tf_proto; } + | BASE { $$ = &new_config->tf_base; } + | LOG { $$ = &new_config->tf_log; } + +timeformat_spec: + timeformat_which TEXT { *$1 = (struct timeformat){$2, NULL, 0}; } + | timeformat_which TEXT expr TEXT { *$1 = (struct timeformat){$2, $4, $3}; } + | timeformat_which ISO SHORT { *$1 = (struct timeformat){"%T", "%F", 20*3600}; } + | timeformat_which ISO LONG { *$1 = (struct timeformat){"%F %T", NULL, 0}; } + ; + +timeformat_base: + TIMEFORMAT timeformat_spec ';' + ; /* Unix specific commands */ |