From 00e9b04664bf2e5a36da9308482569986b191cbd Mon Sep 17 00:00:00 2001 From: cognet Date: Sun, 9 May 2004 22:29:00 +0000 Subject: 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. --- usr.sbin/config/config.y | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'usr.sbin/config/config.y') 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 ID %token 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 -- cgit v1.1