summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-bind-key.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-10-16 19:04:05 +0000
committernicm <nicm@openbsd.org>2016-10-16 19:04:05 +0000
commit68e0a7f271bc1c08e58a23a65844d346c6665089 (patch)
tree315962d2740c0dca5e710bb5c9db0ac9878f55ba /usr.bin/tmux/cmd-bind-key.c
parentReplace fs/msdosfs/{msdosfs_conv.c,direntry.h} with stripped-down (diff)
downloadwireguard-openbsd-68e0a7f271bc1c08e58a23a65844d346c6665089.tar.xz
wireguard-openbsd-68e0a7f271bc1c08e58a23a65844d346c6665089.zip
Mass rename struct cmd_q to struct cmdq_item and related.
Diffstat (limited to 'usr.bin/tmux/cmd-bind-key.c')
-rw-r--r--usr.bin/tmux/cmd-bind-key.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/usr.bin/tmux/cmd-bind-key.c b/usr.bin/tmux/cmd-bind-key.c
index 001b47b3811..31ba085b483 100644
--- a/usr.bin/tmux/cmd-bind-key.c
+++ b/usr.bin/tmux/cmd-bind-key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-bind-key.c,v 1.30 2016/10/14 22:14:22 nicm Exp $ */
+/* $OpenBSD: cmd-bind-key.c,v 1.31 2016/10/16 19:04:05 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -27,10 +27,10 @@
* Bind a key to a command, this recurses through cmd_*.
*/
-static enum cmd_retval cmd_bind_key_exec(struct cmd *, struct cmd_q *);
+static enum cmd_retval cmd_bind_key_exec(struct cmd *, struct cmdq_item *);
-static enum cmd_retval cmd_bind_key_mode_table(struct cmd *, struct cmd_q *,
- key_code);
+static enum cmd_retval cmd_bind_key_mode_table(struct cmd *,
+ struct cmdq_item *, key_code);
const struct cmd_entry cmd_bind_key_entry = {
.name = "bind-key",
@@ -45,7 +45,7 @@ const struct cmd_entry cmd_bind_key_entry = {
};
static enum cmd_retval
-cmd_bind_key_exec(struct cmd *self, struct cmd_q *cmdq)
+cmd_bind_key_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = self->args;
char *cause;
@@ -55,24 +55,24 @@ cmd_bind_key_exec(struct cmd *self, struct cmd_q *cmdq)
if (args_has(args, 't')) {
if (args->argc != 2 && args->argc != 3) {
- cmdq_error(cmdq, "not enough arguments");
+ cmdq_error(item, "not enough arguments");
return (CMD_RETURN_ERROR);
}
} else {
if (args->argc < 2) {
- cmdq_error(cmdq, "not enough arguments");
+ cmdq_error(item, "not enough arguments");
return (CMD_RETURN_ERROR);
}
}
key = key_string_lookup_string(args->argv[0]);
if (key == KEYC_NONE || key == KEYC_UNKNOWN) {
- cmdq_error(cmdq, "unknown key: %s", args->argv[0]);
+ cmdq_error(item, "unknown key: %s", args->argv[0]);
return (CMD_RETURN_ERROR);
}
if (args_has(args, 't'))
- return (cmd_bind_key_mode_table(self, cmdq, key));
+ return (cmd_bind_key_mode_table(self, item, key));
if (args_has(args, 'T'))
tablename = args_get(args, 'T');
@@ -84,7 +84,7 @@ cmd_bind_key_exec(struct cmd *self, struct cmd_q *cmdq)
cmdlist = cmd_list_parse(args->argc - 1, args->argv + 1, NULL, 0,
&cause);
if (cmdlist == NULL) {
- cmdq_error(cmdq, "%s", cause);
+ cmdq_error(item, "%s", cause);
free(cause);
return (CMD_RETURN_ERROR);
}
@@ -94,7 +94,7 @@ cmd_bind_key_exec(struct cmd *self, struct cmd_q *cmdq)
}
static enum cmd_retval
-cmd_bind_key_mode_table(struct cmd *self, struct cmd_q *cmdq, key_code key)
+cmd_bind_key_mode_table(struct cmd *self, struct cmdq_item *item, key_code key)
{
struct args *args = self->args;
const char *tablename;
@@ -104,18 +104,18 @@ cmd_bind_key_mode_table(struct cmd *self, struct cmd_q *cmdq, key_code key)
tablename = args_get(args, 't');
if ((mtab = mode_key_findtable(tablename)) == NULL) {
- cmdq_error(cmdq, "unknown key table: %s", tablename);
+ cmdq_error(item, "unknown key table: %s", tablename);
return (CMD_RETURN_ERROR);
}
cmd = mode_key_fromstring(mtab->cmdstr, args->argv[1]);
if (cmd == MODEKEY_NONE) {
- cmdq_error(cmdq, "unknown command: %s", args->argv[1]);
+ cmdq_error(item, "unknown command: %s", args->argv[1]);
return (CMD_RETURN_ERROR);
}
if (args->argc != 2) {
- cmdq_error(cmdq, "no argument allowed");
+ cmdq_error(item, "no argument allowed");
return (CMD_RETURN_ERROR);
}