diff options
author | cognet <cognet@FreeBSD.org> | 2004-05-09 22:29:00 +0000 |
---|---|---|
committer | cognet <cognet@FreeBSD.org> | 2004-05-09 22:29:00 +0000 |
commit | 00e9b04664bf2e5a36da9308482569986b191cbd (patch) | |
tree | 73af9718cbffc98607a761e30d746e77607e3639 /usr.sbin/config/config.y | |
parent | 7d1143b1dd32ee8be2ba15b806cf64b01a6053ff (diff) | |
download | FreeBSD-src-00e9b04664bf2e5a36da9308482569986b191cbd.zip FreeBSD-src-00e9b04664bf2e5a36da9308482569986b191cbd.tar.gz |
Add a new "files" directive, which allows to include a files.foo file directly
from a kernel config file.
Bump config version to reflect this change.
Diffstat (limited to 'usr.sbin/config/config.y')
-rw-r--r-- | usr.sbin/config/config.y | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y index 0ee7f28..d16982a 100644 --- a/usr.sbin/config/config.y +++ b/usr.sbin/config/config.y @@ -22,6 +22,7 @@ %token NOMAKEOPTION %token SEMICOLON %token INCLUDE +%token FILES %token <str> ID %token <val> NUMBER @@ -84,6 +85,7 @@ int hintmode; int yyline; const char *yyfile; struct file_list_head ftab; +struct files_name_head fntab; char errbuf[80]; int maxusers; @@ -121,6 +123,9 @@ Spec: INCLUDE ID SEMICOLON = { include($2, 0); }; | + FILES ID SEMICOLON + = { newfile($2); }; + | SEMICOLON | error SEMICOLON @@ -276,6 +281,20 @@ yyerror(const char *s) } /* + * Add a new file to the list of files. + */ +static void +newfile(char *name) +{ + struct files_name *nl; + + nl = (struct files_name *) malloc(sizeof *nl); + bzero(nl, sizeof *nl); + nl->f_name = name; + STAILQ_INSERT_TAIL(&fntab, nl, f_next); +} + +/* * add a device to the list of devices */ static void |