version 1.86, 2022/06/20 07:59:37 |
version 1.87, 2023/09/15 06:31:49 |
|
|
{ |
{ |
struct client *c; |
struct client *c; |
u_int i; |
u_int i; |
|
int flags = 0; |
|
|
/* |
/* |
* Configuration files are loaded without a client, so commands are run |
* Configuration files are loaded without a client, so commands are run |
|
|
cmdq_append(c, cfg_item); |
cmdq_append(c, cfg_item); |
} |
} |
|
|
for (i = 0; i < cfg_nfiles; i++) { |
if (cfg_quiet) |
if (cfg_quiet) |
flags = CMD_PARSE_QUIET; |
load_cfg(cfg_files[i], c, NULL, CMD_PARSE_QUIET, NULL); |
for (i = 0; i < cfg_nfiles; i++) |
else |
load_cfg(cfg_files[i], c, NULL, NULL, flags, NULL); |
load_cfg(cfg_files[i], c, NULL, 0, NULL); |
|
} |
|
|
|
cmdq_append(NULL, cmdq_get_callback(cfg_done, NULL)); |
cmdq_append(NULL, cmdq_get_callback(cfg_done, NULL)); |
} |
} |
|
|
int |
int |
load_cfg(const char *path, struct client *c, struct cmdq_item *item, int flags, |
load_cfg(const char *path, struct client *c, struct cmdq_item *item, |
struct cmdq_item **new_item) |
struct cmd_find_state *current, int flags, struct cmdq_item **new_item) |
{ |
{ |
FILE *f; |
FILE *f; |
struct cmd_parse_input pi; |
struct cmd_parse_input pi; |
|
|
} |
} |
|
|
if (item != NULL) |
if (item != NULL) |
state = cmdq_copy_state(cmdq_get_state(item)); |
state = cmdq_copy_state(cmdq_get_state(item), current); |
else |
else |
state = cmdq_new_state(NULL, NULL, 0); |
state = cmdq_new_state(NULL, NULL, 0); |
cmdq_add_format(state, "current_file", "%s", pi.file); |
cmdq_add_format(state, "current_file", "%s", pi.file); |
|
|
|
|
int |
int |
load_cfg_from_buffer(const void *buf, size_t len, const char *path, |
load_cfg_from_buffer(const void *buf, size_t len, const char *path, |
struct client *c, struct cmdq_item *item, int flags, |
struct client *c, struct cmdq_item *item, struct cmd_find_state *current, |
struct cmdq_item **new_item) |
int flags, struct cmdq_item **new_item) |
{ |
{ |
struct cmd_parse_input pi; |
struct cmd_parse_input pi; |
struct cmd_parse_result *pr; |
struct cmd_parse_result *pr; |
|
|
} |
} |
|
|
if (item != NULL) |
if (item != NULL) |
state = cmdq_copy_state(cmdq_get_state(item)); |
state = cmdq_copy_state(cmdq_get_state(item), current); |
else |
else |
state = cmdq_new_state(NULL, NULL, 0); |
state = cmdq_new_state(NULL, NULL, 0); |
cmdq_add_format(state, "current_file", "%s", pi.file); |
cmdq_add_format(state, "current_file", "%s", pi.file); |