| 85 |
|
extern char conffilebuf[IRCD_BUFSIZE]; |
| 86 |
|
extern char yytext[]; |
| 87 |
|
extern int yyparse(); /* defined in y.tab.c */ |
| 88 |
< |
int ypass = 1; /* used by yyparse() */ |
| 88 |
> |
|
| 89 |
> |
struct conf_parser_context conf_parser_ctx = { 0, 0, NULL }; |
| 90 |
|
|
| 91 |
|
/* internally defined functions */ |
| 92 |
|
static void lookup_confhost(struct ConfItem *); |
| 115 |
|
|
| 116 |
|
static void flags_to_ascii(unsigned int, const unsigned int[], char *, int); |
| 117 |
|
|
| 117 |
– |
FBFILE *conf_fbfile_in = NULL; |
| 118 |
– |
|
| 118 |
|
/* address of default class conf */ |
| 119 |
|
static struct ConfItem *class_default; |
| 120 |
|
|
| 1948 |
|
lineno = 0; |
| 1949 |
|
|
| 1950 |
|
set_default_conf(); /* Set default values prior to conf parsing */ |
| 1951 |
< |
ypass = 1; |
| 1951 |
> |
conf_parser_ctx.pass = 1; |
| 1952 |
|
yyparse(); /* pick up the classes first */ |
| 1953 |
|
|
| 1954 |
|
fbrewind(file); |
| 1955 |
|
|
| 1956 |
< |
ypass = 2; |
| 1956 |
> |
conf_parser_ctx.pass = 2; |
| 1957 |
|
yyparse(); /* Load the values from the conf */ |
| 1958 |
|
validate_conf(); /* Check to make sure some values are still okay. */ |
| 1959 |
|
/* Some global values are also loaded here. */ |
| 2425 |
|
char chanmodes[32]; |
| 2426 |
|
char chanlimit[32]; |
| 2427 |
|
|
| 2428 |
+ |
conf_parser_ctx.boot = cold; |
| 2429 |
|
filename = get_conf_name(CONF_TYPE); |
| 2430 |
|
|
| 2431 |
|
/* We need to know the initial filename for the yyerror() to report |
| 2436 |
|
*/ |
| 2437 |
|
strlcpy(conffilebuf, filename, sizeof(conffilebuf)); |
| 2438 |
|
|
| 2439 |
< |
if ((conf_fbfile_in = fbopen(filename, "r")) == NULL) |
| 2439 |
> |
if ((conf_parser_ctx.conf_file = fbopen(filename, "r")) == NULL) |
| 2440 |
|
{ |
| 2441 |
|
if (cold) |
| 2442 |
|
{ |
| 2456 |
|
if (!cold) |
| 2457 |
|
clear_out_old_conf(); |
| 2458 |
|
|
| 2459 |
< |
read_conf(conf_fbfile_in); |
| 2460 |
< |
fbclose(conf_fbfile_in); |
| 2459 |
> |
read_conf(conf_parser_ctx.conf_file); |
| 2460 |
> |
fbclose(conf_parser_ctx.conf_file); |
| 2461 |
|
|
| 2462 |
|
add_isupport("NETWORK", ServerInfo.network_name, -1); |
| 2463 |
|
ircsprintf(chanmodes, "b%s%s:%d", ConfigChannel.use_except ? "e" : "", |
| 3122 |
|
{ |
| 3123 |
|
char newlinebuf[IRCD_BUFSIZE]; |
| 3124 |
|
|
| 3125 |
< |
if (ypass != 1) |
| 3125 |
> |
if (conf_parser_ctx.pass != 1) |
| 3126 |
|
return; |
| 3127 |
|
|
| 3128 |
|
strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf)); |