aboutsummaryrefslogtreecommitdiff
path: root/cmd-switch-client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-10-16 22:01:14 +0100
committerThomas Adam <thomas@xteddy.org>2016-10-16 22:01:14 +0100
commit1a6e696b08113ca17ee8e881844167cf94276846 (patch)
tree60ecdd8c9e51bff46624e48d9373686b858d2fb1 /cmd-switch-client.c
parentd401340c516131ae8e07bfb978b670347486d077 (diff)
parentd15d54c2c8e6b95695169442eb2a27d814efc078 (diff)
downloadrtmux-1a6e696b08113ca17ee8e881844167cf94276846.tar.gz
rtmux-1a6e696b08113ca17ee8e881844167cf94276846.tar.bz2
rtmux-1a6e696b08113ca17ee8e881844167cf94276846.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-switch-client.c')
-rw-r--r--cmd-switch-client.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/cmd-switch-client.c b/cmd-switch-client.c
index cc3212db..eb7c5351 100644
--- a/cmd-switch-client.c
+++ b/cmd-switch-client.c
@@ -27,7 +27,8 @@
* Switch client to a different session.
*/
-static enum cmd_retval cmd_switch_client_exec(struct cmd *, struct cmd_q *);
+static enum cmd_retval cmd_switch_client_exec(struct cmd *,
+ struct cmdq_item *);
const struct cmd_entry cmd_switch_client_entry = {
.name = "switch-client",
@@ -45,12 +46,12 @@ const struct cmd_entry cmd_switch_client_entry = {
};
static enum cmd_retval
-cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
+cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = self->args;
- struct cmd_state *state = &cmdq->state;
+ struct cmd_state *state = &item->state;
struct client *c = state->c;
- struct session *s = cmdq->state.tflag.s;
+ struct session *s = item->state.tflag.s;
struct window_pane *wp;
const char *tablename, *update;
struct key_table *table;
@@ -62,7 +63,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
if (tablename != NULL) {
table = key_bindings_get_table(tablename, 0);
if (table == NULL) {
- cmdq_error(cmdq, "table %s doesn't exist", tablename);
+ cmdq_error(item, "table %s doesn't exist", tablename);
return (CMD_RETURN_ERROR);
}
table->references++;
@@ -73,12 +74,12 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
if (args_has(args, 'n')) {
if ((s = session_next_session(c->session)) == NULL) {
- cmdq_error(cmdq, "can't find next session");
+ cmdq_error(item, "can't find next session");
return (CMD_RETURN_ERROR);
}
} else if (args_has(args, 'p')) {
if ((s = session_previous_session(c->session)) == NULL) {
- cmdq_error(cmdq, "can't find previous session");
+ cmdq_error(item, "can't find previous session");
return (CMD_RETURN_ERROR);
}
} else if (args_has(args, 'l')) {
@@ -87,11 +88,11 @@ cmd_switch_client_exec(struct cmd *self, struct cmd_q *cmdq)
else
s = NULL;
if (s == NULL) {
- cmdq_error(cmdq, "can't find last session");
+ cmdq_error(item, "can't find last session");
return (CMD_RETURN_ERROR);
}
} else {
- if (cmdq->client == NULL)
+ if (item->client == NULL)
return (CMD_RETURN_NORMAL);
if (state->tflag.wl != NULL) {
wp = state->tflag.wp;