diff options
author | Thomas Adam <thomas@xteddy.org> | 2016-10-16 22:01:14 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2016-10-16 22:01:14 +0100 |
commit | 1a6e696b08113ca17ee8e881844167cf94276846 (patch) | |
tree | 60ecdd8c9e51bff46624e48d9373686b858d2fb1 /cfg.c | |
parent | d401340c516131ae8e07bfb978b670347486d077 (diff) | |
parent | d15d54c2c8e6b95695169442eb2a27d814efc078 (diff) |
Merge branch 'obsd-master'
Diffstat (limited to 'cfg.c')
-rw-r--r-- | cfg.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -34,7 +34,7 @@ static u_int cfg_ncauses; struct client *cfg_client; static enum cmd_retval -cfg_done(__unused struct cmd_q *cmdq, __unused void *data) +cfg_done(__unused struct cmdq_item *item, __unused void *data) { if (cfg_finished) return (CMD_RETURN_NORMAL); @@ -78,15 +78,15 @@ start_cfg(void) } int -load_cfg(const char *path, struct client *c, struct cmd_q *cmdq, int quiet) +load_cfg(const char *path, struct client *c, struct cmdq_item *item, int quiet) { - FILE *f; - char delim[3] = { '\\', '\\', '\0' }; - u_int found; - size_t line = 0; - char *buf, *cause1, *p; - struct cmd_list *cmdlist; - struct cmd_q *new_cmdq; + FILE *f; + char delim[3] = { '\\', '\\', '\0' }; + u_int found; + size_t line = 0; + char *buf, *cause1, *p; + struct cmd_list *cmdlist; + struct cmdq_item *new_item; log_debug("loading %s", path); if ((f = fopen(path, "rb")) == NULL) { @@ -122,11 +122,11 @@ load_cfg(const char *path, struct client *c, struct cmd_q *cmdq, int quiet) if (cmdlist == NULL) continue; - new_cmdq = cmdq_get_command(cmdlist, NULL, NULL, 0); - if (cmdq != NULL) - cmdq_insert_after(cmdq, new_cmdq); + new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); + if (item != NULL) + cmdq_insert_after(item, new_item); else - cmdq_append(c, new_cmdq); + cmdq_append(c, new_item); cmd_list_free(cmdlist); found++; @@ -152,12 +152,12 @@ cfg_add_cause(const char *fmt, ...) } void -cfg_print_causes(struct cmd_q *cmdq) +cfg_print_causes(struct cmdq_item *item) { u_int i; for (i = 0; i < cfg_ncauses; i++) { - cmdq_print(cmdq, "%s", cfg_causes[i]); + cmdq_print(item, "%s", cfg_causes[i]); free(cfg_causes[i]); } |