Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/config/config.y
Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | |||||
#include <err.h> | #include <err.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "config.h" | #include "config.h" | ||||
struct device_head dtab; | struct device_head dtab; | ||||
char *ident; | char *ident; | ||||
int envmode; | char *env; | ||||
int hintmode; | |||||
int yyline; | int yyline; | ||||
const char *yyfile; | const char *yyfile; | ||||
struct file_list_head ftab; | struct file_list_head ftab; | ||||
struct files_name_head fntab; | struct files_name_head fntab; | ||||
char errbuf[80]; | char errbuf[80]; | ||||
int maxusers; | int maxusers; | ||||
#define ns(s) strdup(s) | #define ns(s) strdup(s) | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | Config_spec: | ||||
HINTS ID { | HINTS ID { | ||||
struct hint *hint; | struct hint *hint; | ||||
hint = (struct hint *)calloc(1, sizeof (struct hint)); | hint = (struct hint *)calloc(1, sizeof (struct hint)); | ||||
if (hint == NULL) | if (hint == NULL) | ||||
err(EXIT_FAILURE, "calloc"); | err(EXIT_FAILURE, "calloc"); | ||||
hint->hint_name = $2; | hint->hint_name = $2; | ||||
STAILQ_INSERT_HEAD(&hints, hint, hint_next); | STAILQ_INSERT_HEAD(&hints, hint, hint_next); | ||||
hintmode = 1; | |||||
} | } | ||||
System_spec: | System_spec: | ||||
CONFIG System_id System_parameter_list { | CONFIG System_id System_parameter_list { | ||||
errx(1, "%s:%d: root/dump/swap specifications obsolete", | errx(1, "%s:%d: root/dump/swap specifications obsolete", | ||||
yyfile, yyline); | yyfile, yyline); | ||||
} | } | ||||
| | | | ||||
▲ Show 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | newenvvar(char *name, bool is_file) | ||||
struct envvar *envvar; | struct envvar *envvar; | ||||
envvar = (struct envvar *)calloc(1, sizeof (struct envvar)); | envvar = (struct envvar *)calloc(1, sizeof (struct envvar)); | ||||
if (envvar == NULL) | if (envvar == NULL) | ||||
err(EXIT_FAILURE, "calloc"); | err(EXIT_FAILURE, "calloc"); | ||||
envvar->env_str = name; | envvar->env_str = name; | ||||
envvar->env_is_file = is_file; | envvar->env_is_file = is_file; | ||||
STAILQ_INSERT_HEAD(&envvars, envvar, envvar_next); | STAILQ_INSERT_HEAD(&envvars, envvar, envvar_next); | ||||
envmode = 1; | |||||
} | } | ||||
/* | /* | ||||
* Find a device in the list of devices. | * Find a device in the list of devices. | ||||
*/ | */ | ||||
static struct device * | static struct device * | ||||
finddev(struct device_head *dlist, char *name) | finddev(struct device_head *dlist, char *name) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 113 Lines • Show Last 20 Lines |