From b342bd0b462f69a9fc9a59d52bcd4bb34b57114f Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 16 Oct 2016 19:04:05 +0000 Subject: Mass rename struct cmd_q to struct cmdq_item and related. --- cfg.c | 30 +++---- cmd-attach-session.c | 27 ++++--- cmd-bind-key.c | 26 +++--- cmd-break-pane.c | 24 +++--- cmd-capture-pane.c | 30 +++---- cmd-choose-buffer.c | 11 +-- cmd-choose-client.c | 13 +-- cmd-choose-tree.c | 12 +-- cmd-clear-history.c | 9 ++- cmd-command-prompt.c | 23 +++--- cmd-confirm-before.c | 27 ++++--- cmd-copy-mode.c | 12 +-- cmd-detach-client.c | 9 ++- cmd-display-message.c | 19 ++--- cmd-display-panes.c | 31 ++++---- cmd-find-window.c | 16 ++-- cmd-find.c | 82 +++++++++---------- cmd-if-shell.c | 66 ++++++++-------- cmd-join-pane.c | 24 +++--- cmd-kill-pane.c | 8 +- cmd-kill-server.c | 4 +- cmd-kill-session.c | 6 +- cmd-kill-window.c | 10 +-- cmd-list-buffers.c | 8 +- cmd-list-clients.c | 10 +-- cmd-list-keys.c | 49 ++++++------ cmd-list-panes.c | 36 ++++----- cmd-list-sessions.c | 9 ++- cmd-list-windows.c | 22 +++--- cmd-load-buffer.c | 28 +++---- cmd-lock-server.c | 8 +- cmd-move-window.c | 14 ++-- cmd-new-session.c | 42 +++++----- cmd-new-window.c | 32 ++++---- cmd-paste-buffer.c | 8 +- cmd-pipe-pane.c | 18 ++--- cmd-queue.c | 210 ++++++++++++++++++++++++------------------------- cmd-refresh-client.c | 14 ++-- cmd-rename-session.c | 11 +-- cmd-rename-window.c | 7 +- cmd-resize-pane.c | 22 +++--- cmd-respawn-pane.c | 18 ++--- cmd-respawn-window.c | 17 ++-- cmd-rotate-window.c | 7 +- cmd-run-shell.c | 32 ++++---- cmd-save-buffer.c | 22 +++--- cmd-select-layout.c | 9 ++- cmd-select-pane.c | 18 ++--- cmd-select-window.c | 17 ++-- cmd-send-keys.c | 20 ++--- cmd-set-buffer.c | 14 ++-- cmd-set-environment.c | 23 +++--- cmd-set-hook.c | 22 +++--- cmd-set-option.c | 164 +++++++++++++++++++------------------- cmd-show-environment.c | 35 +++++---- cmd-show-messages.c | 31 ++++---- cmd-show-options.c | 52 ++++++------ cmd-source-file.c | 28 +++---- cmd-split-window.c | 33 ++++---- cmd-swap-pane.c | 12 +-- cmd-swap-window.c | 14 ++-- cmd-switch-client.c | 19 ++--- cmd-unbind-key.c | 26 +++--- cmd-wait-for.c | 56 ++++++------- cmd.c | 30 +++---- control.c | 24 +++--- format.c | 10 +-- hooks.c | 40 +++++----- key-bindings.c | 4 +- notify.c | 8 +- server-client.c | 8 +- tmux.h | 82 +++++++++---------- window-choose.c | 10 +-- 73 files changed, 1001 insertions(+), 971 deletions(-) diff --git a/cfg.c b/cfg.c index 62cca179..91c16fa4 100644 --- a/cfg.c +++ b/cfg.c @@ -35,7 +35,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); @@ -79,15 +79,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) { @@ -123,11 +123,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++; @@ -153,12 +153,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]); } diff --git a/cmd-attach-session.c b/cmd-attach-session.c index f0e860f9..d999eb76 100644 --- a/cmd-attach-session.c +++ b/cmd-attach-session.c @@ -30,7 +30,8 @@ * Attach existing session to the current terminal. */ -static enum cmd_retval cmd_attach_session_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_attach_session_exec(struct cmd *, + struct cmdq_item *); const struct cmd_entry cmd_attach_session_entry = { .name = "attach-session", @@ -46,26 +47,26 @@ const struct cmd_entry cmd_attach_session_entry = { }; enum cmd_retval -cmd_attach_session(struct cmd_q *cmdq, int dflag, int rflag, const char *cflag, - int Eflag) +cmd_attach_session(struct cmdq_item *item, int dflag, int rflag, + const char *cflag, int Eflag) { - struct session *s = cmdq->state.tflag.s; - struct client *c = cmdq->client, *c_loop; - struct winlink *wl = cmdq->state.tflag.wl; - struct window_pane *wp = cmdq->state.tflag.wp; + struct session *s = item->state.tflag.s; + struct client *c = item->client, *c_loop; + struct winlink *wl = item->state.tflag.wl; + struct window_pane *wp = item->state.tflag.wp; const char *update; char *cause, *cwd; struct format_tree *ft; if (RB_EMPTY(&sessions)) { - cmdq_error(cmdq, "no sessions"); + cmdq_error(item, "no sessions"); return (CMD_RETURN_ERROR); } if (c == NULL) return (CMD_RETURN_NORMAL); if (server_client_check_nested(c)) { - cmdq_error(cmdq, "sessions should be nested with care, " + cmdq_error(item, "sessions should be nested with care, " "unset $TMUX to force"); return (CMD_RETURN_ERROR); } @@ -77,7 +78,7 @@ cmd_attach_session(struct cmd_q *cmdq, int dflag, int rflag, const char *cflag, } if (cflag != NULL) { - ft = format_create(cmdq, 0); + ft = format_create(item, 0); format_defaults(ft, c, s, wl, wp); cwd = format_expand(ft, cflag); format_free(ft); @@ -111,7 +112,7 @@ cmd_attach_session(struct cmd_q *cmdq, int dflag, int rflag, const char *cflag, s->curw->flags &= ~WINLINK_ALERTFLAGS; } else { if (server_client_open(c, &cause) != 0) { - cmdq_error(cmdq, "open terminal failed: %s", cause); + cmdq_error(item, "open terminal failed: %s", cause); free(cause); return (CMD_RETURN_ERROR); } @@ -155,10 +156,10 @@ cmd_attach_session(struct cmd_q *cmdq, int dflag, int rflag, const char *cflag, } static enum cmd_retval -cmd_attach_session_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_attach_session_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - return (cmd_attach_session(cmdq, args_has(args, 'd'), + return (cmd_attach_session(item, args_has(args, 'd'), args_has(args, 'r'), args_get(args, 'c'), args_has(args, 'E'))); } diff --git a/cmd-bind-key.c b/cmd-bind-key.c index 8c1acba9..4650afb1 100644 --- a/cmd-bind-key.c +++ b/cmd-bind-key.c @@ -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); } diff --git a/cmd-break-pane.c b/cmd-break-pane.c index 75562750..a5d4e148 100644 --- a/cmd-break-pane.c +++ b/cmd-break-pane.c @@ -28,7 +28,7 @@ #define BREAK_PANE_TEMPLATE "#{session_name}:#{window_index}.#{pane_index}" -static enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_break_pane_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_break_pane_entry = { .name = "break-pane", @@ -45,28 +45,28 @@ const struct cmd_entry cmd_break_pane_entry = { }; static enum cmd_retval -cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct winlink *wl = cmdq->state.sflag.wl; - struct session *src_s = cmdq->state.sflag.s; - struct session *dst_s = cmdq->state.tflag.s; - struct window_pane *wp = cmdq->state.sflag.wp; + struct winlink *wl = item->state.sflag.wl; + struct session *src_s = item->state.sflag.s; + struct session *dst_s = item->state.tflag.s; + struct window_pane *wp = item->state.sflag.wp; struct window *w = wl->window; char *name; char *cause; - int idx = cmdq->state.tflag.idx; + int idx = item->state.tflag.idx; struct format_tree *ft; const char *template; char *cp; if (idx != -1 && winlink_find_by_index(&dst_s->windows, idx) != NULL) { - cmdq_error(cmdq, "index %d already in use", idx); + cmdq_error(item, "index %d already in use", idx); return (CMD_RETURN_ERROR); } if (window_count_panes(w) == 1) { - cmdq_error(cmdq, "can't break with only one pane"); + cmdq_error(item, "can't break with only one pane"); return (CMD_RETURN_ERROR); } server_unzoom_window(w); @@ -101,11 +101,11 @@ cmd_break_pane_exec(struct cmd *self, struct cmd_q *cmdq) if ((template = args_get(args, 'F')) == NULL) template = BREAK_PANE_TEMPLATE; - ft = format_create(cmdq, 0); - format_defaults(ft, cmdq->state.c, dst_s, wl, wp); + ft = format_create(item, 0); + format_defaults(ft, item->state.c, dst_s, wl, wp); cp = format_expand(ft, template); - cmdq_print(cmdq, "%s", cp); + cmdq_print(item, "%s", cp); free(cp); format_free(ft); diff --git a/cmd-capture-pane.c b/cmd-capture-pane.c index 6cf885bc..1ed00b9e 100644 --- a/cmd-capture-pane.c +++ b/cmd-capture-pane.c @@ -27,14 +27,13 @@ * Write the entire contents of a pane to a buffer or stdout. */ -static enum cmd_retval cmd_capture_pane_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_capture_pane_exec(struct cmd *, struct cmdq_item *); -static char *cmd_capture_pane_append(char *, size_t *, char *, - size_t); -static char *cmd_capture_pane_pending(struct args *, - struct window_pane *, size_t *); -static char *cmd_capture_pane_history(struct args *, struct cmd_q *, - struct window_pane *, size_t *); +static char *cmd_capture_pane_append(char *, size_t *, char *, size_t); +static char *cmd_capture_pane_pending(struct args *, struct window_pane *, + size_t *); +static char *cmd_capture_pane_history(struct args *, struct cmdq_item *, + struct window_pane *, size_t *); const struct cmd_entry cmd_capture_pane_entry = { .name = "capture-pane", @@ -92,7 +91,8 @@ cmd_capture_pane_pending(struct args *args, struct window_pane *wp, } static char * -cmd_capture_pane_history(struct args *args, struct cmd_q *cmdq, + +cmd_capture_pane_history(struct args *args, struct cmdq_item *item, struct window_pane *wp, size_t *len) { struct grid *gd; @@ -109,7 +109,7 @@ cmd_capture_pane_history(struct args *args, struct cmd_q *cmdq, gd = wp->saved_grid; if (gd == NULL) { if (!args_has(args, 'q')) { - cmdq_error(cmdq, "no alternate screen"); + cmdq_error(item, "no alternate screen"); return (NULL); } return (xstrdup("")); @@ -177,11 +177,11 @@ cmd_capture_pane_history(struct args *args, struct cmd_q *cmdq, } static enum cmd_retval -cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_capture_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct client *c; - struct window_pane *wp = cmdq->state.tflag.wp; + struct window_pane *wp = item->state.tflag.wp; char *buf, *cause; const char *bufname; size_t len; @@ -190,15 +190,15 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq) if (args_has(args, 'P')) buf = cmd_capture_pane_pending(args, wp, &len); else - buf = cmd_capture_pane_history(args, cmdq, wp, &len); + buf = cmd_capture_pane_history(args, item, wp, &len); if (buf == NULL) return (CMD_RETURN_ERROR); if (args_has(args, 'p')) { - c = cmdq->client; + c = item->client; if (c == NULL || (c->session != NULL && !(c->flags & CLIENT_CONTROL))) { - cmdq_error(cmdq, "can't write to stdout"); + cmdq_error(item, "can't write to stdout"); free(buf); return (CMD_RETURN_ERROR); } @@ -213,7 +213,7 @@ cmd_capture_pane_exec(struct cmd *self, struct cmd_q *cmdq) bufname = args_get(args, 'b'); if (paste_set(buf, len, bufname, &cause) != 0) { - cmdq_error(cmdq, "%s", cause); + cmdq_error(item, "%s", cause); free(cause); free(buf); return (CMD_RETURN_ERROR); diff --git a/cmd-choose-buffer.c b/cmd-choose-buffer.c index fee4958a..ae619b6c 100644 --- a/cmd-choose-buffer.c +++ b/cmd-choose-buffer.c @@ -30,7 +30,8 @@ #define CHOOSE_BUFFER_TEMPLATE \ "#{buffer_name}: #{buffer_size} bytes: #{buffer_sample}" -static enum cmd_retval cmd_choose_buffer_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_choose_buffer_exec(struct cmd *, + struct cmdq_item *); const struct cmd_entry cmd_choose_buffer_entry = { .name = "choose-buffer", @@ -46,11 +47,11 @@ const struct cmd_entry cmd_choose_buffer_entry = { }; static enum cmd_retval -cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_choose_buffer_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->state.c; - struct winlink *wl = cmdq->state.tflag.wl; + struct client *c = item->state.c; + struct winlink *wl = item->state.tflag.wl; struct window_choose_data *cdata; struct paste_buffer *pb; char *action, *action_data; @@ -58,7 +59,7 @@ cmd_choose_buffer_exec(struct cmd *self, struct cmd_q *cmdq) u_int idx; if (c == NULL) { - cmdq_error(cmdq, "no client available"); + cmdq_error(item, "no client available"); return (CMD_RETURN_ERROR); } diff --git a/cmd-choose-client.c b/cmd-choose-client.c index 67d184b3..2a64da69 100644 --- a/cmd-choose-client.c +++ b/cmd-choose-client.c @@ -33,7 +33,8 @@ "#{?client_utf8, (utf8),}#{?client_readonly, (ro),} " \ "(last used #{t:client_activity})" -static enum cmd_retval cmd_choose_client_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_choose_client_exec(struct cmd *, + struct cmdq_item *); static void cmd_choose_client_callback(struct window_choose_data *); @@ -55,19 +56,19 @@ struct cmd_choose_client_data { }; static enum cmd_retval -cmd_choose_client_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_choose_client_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->state.c; + struct client *c = item->state.c; struct client *c1; struct window_choose_data *cdata; - struct winlink *wl = cmdq->state.tflag.wl; + struct winlink *wl = item->state.tflag.wl; const char *template; char *action; u_int idx, cur; if (c == NULL) { - cmdq_error(cmdq, "no client available"); + cmdq_error(item, "no client available"); return (CMD_RETURN_ERROR); } @@ -86,7 +87,7 @@ cmd_choose_client_exec(struct cmd *self, struct cmd_q *cmdq) TAILQ_FOREACH(c1, &clients, entry) { if (c1->session == NULL || c1->tty.path == NULL) continue; - if (c1 == cmdq->client) + if (c1 == item->client) cur = idx; cdata = window_choose_data_create(TREE_OTHER, c, c->session); diff --git a/cmd-choose-tree.c b/cmd-choose-tree.c index 13bbe2a7..65d55407 100644 --- a/cmd-choose-tree.c +++ b/cmd-choose-tree.c @@ -41,7 +41,7 @@ "#{window_index}: #{window_name}#{window_flags} " \ "\"#{pane_title}\"" -static enum cmd_retval cmd_choose_tree_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_choose_tree_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_choose_tree_entry = { .name = "choose-tree", @@ -84,12 +84,12 @@ const struct cmd_entry cmd_choose_window_entry = { }; static enum cmd_retval -cmd_choose_tree_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_choose_tree_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->state.c; - struct winlink *wl = cmdq->state.tflag.wl, *wm; - struct session *s = cmdq->state.tflag.s, *s2; + struct client *c = item->state.c; + struct winlink *wl = item->state.tflag.wl, *wm; + struct session *s = item->state.tflag.s, *s2; struct window_choose_data *wcd = NULL; const char *ses_template, *win_template; char *final_win_action, *cur_win_template; @@ -103,7 +103,7 @@ cmd_choose_tree_exec(struct cmd *self, struct cmd_q *cmdq) ses_action = win_action = NULL; if (c == NULL) { - cmdq_error(cmdq, "no client available"); + cmdq_error(item, "no client available"); return (CMD_RETURN_ERROR); } diff --git a/cmd-clear-history.c b/cmd-clear-history.c index 46f1d4e6..1afd9053 100644 --- a/cmd-clear-history.c +++ b/cmd-clear-history.c @@ -24,7 +24,8 @@ * Clear pane history. */ -static enum cmd_retval cmd_clear_history_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_clear_history_exec(struct cmd *, + struct cmdq_item *); const struct cmd_entry cmd_clear_history_entry = { .name = "clear-history", @@ -40,12 +41,12 @@ const struct cmd_entry cmd_clear_history_entry = { }; static enum cmd_retval -cmd_clear_history_exec(__unused struct cmd *self, struct cmd_q *cmdq) +cmd_clear_history_exec(__unused struct cmd *self, struct cmdq_item *item) { - struct window_pane *wp = cmdq->state.tflag.wp; + struct window_pane *wp = item->state.tflag.wp; struct grid *gd; - gd = cmdq->state.tflag.wp->base.grid; + gd = item->state.tflag.wp->base.grid; if (wp->mode == &window_copy_mode) window_pane_reset_mode(wp); diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index 5e21b2bc..4c1c8593 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -29,7 +29,8 @@ * Prompt for command in client. */ -static enum cmd_retval cmd_command_prompt_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_command_prompt_exec(struct cmd *, + struct cmdq_item *); static int cmd_command_prompt_callback(void *, const char *); static void cmd_command_prompt_free(void *); @@ -59,12 +60,12 @@ struct cmd_command_prompt_cdata { }; static enum cmd_retval -cmd_command_prompt_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; const char *inputs, *prompts; struct cmd_command_prompt_cdata *cdata; - struct client *c = cmdq->state.c; + struct client *c = item->state.c; char *prompt, *ptr, *input = NULL; size_t n; int flags; @@ -122,11 +123,11 @@ cmd_command_prompt_exec(struct cmd *self, struct cmd_q *cmdq) } static enum cmd_retval -cmd_command_prompt_error(struct cmd_q *cmdq, void *data) +cmd_command_prompt_error(struct cmdq_item *item, void *data) { char *error = data; - cmdq_error(cmdq, "%s", error); + cmdq_error(item, "%s", error); free(error); return (CMD_RETURN_NORMAL); @@ -138,7 +139,7 @@ cmd_command_prompt_callback(void *data, const char *s) struct cmd_command_prompt_cdata *cdata = data; struct client *c = cdata->c; struct cmd_list *cmdlist; - struct cmd_q *new_cmdq; + struct cmdq_item *new_item; char *cause, *new_template, *prompt, *ptr; char *input = NULL; @@ -165,17 +166,17 @@ cmd_command_prompt_callback(void *data, const char *s) if (cmd_string_parse(new_template, &cmdlist, NULL, 0, &cause) != 0) { if (cause != NULL) { - new_cmdq = cmdq_get_callback(cmd_command_prompt_error, + new_item = cmdq_get_callback(cmd_command_prompt_error, cause); } else - new_cmdq = NULL; + new_item = NULL; } else { - new_cmdq = cmdq_get_command(cmdlist, NULL, NULL, 0); + new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); cmd_list_free(cmdlist); } - if (new_cmdq != NULL) - cmdq_append(c, new_cmdq); + if (new_item != NULL) + cmdq_append(c, new_item); if (c->prompt_callbackfn != (void *)&cmd_command_prompt_callback) return (1); diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c index 2dd52c81..d468bbc3 100644 --- a/cmd-confirm-before.c +++ b/cmd-confirm-before.c @@ -28,10 +28,11 @@ * Asks for confirmation before executing a command. */ -static enum cmd_retval cmd_confirm_before_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_confirm_before_exec(struct cmd *, + struct cmdq_item *); -static int cmd_confirm_before_callback(void *, const char *); -static void cmd_confirm_before_free(void *); +static int cmd_confirm_before_callback(void *, const char *); +static void cmd_confirm_before_free(void *); const struct cmd_entry cmd_confirm_before_entry = { .name = "confirm-before", @@ -52,11 +53,11 @@ struct cmd_confirm_before_data { }; static enum cmd_retval -cmd_confirm_before_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_confirm_before_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct cmd_confirm_before_data *cdata; - struct client *c = cmdq->state.c; + struct client *c = item->state.c; char *cmd, *copy, *new_prompt, *ptr; const char *prompt; @@ -84,11 +85,11 @@ cmd_confirm_before_exec(struct cmd *self, struct cmd_q *cmdq) } static enum cmd_retval -cmd_confirm_before_error(struct cmd_q *cmdq, void *data) +cmd_confirm_before_error(struct cmdq_item *item, void *data) { char *error = data; - cmdq_error(cmdq, "%s", error); + cmdq_error(item, "%s", error); free(error); return (CMD_RETURN_NORMAL); @@ -100,7 +101,7 @@ cmd_confirm_before_callback(void *data, const char *s) struct cmd_confirm_before_data *cdata = data; struct client *c = cdata->client; struct cmd_list *cmdlist; - struct cmd_q *new_cmdq; + struct cmdq_item *new_item; char *cause; if (c->flags & CLIENT_DEAD) @@ -113,17 +114,17 @@ cmd_confirm_before_callback(void *data, const char *s) if (cmd_string_parse(cdata->cmd, &cmdlist, NULL, 0, &cause) != 0) { if (cause != NULL) { - new_cmdq = cmdq_get_callback(cmd_confirm_before_error, + new_item = cmdq_get_callback(cmd_confirm_before_error, cause); } else - new_cmdq = NULL; + new_item = NULL; } else { - new_cmdq = cmdq_get_command(cmdlist, NULL, NULL, 0); + new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); cmd_list_free(cmdlist); } - if (new_cmdq != NULL) - cmdq_append(c, new_cmdq); + if (new_item != NULL) + cmdq_append(c, new_item); return (0); } diff --git a/cmd-copy-mode.c b/cmd-copy-mode.c index dc880d56..448e7b9c 100644 --- a/cmd-copy-mode.c +++ b/cmd-copy-mode.c @@ -24,7 +24,7 @@ * Enter copy or clock mode. */ -static enum cmd_retval cmd_copy_mode_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_copy_mode_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_copy_mode_entry = { .name = "copy-mode", @@ -53,15 +53,15 @@ const struct cmd_entry cmd_clock_mode_entry = { }; static enum cmd_retval -cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->client; + struct client *c = item->client; struct session *s; - struct window_pane *wp = cmdq->state.tflag.wp; + struct window_pane *wp = item->state.tflag.wp; if (args_has(args, 'M')) { - if ((wp = cmd_mouse_pane(&cmdq->mouse, &s, NULL)) == NULL) + if ((wp = cmd_mouse_pane(&item->mouse, &s, NULL)) == NULL) return (CMD_RETURN_NORMAL); if (c == NULL || c->session != s) return (CMD_RETURN_NORMAL); @@ -80,7 +80,7 @@ cmd_copy_mode_exec(struct cmd *self, struct cmd_q *cmdq) if (args_has(args, 'M')) { if (wp->mode != NULL && wp->mode != &window_copy_mode) return (CMD_RETURN_NORMAL); - window_copy_start_drag(c, &cmdq->mouse); + window_copy_start_drag(c, &item->mouse); } if (wp->mode == &window_copy_mode && args_has(self->args, 'u')) window_copy_pageup(wp, 0); diff --git a/cmd-detach-client.c b/cmd-detach-client.c index 814ba091..69225bae 100644 --- a/cmd-detach-client.c +++ b/cmd-detach-client.c @@ -26,7 +26,8 @@ * Detach a client. */ -static enum cmd_retval cmd_detach_client_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_detach_client_exec(struct cmd *, + struct cmdq_item *); const struct cmd_entry cmd_detach_client_entry = { .name = "detach-client", @@ -56,10 +57,10 @@ const struct cmd_entry cmd_suspend_client_entry = { }; static enum cmd_retval -cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_detach_client_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->state.c, *cloop; + struct client *c = item->state.c, *cloop; struct session *s; enum msgtype msgtype; @@ -76,7 +77,7 @@ cmd_detach_client_exec(struct cmd *self, struct cmd_q *cmdq) msgtype = MSG_DETACH; if (args_has(args, 's')) { - s = cmdq->state.sflag.s; + s = item->state.sflag.s; TAILQ_FOREACH(cloop, &clients, entry) { if (cloop->session == s) server_client_detach(cloop, msgtype); diff --git a/cmd-display-message.c b/cmd-display-message.c index 74fa7804..c57db579 100644 --- a/cmd-display-message.c +++ b/cmd-display-message.c @@ -32,7 +32,8 @@ "#{window_name}, current pane #{pane_index} " \ "- (%H:%M %d-%b-%y)" -static enum cmd_retval cmd_display_message_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_display_message_exec(struct cmd *, + struct cmdq_item *); const struct cmd_entry cmd_display_message_entry = { .name = "display-message", @@ -50,19 +51,19 @@ const struct cmd_entry cmd_display_message_entry = { }; static enum cmd_retval -cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_display_message_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->state.c; - struct session *s = cmdq->state.tflag.s; - struct winlink *wl = cmdq->state.tflag.wl; - struct window_pane *wp = cmdq->state.tflag.wp; + struct client *c = item->state.c; + struct session *s = item->state.tflag.s; + struct winlink *wl = item->state.tflag.wl; + struct window_pane *wp = item->state.tflag.wp; const char *template; char *msg; struct format_tree *ft; if (args_has(args, 'F') && args->argc != 0) { - cmdq_error(cmdq, "only one of -F or argument must be given"); + cmdq_error(item, "only one of -F or argument must be given"); return (CMD_RETURN_ERROR); } @@ -72,12 +73,12 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq) if (template == NULL) template = DISPLAY_MESSAGE_TEMPLATE; - ft = format_create(cmdq, 0); + ft = format_create(item, 0); format_defaults(ft, c, s, wl, wp); msg = format_expand_time(ft, template, time(NULL)); if (args_has(self->args, 'p')) - cmdq_print(cmdq, "%s", msg); + cmdq_print(item, "%s", msg); else if (c != NULL) status_message_set(c, "%s", msg); free(msg); diff --git a/cmd-display-panes.c b/cmd-display-panes.c index 471bec02..65813804 100644 --- a/cmd-display-panes.c +++ b/cmd-display-panes.c @@ -27,10 +27,11 @@ * Display panes on a client. */ -static enum cmd_retval cmd_display_panes_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_display_panes_exec(struct cmd *, + struct cmdq_item *); -static void cmd_display_panes_callback(struct client *, - struct window_pane *); +static void cmd_display_panes_callback(struct client *, + struct window_pane *); const struct cmd_entry cmd_display_panes_entry = { .name = "display-panes", @@ -46,10 +47,10 @@ const struct cmd_entry cmd_display_panes_entry = { }; static enum cmd_retval -cmd_display_panes_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_display_panes_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->state.c; + struct client *c = item->state.c; if (c->identify_callback != NULL) return (CMD_RETURN_NORMAL); @@ -66,11 +67,11 @@ cmd_display_panes_exec(struct cmd *self, struct cmd_q *cmdq) } static enum cmd_retval -cmd_display_panes_error(struct cmd_q *cmdq, void *data) +cmd_display_panes_error(struct cmdq_item *item, void *data) { char *error = data; - cmdq_error(cmdq, "%s", error); + cmdq_error(item, "%s", error); free(error); return (CMD_RETURN_NORMAL); @@ -79,9 +80,9 @@ cmd_display_panes_error(struct cmd_q *cmdq, void *data) static void cmd_display_panes_callback(struct client *c, struct window_pane *wp) { - struct cmd_list *cmdlist; - struct cmd_q *new_cmdq; - char *template, *cmd, *expanded, *cause; + struct cmd_list *cmdlist; + struct cmdq_item *new_item; + char *template, *cmd, *expanded, *cause; template = c->identify_callback_data; if (wp == NULL) @@ -91,17 +92,17 @@ cmd_display_panes_callback(struct client *c, struct window_pane *wp) if (cmd_string_parse(cmd, &cmdlist, NULL, 0, &cause) != 0) { if (cause != NULL) { - new_cmdq = cmdq_get_callback(cmd_display_panes_error, + new_item = cmdq_get_callback(cmd_display_panes_error, cause); } else - new_cmdq = NULL; + new_item = NULL; } else { - new_cmdq = cmdq_get_command(cmdlist, NULL, NULL, 0); + new_item = cmdq_get_command(cmdlist, NULL, NULL, 0); cmd_list_free(cmdlist); } - if (new_cmdq != NULL) - cmdq_append(c, new_cmdq); + if (new_item != NULL) + cmdq_append(c, new_item); free(cmd); free(expanded); diff --git a/cmd-find-window.c b/cmd-find-window.c index 6ab6fbcf..129f6afe 100644 --- a/cmd-find-window.c +++ b/cmd-find-window.c @@ -33,9 +33,9 @@ "[#{window_width}x#{window_height}] " \ "(#{window_panes} panes) #{window_find_matches}" -static enum cmd_retval cmd_find_window_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_find_window_exec(struct cmd *, struct cmdq_item *); -static void cmd_find_window_callback(struct window_choose_data *); +static void cmd_find_window_callback(struct window_choose_data *); /* Flags for determining matching behavior. */ #define CMD_FIND_WINDOW_BY_TITLE 0x1 @@ -139,13 +139,13 @@ cmd_find_window_match(struct cmd_find_window_list *find_list, } static enum cmd_retval -cmd_find_window_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_find_window_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct client *c = cmdq->state.c; + struct client *c = item->state.c; struct window_choose_data *cdata; - struct session *s = cmdq->state.tflag.s; - struct winlink *wl = cmdq->state.tflag.wl, *wm; + struct session *s = item->state.tflag.s; + struct winlink *wl = item->state.tflag.wl, *wm; struct cmd_find_window_list find_list; struct cmd_find_window_data *find_data; struct cmd_find_window_data *find_data1; @@ -154,7 +154,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_q *cmdq) u_int i, match_flags; if (c == NULL) { - cmdq_error(cmdq, "no client available"); + cmdq_error(item, "no client available"); return (CMD_RETURN_ERROR); } @@ -172,7 +172,7 @@ cmd_find_window_exec(struct cmd *self, struct cmd_q *cmdq) free(searchstr); if (TAILQ_EMPTY(&find_list)) { - cmdq_error(cmdq, "no windows matching: %s", str); + cmdq_error(item, "no windows matching: %s", str); return (CMD_RETURN_ERROR); } diff --git a/cmd-find.c b/cmd-find.c index f9cbe442..5008c1a5 100644 --- a/cmd-find.c +++ b/cmd-find.c @@ -38,7 +38,7 @@ static int cmd_find_best_winlink_with_window(struct cmd_find_state *); static int cmd_find_current_session_with_client(struct cmd_find_state *); static int cmd_find_current_session(struct cmd_find_state *); -static struct client *cmd_find_current_client(struct cmd_q *); +static struct client *cmd_find_current_client(struct cmdq_item *); static const char *cmd_find_map_table(const char *[][2], const char *); @@ -192,8 +192,8 @@ cmd_find_best_session_with_window(struct cmd_find_state *fs) u_int ssize; struct session *s; - if (fs->cmdq != NULL && fs->cmdq->client != NULL) { - fs->s = cmd_find_try_TMUX(fs->cmdq->client, fs->w); + if (fs->item != NULL && fs->item->client != NULL) { + fs->s = cmd_find_try_TMUX(fs->item->client, fs->w); if (fs->s != NULL) return (cmd_find_best_winlink_with_window(fs)); } @@ -256,9 +256,9 @@ cmd_find_current_session_with_client(struct cmd_find_state *fs) * sessions to those containing that pane (we still use the current * window in the best session). */ - if (fs->cmdq != NULL && fs->cmdq->client->tty.path != NULL) { + if (fs->item != NULL && fs->item->client->tty.path != NULL) { RB_FOREACH(wp, window_pane_tree, &all_window_panes) { - if (strcmp(wp->tty, fs->cmdq->client->tty.path) == 0) + if (strcmp(wp->tty, fs->item->client->tty.path) == 0) break; } } else @@ -292,8 +292,8 @@ cmd_find_current_session_with_client(struct cmd_find_state *fs) unknown_pane: fs->s = NULL; - if (fs->cmdq != NULL) - fs->s = cmd_find_try_TMUX(fs->cmdq->client, NULL); + if (fs->item != NULL) + fs->s = cmd_find_try_TMUX(fs->item->client, NULL); if (fs->s == NULL) fs->s = cmd_find_best_session(NULL, 0, fs->flags); if (fs->s == NULL) @@ -314,12 +314,12 @@ static int cmd_find_current_session(struct cmd_find_state *fs) { /* If we know the current client, use it. */ - if (fs->cmdq != NULL && fs->cmdq->client != NULL) { - log_debug("%s: have client %p%s", __func__, fs->cmdq->client, - fs->cmdq->client->session == NULL ? "" : " (with session)"); - if (fs->cmdq->client->session == NULL) + if (fs->item != NULL && fs->item->client != NULL) { + log_debug("%s: have client %p%s", __func__, fs->item->client, + fs->item->client->session == NULL ? "" : " (with session)"); + if (fs->item->client->session == NULL) return (cmd_find_current_session_with_client(fs)); - fs->s = fs->cmdq->client->session; + fs->s = fs->item->client->session; fs->wl = fs->s->curw; fs->idx = fs->wl->idx; fs->w = fs->wl->window; @@ -341,7 +341,7 @@ cmd_find_current_session(struct cmd_find_state *fs) /* Work out the best current client. */ static struct client * -cmd_find_current_client(struct cmd_q *cmdq) +cmd_find_current_client(struct cmdq_item *item) { struct cmd_find_state current; struct session *s; @@ -349,14 +349,14 @@ cmd_find_current_client(struct cmd_q *cmdq) u_int csize; /* If the queue client has a session, use it. */ - if (cmdq->client != NULL && cmdq->client->session != NULL) { - log_debug("%s: using cmdq %p client %p", __func__, cmdq, - cmdq->client); - return (cmdq->client); + if (item->client != NULL && item->client->session != NULL) { + log_debug("%s: using item %p client %p", __func__, item, + item->client); + return (item->client); } /* Otherwise find the current session. */ - cmd_find_clear_state(¤t, cmdq, 0); + cmd_find_clear_state(¤t, item, 0); if (cmd_find_current_session(¤t) != 0) return (NULL); @@ -793,11 +793,12 @@ cmd_find_get_pane_with_window(struct cmd_find_state *fs, const char *pane) /* Clear state. */ void -cmd_find_clear_state(struct cmd_find_state *fs, struct cmd_q *cmdq, int flags) +cmd_find_clear_state(struct cmd_find_state *fs, struct cmdq_item *item, + int flags) { memset(fs, 0, sizeof *fs); - fs->cmdq = cmdq; + fs->item = item; fs->flags = flags; fs->idx = -1; @@ -952,12 +953,12 @@ cmd_find_from_pane(struct cmd_find_state *fs, struct window_pane *wp) /* Find current state. */ int -cmd_find_current(struct cmd_find_state *fs, struct cmd_q *cmdq, int flags) +cmd_find_current(struct cmd_find_state *fs, struct cmdq_item *item, int flags) { - cmd_find_clear_state(fs, cmdq, flags); + cmd_find_clear_state(fs, item, flags); if (cmd_find_current_session(fs) != 0) { if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "no current session"); + cmdq_error(item, "no current session"); return (-1); } return (0); @@ -969,7 +970,8 @@ cmd_find_current(struct cmd_find_state *fs, struct cmd_q *cmdq, int flags) */ int cmd_find_target(struct cmd_find_state *fs, struct cmd_find_state *current, - struct cmd_q *cmdq, const char *target, enum cmd_find_type type, int flags) + struct cmdq_item *item, const char *target, enum cmd_find_type type, + int flags) { struct mouse_event *m; char *colon, *period, *copy = NULL; @@ -980,17 +982,17 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_find_state *current, log_debug("%s: target none, type %d", __func__, type); else log_debug("%s: target %s, type %d", __func__, target, type); - log_debug("%s: cmdq %p, flags %#x", __func__, cmdq, flags); + log_debug("%s: item %p, flags %#x", __func__, item, flags); /* Clear new state. */ - cmd_find_clear_state(fs, cmdq, flags); + cmd_find_clear_state(fs, item, flags); /* Find current state. */ if (server_check_marked() && (flags & CMD_FIND_DEFAULT_MARKED)) { fs->current = &marked_pane; log_debug(" current is marked pane"); - } else if (cmd_find_valid_state(&cmdq->current)) { - fs->current = &cmdq->current; + } else if (cmd_find_valid_state(&item->current)) { + fs->current = &item->current; log_debug(" current is from queue"); } else { fs->current = current; @@ -1006,7 +1008,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_find_state *current, /* Mouse target is a plain = or {mouse}. */ if (strcmp(target, "=") == 0 || strcmp(target, "{mouse}") == 0) { - m = &cmdq->mouse; + m = &item->mouse; switch (type) { case CMD_FIND_PANE: fs->wp = cmd_mouse_pane(m, &fs->s, &fs->wl); @@ -1024,7 +1026,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_find_state *current, } if (fs->wp == NULL) { if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "no mouse target"); + cmdq_error(item, "no mouse target"); goto error; } goto found; @@ -1034,7 +1036,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_find_state *current, if (strcmp(target, "~") == 0 || strcmp(target, "{marked}") == 0) { if (!server_check_marked()) { if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "no marked target"); + cmdq_error(item, "no marked target"); goto error; } cmd_find_copy_state(fs, &marked_pane); @@ -1120,7 +1122,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmd_find_state *current, /* No pane is allowed if want an index. */ if (pane != NULL && (flags & CMD_FIND_WINDOW_INDEX)) { if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "can't specify pane here"); + cmdq_error(item, "can't specify pane here"); goto error; } @@ -1219,23 +1221,23 @@ found: no_session: if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "can't find session %s", session); + cmdq_error(item, "can't find session %s", session); goto error; no_window: if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "can't find window %s", window); + cmdq_error(item, "can't find window %s", window); goto error; no_pane: if (~flags & CMD_FIND_QUIET) - cmdq_error(cmdq, "can't find pane %s", pane); + cmdq_error(item, "can't find pane %s", pane); goto error; } /* Find the target client or report an error and return NULL. */ struct client * -cmd_find_client(struct cmd_q *cmdq, const char *target, int quiet) +cmd_find_client(struct cmdq_item *item, const char *target, int quiet) { struct client *c; char *copy; @@ -1243,10 +1245,10 @@ cmd_find_client(struct cmd_q *cmdq, const char *target, int quiet) const char *path; /* A NULL argument means the current client. */ - if (cmdq != NULL && target == NULL) { - c = cmd_find_current_client(cmdq); + if (item != NULL && target == NULL) { + c = cmd_find_current_client(item); if (c == NULL && !quiet) - cmdq_error(cmdq, "no current client"); + cmdq_error(item, "no current client"); log_debug("%s: no target, return %p", __func__, c); return (c); } @@ -1276,7 +1278,7 @@ cmd_find_client(struct cmd_q *cmdq, const char *target, int quiet) /* If no client found, report an error. */ if (c == NULL && !quiet) - cmdq_error(cmdq, "can't find client %s", copy); + cmdq_error(item, "can't find client %s", copy); free(copy); log_debug("%s: target %s, return %p", __func__, target, c); diff --git a/cmd-if-shell.c b/cmd-if-shell.c index 7192b204..5dfb5a19 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -29,11 +29,11 @@ * Executes a tmux command if a shell command returns true or false. */ -static enum cmd_retval cmd_if_shell_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_if_shell_exec(struct cmd *, struct cmdq_item *); -static enum cmd_retval cmd_if_shell_error(struct cmd_q *, void *); -static void cmd_if_shell_callback(struct job *); -static void cmd_if_shell_free(void *); +static enum cmd_retval cmd_if_shell_error(struct cmdq_item *, void *); +static void cmd_if_shell_callback(struct job *); +static void cmd_if_shell_free(void *); const struct cmd_entry cmd_if_shell_entry = { .name = "if-shell", @@ -57,33 +57,33 @@ struct cmd_if_shell_data { char *cmd_else; struct client *client; - struct cmd_q *cmdq; + struct cmdq_item *item; struct mouse_event mouse; }; static enum cmd_retval -cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct cmd_if_shell_data *cdata; char *shellcmd, *cmd, *cause; struct cmd_list *cmdlist; - struct cmd_q *new_cmdq; - struct session *s = cmdq->state.tflag.s; - struct winlink *wl = cmdq->state.tflag.wl; - struct window_pane *wp = cmdq->state.tflag.wp; + struct cmdq_item *new_item; + struct session *s = item->state.tflag.s; + struct winlink *wl = item->state.tflag.wl; + struct window_pane *wp = item->state.tflag.wp; struct format_tree *ft; const char *cwd; - if (cmdq->client != NULL && cmdq->client->session == NULL) - cwd = cmdq->client->cwd; + if (item->client != NULL && item->client->session == NULL) + cwd = item->client->cwd; else if (s != NULL) cwd = s->cwd; else cwd = NULL; - ft = format_create(cmdq, 0); - format_defaults(ft, cmdq->state.c, s, wl, wp); + ft = format_create(item, 0); + format_defaults(ft, item->state.c, s, wl, wp); shellcmd = format_expand(ft, args->argv[0]); format_free(ft); @@ -98,13 +98,13 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq) return (CMD_RETURN_NORMAL); 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); } - new_cmdq = cmdq_get_command(cmdlist, NULL, &cmdq->mouse, 0); - cmdq_insert_after(cmdq, new_cmdq); + new_item = cmdq_get_command(cmdlist, NULL, &item->mouse, 0); + cmdq_insert_after(item, new_item); cmd_list_free(cmdlist); return (CMD_RETURN_NORMAL); } @@ -121,14 +121,14 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq) else cdata->cmd_else = NULL; - cdata->client = cmdq->client; + cdata->client = item->client; cdata->client->references++; if (!args_has(args, 'b')) - cdata->cmdq = cmdq; + cdata->item = item; else - cdata->cmdq = NULL; - memcpy(&cdata->mouse, &cmdq->mouse, sizeof cdata->mouse); + cdata->item = NULL; + memcpy(&cdata->mouse, &item->mouse, sizeof cdata->mouse); job_run(shellcmd, s, cwd, cmd_if_shell_callback, cmd_if_shell_free, cdata); @@ -140,11 +140,11 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq) } static enum cmd_retval -cmd_if_shell_error(struct cmd_q *cmdq, void *data) +cmd_if_shell_error(struct cmdq_item *item, void *data) { char *error = data; - cmdq_error(cmdq, "%s", error); + cmdq_error(item, "%s", error); free(error); return (CMD_RETURN_NORMAL); @@ -156,7 +156,7 @@ cmd_if_shell_callback(struct job *job) struct cmd_if_shell_data *cdata = job->data; struct client *c = cdata->client; struct cmd_list *cmdlist; - struct cmd_q *new_cmdq; + struct cmdq_item *new_item; char *cause, *cmd, *file = cdata->file; u_int line = cdata->line; @@ -169,24 +169,24 @@ cmd_if_shell_callback(struct job *job) if (cmd_string_parse(cmd, &cmdlist, file, line, &cause) != 0) { if (cause != NULL) - new_cmdq = cmdq_get_callback(cmd_if_shell_error, cause); + new_item = cmdq_get_callback(cmd_if_shell_error, cause); else - new_cmdq = NULL; + new_item = NULL; } else { - new_cmdq = cmdq_get_command(cmdlist, NULL, &cdata->mouse, 0); + new_item = cmdq_get_command(cmdlist, NULL, &cdata->mouse, 0); cmd_list_free(cmdlist); } - if (new_cmdq != NULL) { - if (cdata->cmdq == NULL) - cmdq_append(c, new_cmdq); + if (new_item != NULL) { + if (cdata->item == NULL) + cmdq_append(c, new_item); else - cmdq_insert_after(cdata->cmdq, new_cmdq); + cmdq_insert_after(cdata->item, new_item); } out: - if (cdata->cmdq != NULL) - cdata->cmdq->flags &= ~CMD_Q_WAITING; + if (cdata->item != NULL) + cdata->item->flags &= ~CMDQ_WAITING; } static void diff --git a/cmd-join-pane.c b/cmd-join-pane.c index 3ff8f08e..b386d5db 100644 --- a/cmd-join-pane.c +++ b/cmd-join-pane.c @@ -29,7 +29,7 @@ * Join or move a pane into another (like split/swap/kill). */ -static enum cmd_retval cmd_join_pane_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_join_pane_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_join_pane_entry = { .name = "join-pane", @@ -60,7 +60,7 @@ const struct cmd_entry cmd_move_pane_entry = { }; static enum cmd_retval -cmd_join_pane_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct session *dst_s; @@ -78,24 +78,24 @@ cmd_join_pane_exec(struct cmd *self, struct cmd_q *cmdq) else not_same_window = 0; - dst_s = cmdq->state.tflag.s; - dst_wl = cmdq->state.tflag.wl; - dst_wp = cmdq->state.tflag.wp; + dst_s = item->state.tflag.s; + dst_wl = item->state.tflag.wl; + dst_wp = item->state.tflag.wp; dst_w = dst_wl->window; dst_idx = dst_wl->idx; server_unzoom_window(dst_w); - src_wl = cmdq->state.sflag.wl; - src_wp = cmdq->state.sflag.wp; + src_wl = item->state.sflag.wl; + src_wp = item->state.sflag.wp; src_w = src_wl->window; server_unzoom_window(src_w); if (not_same_window && src_w == dst_w) { - cmdq_error(cmdq, "can't join a pane to its own window"); + cmdq_error(item, "can't join a pane to its own window"); return (CMD_RETURN_ERROR); } if (!not_same_window && src_wp == dst_wp) { - cmdq_error(cmdq, "source and target panes must be different"); + cmdq_error(item, "source and target panes must be different"); return (CMD_RETURN_ERROR); } @@ -107,14 +107,14 @@ cmd_join_pane_exec(struct cmd *self, struct cmd_q *cmdq) if (args_has(args, 'l')) { size = args_strtonum(args, 'l', 0, INT_MAX, &cause); if (cause != NULL) { - cmdq_error(cmdq, "size %s", cause); + cmdq_error(item, "size %s", cause); free(cause); return (CMD_RETURN_ERROR); } } else if (args_has(args, 'p')) { percentage = args_strtonum(args, 'p', 0, 100, &cause); if (cause != NULL) { - cmdq_error(cmdq, "percentage %s", cause); + cmdq_error(item, "percentage %s", cause); free(cause); return (CMD_RETURN_ERROR); } @@ -125,7 +125,7 @@ cmd_join_pane_exec(struct cmd *self, struct cmd_q *cmdq) } lc = layout_split_pane(dst_wp, type, size, args_has(args, 'b'), 0); if (lc == NULL) { - cmdq_error(cmdq, "create pane failed: pane too small"); + cmdq_error(item, "create pane failed: pane too small"); return (CMD_RETURN_ERROR); } diff --git a/cmd-kill-pane.c b/cmd-kill-pane.c index 76829aa3..59bbd19e 100644 --- a/cmd-kill-pane.c +++ b/cmd-kill-pane.c @@ -26,7 +26,7 @@ * Kill pane. */ -static enum cmd_retval cmd_kill_pane_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_kill_pane_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_kill_pane_entry = { .name = "kill-pane", @@ -42,10 +42,10 @@ const struct cmd_entry cmd_kill_pane_entry = { }; static enum cmd_retval -cmd_kill_pane_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_kill_pane_exec(struct cmd *self, struct cmdq_item *item) { - struct winlink *wl = cmdq->state.tflag.wl; - struct window_pane *loopwp, *tmpwp, *wp = cmdq->state.tflag.wp; + struct winlink *wl = item->state.tflag.wl; + struct window_pane *loopwp, *tmpwp, *wp = item->state.tflag.wp; server_unzoom_window(wl->window); diff --git a/cmd-kill-server.c b/cmd-kill-server.c index bbb4e8a0..d7eba692 100644 --- a/cmd-kill-server.c +++ b/cmd-kill-server.c @@ -27,7 +27,7 @@ * Kill the server and do nothing else. */ -static enum cmd_retval cmd_kill_server_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_kill_server_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_kill_server_entry = { .name = "kill-server", @@ -52,7 +52,7 @@ const struct cmd_entry cmd_start_server_entry = { }; static enum cmd_retval -cmd_kill_server_exec(struct cmd *self, __unused struct cmd_q *cmdq) +cmd_kill_server_exec(struct cmd *self, __unused struct cmdq_item *item) { if (self->entry == &cmd_kill_server_entry) kill(getpid(), SIGTERM); diff --git a/cmd-kill-session.c b/cmd-kill-session.c index ec7d5fb2..200fe4f9 100644 --- a/cmd-kill-session.c +++ b/cmd-kill-session.c @@ -27,7 +27,7 @@ * Note this deliberately has no alias to make it hard to hit by accident. */ -static enum cmd_retval cmd_kill_session_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_kill_session_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_kill_session_entry = { .name = "kill-session", @@ -43,13 +43,13 @@ const struct cmd_entry cmd_kill_session_entry = { }; static enum cmd_retval -cmd_kill_session_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_kill_session_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct session *s, *sloop, *stmp; struct winlink *wl; - s = cmdq->state.tflag.s; + s = item->state.tflag.s; if (args_has(args, 'C')) { RB_FOREACH(wl, winlinks, &s->windows) { diff --git a/cmd-kill-window.c b/cmd-kill-window.c index c7534d5c..6365aecb 100644 --- a/cmd-kill-window.c +++ b/cmd-kill-window.c @@ -24,7 +24,7 @@ * Destroy window. */ -static enum cmd_retval cmd_kill_window_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_kill_window_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_kill_window_entry = { .name = "kill-window", @@ -53,16 +53,16 @@ const struct cmd_entry cmd_unlink_window_entry = { }; static enum cmd_retval -cmd_kill_window_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_kill_window_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct winlink *wl = cmdq->state.tflag.wl, *wl2, *wl3; + struct winlink *wl = item->state.tflag.wl, *wl2, *wl3; struct window *w = wl->window; - struct session *s = cmdq->state.tflag.s; + struct session *s = item->state.tflag.s; if (self->entry == &cmd_unlink_window_entry) { if (!args_has(self->args, 'k') && !session_is_linked(s, w)) { - cmdq_error(cmdq, "window only linked to one session"); + cmdq_error(item, "window only linked to one session"); return (CMD_RETURN_ERROR); } server_unlink_window(s, wl); diff --git a/cmd-list-buffers.c b/cmd-list-buffers.c index f474b398..c67c3524 100644 --- a/cmd-list-buffers.c +++ b/cmd-list-buffers.c @@ -30,7 +30,7 @@ #define LIST_BUFFERS_TEMPLATE \ "#{buffer_name}: #{buffer_size} bytes: \"#{buffer_sample}\"" -static enum cmd_retval cmd_list_buffers_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_list_buffers_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_list_buffers_entry = { .name = "list-buffers", @@ -44,7 +44,7 @@ const struct cmd_entry cmd_list_buffers_entry = { }; static enum cmd_retval -cmd_list_buffers_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_list_buffers_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct paste_buffer *pb; @@ -57,11 +57,11 @@ cmd_list_buffers_exec(struct cmd *self, struct cmd_q *cmdq) pb = NULL; while ((pb = paste_walk(pb)) != NULL) { - ft = format_create(cmdq, 0); + ft = format_create(item, 0); format_defaults_paste_buffer(ft, pb); line = format_expand(ft, template); - cmdq_print(cmdq, "%s", line); + cmdq_print(item, "%s", line); free(line); format_free(ft); diff --git a/cmd-list-clients.c b/cmd-list-clients.c index d4bf02a9..f07cd45e 100644 --- a/cmd-list-clients.c +++ b/cmd-list-clients.c @@ -33,7 +33,7 @@ "[#{client_width}x#{client_height} #{client_termname}]" \ "#{?client_utf8, (utf8),} #{?client_readonly, (ro),}" -static enum cmd_retval cmd_list_clients_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_list_clients_exec(struct cmd *, struct cmdq_item *); const struct cmd_entry cmd_list_clients_entry = { .name = "list-clients", @@ -49,7 +49,7 @@ const struct cmd_entry cmd_list_clients_entry = { }; static enum cmd_retval -cmd_list_clients_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_list_clients_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct client *c; @@ -60,7 +60,7 @@ cmd_list_clients_exec(struct cmd *self, struct cmd_q *cmdq) char *line; if (args_has(args, 't')) - s = cmdq->state.tflag.s; + s = item->state.tflag.s; else s = NULL; @@ -72,12 +72,12 @@ cmd_list_clients_exec(struct cmd *self, struct cmd_q *cmdq) if (c->session == NULL || (s != NULL && s != c->session)) continue; - ft = format_create(cmdq, 0); + ft = format_create(item, 0); format_add(ft, "line", "%u", idx); format_defaults(ft, c, NULL, NULL, NULL); line = format_expand(ft, template); - cmdq_print(cmdq, "%s", line); + cmdq_print(item, "%s", line); free(line); format_free(ft); diff --git a/cmd-list-keys.c b/cmd-list-keys.c index 7823f475..f3462a10 100644 --- a/cmd-list-keys.c +++ b/cmd-list-keys.c @@ -27,10 +27,11 @@ * List key bindings. */ -static enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmdq_item *); -static enum cmd_retval cmd_list_keys_table(struct cmd *, struct cmd_q *); -static enum cmd_retval cmd_list_keys_commands(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_list_keys_table(struct cmd *, struct cmdq_item *); +static enum cmd_retval cmd_list_keys_commands(struct cmd *, + struct cmdq_item *); const struct cmd_entry cmd_list_keys_entry = { .name = "list-keys", @@ -55,7 +56,7 @@ const struct cmd_entry cmd_list_commands_entry = { }; static enum cmd_retval -cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_list_keys_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; struct key_table *table; @@ -65,14 +66,14 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq) int repeat, width, tablewidth, keywidth; if (self->entry == &cmd_list_commands_entry) - return (cmd_list_keys_commands(self, cmdq)); + return (cmd_list_keys_commands(self, item)); if (args_has(args, 't')) - return (cmd_list_keys_table(self, cmdq)); + return (cmd_list_keys_table(self, item)); tablename = args_get(args, 'T'); if (tablename != NULL && key_bindings_get_table(tablename, 0) == NULL) { - cmdq_error(cmdq, "table %s doesn't exist", tablename); + cmdq_error(item, "table %s doesn't exist", tablename); return (CMD_RETURN_ERROR); } @@ -124,7 +125,7 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq) strlcat(tmp, cp, sizeof tmp); free(cp); - cmdq_print(cmdq, "bind-key %s", tmp); + cmdq_print(item, "bind-key %s", tmp); } } @@ -132,7 +133,7 @@ cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq) } static enum cmd_retval -cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) +cmd_list_keys_table(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; const char *tablename, *cmdstr; @@ -142,7 +143,7 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) 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); } @@ -156,7 +157,7 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) RB_FOREACH(mbind, mode_key_tree, mtab->tree) { cmdstr = mode_key_tostring(mtab->cmdstr, mbind->cmd); if (cmdstr != NULL) { - cmdq_print(cmdq, "bind-key -t %s %*s %s", + cmdq_print(item, "bind-key -t %s %*s %s", mtab->name, (int)keywidth, key_string_lookup_key(mbind->key), cmdstr); } @@ -166,13 +167,13 @@ cmd_list_keys_table(struct cmd *self, struct cmd_q *cmdq) } static enum cmd_retval -cmd_list_keys_commands(struct cmd *self, struct cmd_q *cmdq) +cmd_list_keys_commands(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; const struct cmd_entry **entryp; const struct cmd_entry *entry; struct format_tree *ft; - const char *template; + const char *template, *s; char *line; if ((template = args_get(args, 'F')) == NULL) { @@ -181,25 +182,27 @@ cmd_list_keys_commands(struct cmd *self, struct cmd_q *cmdq) "#{command_list_usage}"; } - ft = format_create(cmdq, 0); + ft = format_create(item, 0); format_defaults(ft, NULL, NULL, NULL, NULL); for (entryp = cmd_table; *entryp != NULL; entryp++) { entry = *entryp; format_add(ft, "command_list_name", "%s", entry->name); - if (entry->alias != NULL) { - format_add(ft, "command_list_alias", "%s", - entry->alias); - } - if (entry->alias != NULL) { - format_add(ft, "command_list_usage", "%s", - entry->usage); - } + if (entry->alias != NULL) + s = entry->alias; + else + s = ""; + format_add(ft, "command_list_alias", "%s", s); + if (entry->usage != NULL) + s = entry->usage; + else + s = ""; + format_add(ft, "command_list_usage", "%s", s); line = format_expand(ft, template); if (*line != '\0') - cmdq_print(cmdq, "%s", line); + cmdq_print(item, "%s", line); free(line); } diff --git a/cmd-list-panes.c b/cmd-list-panes.c index 20663fd1..341bdd68 100644 --- a/cmd-list-panes.c +++ b/cmd-list-panes.c @@ -26,13 +26,13 @@ * List panes on given window. */ -static enum cmd_retval cmd_list_panes_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_list_panes_exec(struct cmd *, struct cmdq_item *); -static void cmd_list_panes_server(struct cmd *, struct cmd_q *); +static void cmd_list_panes_server(struct cmd *, struct cmdq_item *); static void cmd_list_panes_session(struct cmd *, struct session *, - struct cmd_q *, int); + struct cmdq_item *, int); static void cmd_list_panes_window(struct cmd *, struct session *, - struct winlink *, struct cmd_q *, int); + struct winlink *, struct cmdq_item *, int); const struct cmd_entry cmd_list_panes_entry = { .name = "list-panes", @@ -48,44 +48,44 @@ const struct cmd_entry cmd_list_panes_entry = { }; static enum cmd_retval -cmd_list_panes_exec(struct cmd *self, struct cmd_q *cmdq) +cmd_list_panes_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = self->args; - struct session *s = cmdq->state.tflag.s; - struct winlink *wl = cmdq->state.tflag.wl; + struct session *s = item->state.tflag.s; + struct winlink *wl = item->state.tflag.wl; if (args_has(args, 'a')) - cmd_list_panes_server(self, cmdq); + cmd_list_panes_server(self, item); else if (args_has(args, 's')) - cmd_list_panes_session(self, s, cmdq, 1); + cmd_list_panes_session(self, s, item, 1); else - cmd_list_panes_window(self, s, wl, cmdq, 0); + cmd_list_panes_window(self, s, wl, item, 0); return (CMD_RETURN_NORMAL); } static void -cmd_list_panes_server(struct cmd *self, struct cmd_q *cmdq) +cmd_list_panes_server(struct cmd *self, struct cmdq_item *item) { struct session *s; RB_FOREACH(s, sessions, &sessions) - cmd_list_panes_session(self, s, cmdq, 2); + cmd_list_panes_session(self, s, item, 2); } static void -cmd_list_panes_session(struct cmd *self, struct session *s, struct cmd_q *cmdq, - int type) +cmd_list_panes_session(struct cmd *self, struct session *s, + struct cmdq_item *item, int type) { struct winlink *wl; RB_FOREACH(wl, winlinks, &s->windows) - cmd_list_panes_window(self, s, wl, cmdq, type); + cmd_list_panes_window(self, s, wl, item, type); } static void cmd_list_panes_window(struct cmd *self, struct session *s, struct winlink *wl, - struct cmd_q *cmdq, int type) + struct cmdq_item *item, int type) { struct args *args = self->args; struct window_pane *wp; @@ -123,12 +123,12 @@ cmd_list_panes_window(struct cmd *self, struct session *s, struct winlink *wl, n = 0; TAILQ_FOREACH(wp, &wl->window->panes, entry) { - ft = format_create(cmdq, 0); + ft = format_create(item, 0); format_add(ft, "line", "%u", n); format_defaults(ft, NULL, s, wl, wp); line = format_expand(ft, template); - cmdq_print(cmdq, "%s", line); + cmdq_print(item, "%s", line); free(line); format_free(ft); diff --git a/cmd-list-sessions.c b/cmd-list-sessions.c index bc352d25..d90c8970 100644 --- a/cmd-list-sessions.c +++ b/cmd-list-sessions.c @@ -36,7 +36,8 @@ "#{session_group}#{?session_grouped,),}" \ "#{?session_attached, (attached),}" -static enum cmd_retval cmd_list_sessions_exec(struct cmd *, struct cmd_q *); +static enum cmd_retval cmd_list_ses