summaryrefslogtreecommitdiffstats
path: root/cmd-set-hook.c
diff options
context:
space:
mode:
authornicm <nicm>2016-10-16 19:04:05 +0000
committernicm <nicm>2016-10-16 19:04:05 +0000
commitb342bd0b462f69a9fc9a59d52bcd4bb34b57114f (patch)
tree2da71181e3b540b8b52422cb598682f1505c2e89 /cmd-set-hook.c
parentddc4512d2e0eda6c705e002cb5dbf80719d709e1 (diff)
Mass rename struct cmd_q to struct cmdq_item and related.
Diffstat (limited to 'cmd-set-hook.c')
-rw-r--r--cmd-set-hook.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/cmd-set-hook.c b/cmd-set-hook.c
index e4d4669c..2685fc8d 100644
--- a/cmd-set-hook.c
+++ b/cmd-set-hook.c
@@ -27,7 +27,7 @@
* Set or show global or session hooks.
*/
-static enum cmd_retval cmd_set_hook_exec(struct cmd *, struct cmd_q *);
+static enum cmd_retval cmd_set_hook_exec(struct cmd *, struct cmdq_item *);
const struct cmd_entry cmd_set_hook_entry = {
.name = "set-hook",
@@ -56,7 +56,7 @@ const struct cmd_entry cmd_show_hooks_entry = {
};
static enum cmd_retval
-cmd_set_hook_exec(struct cmd *self, struct cmd_q *cmdq)
+cmd_set_hook_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = self->args;
struct cmd_list *cmdlist;
@@ -68,22 +68,22 @@ cmd_set_hook_exec(struct cmd *self, struct cmd_q *cmdq)
if (args_has(args, 'g'))
hooks = global_hooks;
else {
- if (cmdq->state.tflag.s == NULL) {
+ if (item->state.tflag.s == NULL) {
target = args_get(args, 't');
if (target != NULL)
- cmdq_error(cmdq, "no such session: %s", target);
+ cmdq_error(item, "no such session: %s", target);
else
- cmdq_error(cmdq, "no current session");
+ cmdq_error(item, "no current session");
return (CMD_RETURN_ERROR);
}
- hooks = cmdq->state.tflag.s->hooks;
+ hooks = item->state.tflag.s->hooks;
}
if (self->entry == &cmd_show_hooks_entry) {
hook = hooks_first(hooks);
while (hook != NULL) {
tmp = cmd_list_print(hook->cmdlist);
- cmdq_print(cmdq, "%s -> %s", hook->name, tmp);
+ cmdq_print(item, "%s -> %s", hook->name, tmp);
free(tmp);
hook = hooks_next(hook);
@@ -93,7 +93,7 @@ cmd_set_hook_exec(struct cmd *self, struct cmd_q *cmdq)
name = args->argv[0];
if (*name == '\0') {
- cmdq_error(cmdq, "invalid hook name");
+ cmdq_error(item, "invalid hook name");
return (CMD_RETURN_ERROR);
}
if (args->argc < 2)
@@ -103,7 +103,7 @@ cmd_set_hook_exec(struct cmd *self, struct cmd_q *cmdq)
if (args_has(args, 'u')) {
if (cmd != NULL) {
- cmdq_error(cmdq, "command passed to unset hook: %s",
+ cmdq_error(item, "command passed to unset hook: %s",
name);
return (CMD_RETURN_ERROR);
}
@@ -112,12 +112,12 @@ cmd_set_hook_exec(struct cmd *self, struct cmd_q *cmdq)
}
if (cmd == NULL) {
- cmdq_error(cmdq, "no command to set hook: %s", name);
+ cmdq_error(item, "no command to set hook: %s", name);
return (CMD_RETURN_ERROR);
}
if (cmd_string_parse(cmd, &cmdlist, NULL, 0, &cause) != 0) {
if (cause != NULL) {
- cmdq_error(cmdq, "%s", cause);
+ cmdq_error(item, "%s", cause);
free(cause);
}
return (CMD_RETURN_ERROR);