diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-13 14:04:26 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2020-04-13 14:04:26 +0000 |
commit | b38a262a57ad0941a41ed3626664891772f6444e (patch) | |
tree | 6cda239574af188610e7a10cc59dc1545b001ee3 | |
parent | f332e1470fe1588871275b0439ceffa0f7bddf66 (diff) |
Rename cmdq_shared to cmdq_state which will better reflect what it is
(going to be) used for.
-rw-r--r-- | usr.bin/tmux/cmd-attach-session.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-break-pane.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-copy-mode.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-display-menu.c | 16 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-find.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-if-shell.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-join-pane.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-new-session.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-new-window.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-queue.c | 64 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-resize-pane.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-rotate-window.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-select-pane.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-select-window.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-send-keys.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-split-window.c | 6 | ||||
-rw-r--r-- | usr.bin/tmux/cmd-switch-client.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/control.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/format.c | 8 | ||||
-rw-r--r-- | usr.bin/tmux/key-bindings.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/menu.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/notify.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/popup.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 14 |
24 files changed, 112 insertions, 112 deletions
diff --git a/usr.bin/tmux/cmd-attach-session.c b/usr.bin/tmux/cmd-attach-session.c index c31adab30cb..29f0d3b9846 100644 --- a/usr.bin/tmux/cmd-attach-session.c +++ b/usr.bin/tmux/cmd-attach-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-attach-session.c,v 1.81 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-attach-session.c,v 1.82 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -50,8 +50,8 @@ enum cmd_retval cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, int xflag, int rflag, const char *cflag, int Eflag) { - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state target; enum cmd_find_type type; int flags; @@ -120,7 +120,7 @@ cmd_attach_session(struct cmdq_item *item, const char *tflag, int dflag, environ_update(s->options, c->environ, s->environ); c->session = s; - if (~shared->flags & CMDQ_SHARED_REPEAT) + if (~state->flags & CMDQ_STATE_REPEAT) server_client_set_key_table(c, NULL); tty_update_client_offset(c); status_timer_start(c); diff --git a/usr.bin/tmux/cmd-break-pane.c b/usr.bin/tmux/cmd-break-pane.c index 96a9029e966..0574bb8e7d3 100644 --- a/usr.bin/tmux/cmd-break-pane.c +++ b/usr.bin/tmux/cmd-break-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-break-pane.c,v 1.52 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-break-pane.c,v 1.53 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -49,8 +49,8 @@ static enum cmd_retval cmd_break_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct cmd_find_state *source = cmdq_get_source(item); struct client *c = cmd_find_client(item, NULL, 1); diff --git a/usr.bin/tmux/cmd-copy-mode.c b/usr.bin/tmux/cmd-copy-mode.c index 39280838ca1..1af491c58ad 100644 --- a/usr.bin/tmux/cmd-copy-mode.c +++ b/usr.bin/tmux/cmd-copy-mode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-copy-mode.c,v 1.44 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: cmd-copy-mode.c,v 1.45 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -57,7 +57,7 @@ static enum cmd_retval cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); + struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *source = cmdq_get_source(item); struct cmd_find_state *target = cmdq_get_target(item); struct client *c = cmdq_get_client(item); @@ -70,7 +70,7 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item) } if (args_has(args, 'M')) { - if ((wp = cmd_mouse_pane(&shared->event.m, &s, NULL)) == NULL) + if ((wp = cmd_mouse_pane(&state->event.m, &s, NULL)) == NULL) return (CMD_RETURN_NORMAL); if (c == NULL || c->session != s) return (CMD_RETURN_NORMAL); @@ -87,7 +87,7 @@ cmd_copy_mode_exec(struct cmd *self, struct cmdq_item *item) swp = wp; if (!window_pane_set_mode(wp, swp, &window_copy_mode, NULL, args)) { if (args_has(args, 'M')) - window_copy_start_drag(c, &shared->event.m); + window_copy_start_drag(c, &state->event.m); } if (args_has(args, 'u')) window_copy_pageup(wp, 0); diff --git a/usr.bin/tmux/cmd-display-menu.c b/usr.bin/tmux/cmd-display-menu.c index f1f00592aa6..51b57bec412 100644 --- a/usr.bin/tmux/cmd-display-menu.c +++ b/usr.bin/tmux/cmd-display-menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-menu.c,v 1.15 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: cmd-display-menu.c,v 1.16 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -65,7 +65,7 @@ static void cmd_display_menu_get_position(struct client *c, struct cmdq_item *item, struct args *args, u_int *px, u_int *py, u_int w, u_int h) { - struct cmdq_shared *shared = cmdq_get_shared(item); + struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *target = cmdq_get_target(item); struct session *s = c->session; struct winlink *wl = target->wl; @@ -100,8 +100,8 @@ cmd_display_menu_get_position(struct client *c, struct cmdq_item *item, else *px = 0; } else if (strcmp(xp, "M") == 0) { - if (shared->event.m.valid && shared->event.m.x > w / 2) - *px = shared->event.m.x - w / 2; + if (state->event.m.valid && state->event.m.x > w / 2) + *px = state->event.m.x - w / 2; else *px = 0; } else if (strcmp(xp, "W") == 0) { @@ -134,8 +134,8 @@ cmd_display_menu_get_position(struct client *c, struct cmdq_item *item, else *py = 0; } else if (strcmp(yp, "M") == 0) { - if (shared->event.m.valid) - *py = shared->event.m.y + h; + if (state->event.m.valid) + *py = state->event.m.y + h; else *py = 0; } else if (strcmp(yp, "S") == 0) { @@ -176,7 +176,7 @@ static enum cmd_retval cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); + struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *target = cmdq_get_target(item); struct client *c; struct menu *menu = NULL; @@ -230,7 +230,7 @@ cmd_display_menu_exec(struct cmd *self, struct cmdq_item *item) cmd_display_menu_get_position(c, item, args, &px, &py, menu->width + 4, menu->count + 2); - if (!shared->event.m.valid) + if (!state->event.m.valid) flags |= MENU_NOMOUSE; if (menu_display(menu, flags, item, px, py, c, target, NULL, NULL) != 0) return (CMD_RETURN_NORMAL); diff --git a/usr.bin/tmux/cmd-find.c b/usr.bin/tmux/cmd-find.c index 73a225343dc..5233f0fb693 100644 --- a/usr.bin/tmux/cmd-find.c +++ b/usr.bin/tmux/cmd-find.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-find.c,v 1.76 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: cmd-find.c,v 1.77 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -961,8 +961,8 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, if (server_check_marked() && (flags & CMD_FIND_DEFAULT_MARKED)) { fs->current = &marked_pane; log_debug("%s: current is marked pane", __func__); - } else if (cmd_find_valid_state(&cmdq_get_shared(item)->current)) { - fs->current = &cmdq_get_shared(item)->current; + } else if (cmd_find_valid_state(&cmdq_get_state(item)->current)) { + fs->current = &cmdq_get_state(item)->current; log_debug("%s: current is from queue", __func__); } else if (cmd_find_from_client(¤t, cmdq_get_client(item), flags) == 0) { @@ -982,7 +982,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item, /* Mouse target is a plain = or {mouse}. */ if (strcmp(target, "=") == 0 || strcmp(target, "{mouse}") == 0) { - m = &cmdq_get_shared(item)->event.m; + m = &cmdq_get_state(item)->event.m; switch (type) { case CMD_FIND_PANE: fs->wp = cmd_mouse_pane(m, &fs->s, &fs->wl); diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c index 5be4a8699ab..e070ee9eb47 100644 --- a/usr.bin/tmux/cmd-if-shell.c +++ b/usr.bin/tmux/cmd-if-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-if-shell.c,v 1.69 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: cmd-if-shell.c,v 1.70 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org> @@ -63,9 +63,9 @@ static enum cmd_retval cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); + struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *target = cmdq_get_target(item); - struct mouse_event *m = &shared->event.m; + struct mouse_event *m = &state->event.m; struct cmd_if_shell_data *cdata; char *shellcmd, *cmd; const char *file; diff --git a/usr.bin/tmux/cmd-join-pane.c b/usr.bin/tmux/cmd-join-pane.c index 3d9db557660..96505eaccc0 100644 --- a/usr.bin/tmux/cmd-join-pane.c +++ b/usr.bin/tmux/cmd-join-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-join-pane.c,v 1.41 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-join-pane.c,v 1.42 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2011 George Nachman <tmux@georgester.com> @@ -64,8 +64,8 @@ static enum cmd_retval cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct cmd_find_state *source = cmdq_get_source(item); struct session *dst_s; diff --git a/usr.bin/tmux/cmd-new-session.c b/usr.bin/tmux/cmd-new-session.c index da79e3c88ed..de1b5be13f8 100644 --- a/usr.bin/tmux/cmd-new-session.c +++ b/usr.bin/tmux/cmd-new-session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-session.c,v 1.126 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-new-session.c,v 1.127 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -67,8 +67,8 @@ static enum cmd_retval cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct client *c = cmdq_get_client(item); struct session *s, *as, *groupwith; @@ -317,7 +317,7 @@ cmd_new_session_exec(struct cmd *self, struct cmdq_item *item) } else if (c->session != NULL) c->last_session = c->session; c->session = s; - if (~shared->flags & CMDQ_SHARED_REPEAT) + if (~state->flags & CMDQ_STATE_REPEAT) server_client_set_key_table(c, NULL); tty_update_client_offset(c); status_timer_start(c); diff --git a/usr.bin/tmux/cmd-new-window.c b/usr.bin/tmux/cmd-new-window.c index 2059e9d7e6a..1c52d697a6f 100644 --- a/usr.bin/tmux/cmd-new-window.c +++ b/usr.bin/tmux/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-window.c,v 1.84 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-new-window.c,v 1.85 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -52,8 +52,8 @@ static enum cmd_retval cmd_new_window_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct spawn_context sc; struct client *c = cmd_find_client(item, NULL, 1); diff --git a/usr.bin/tmux/cmd-queue.c b/usr.bin/tmux/cmd-queue.c index c2261e5a88b..279757f053a 100644 --- a/usr.bin/tmux/cmd-queue.c +++ b/usr.bin/tmux/cmd-queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-queue.c,v 1.85 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: cmd-queue.c,v 1.86 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2013 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -51,7 +51,7 @@ struct cmdq_item { int flags; - struct cmdq_shared *shared; + struct cmdq_state *state; struct cmd_find_state source; struct cmd_find_state target; @@ -142,11 +142,11 @@ cmdq_get_source(struct cmdq_item *item) return (&item->source); } -/* Get item shared. */ -struct cmdq_shared * -cmdq_get_shared(struct cmdq_item *item) +/* Get item state. */ +struct cmdq_state * +cmdq_get_state(struct cmdq_item *item) { - return (item->shared); + return (item->state); } /* Merge formats from item. */ @@ -159,8 +159,8 @@ cmdq_merge_formats(struct cmdq_item *item, struct format_tree *ft) entry = cmd_get_entry (item->cmd); format_add(ft, "command", "%s", entry->name); } - if (item->shared->formats != NULL) - format_merge(ft, item->shared->formats); + if (item->state->formats != NULL) + format_merge(ft, item->state->formats); } /* Append an item. */ @@ -228,7 +228,7 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item, struct options_array_item *a; struct cmd_list *cmdlist; - if (item->shared->flags & CMDQ_SHARED_NOHOOKS) + if (item->state->flags & CMDQ_STATE_NOHOOKS) return; if (s == NULL) oo = global_s_options; @@ -255,7 +255,7 @@ cmdq_insert_hook(struct session *s, struct cmdq_item *item, } new_item = cmdq_get_command(cmdlist, fs, NULL, - CMDQ_SHARED_NOHOOKS); + CMDQ_STATE_NOHOOKS); cmdq_format(new_item, "hook", "%s", name); if (item != NULL) item = cmdq_insert_after(item, new_item); @@ -279,10 +279,10 @@ cmdq_continue(struct cmdq_item *item) static void cmdq_remove(struct cmdq_item *item) { - if (item->shared != NULL && --item->shared->references == 0) { - if (item->shared->formats != NULL) - format_free(item->shared->formats); - free(item->shared); + if (item->state != NULL && --item->state->references == 0) { + if (item->state->formats != NULL) + format_free(item->state->formats); + free(item->state); } if (item->client != NULL) @@ -322,23 +322,23 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current, struct cmdq_item *item, *first = NULL, *last = NULL; struct cmd *cmd; const struct cmd_entry *entry; - struct cmdq_shared *shared = NULL; + struct cmdq_state *state = NULL; u_int group, last_group = 0; cmd = cmd_list_first(cmdlist, &group); while (cmd != NULL) { if (group != last_group) { - shared = xcalloc(1, sizeof *shared); + state = xcalloc(1, sizeof *state); if (current != NULL) - cmd_find_copy_state(&shared->current, current); + cmd_find_copy_state(&state->current, current); else - cmd_find_clear_state(&shared->current, 0); + cmd_find_clear_state(&state->current, 0); if (m != NULL) { - shared->event.key = KEYC_NONE; - memcpy(&shared->event.m, m, - sizeof shared->event.m); + state->event.key = KEYC_NONE; + memcpy(&state->event.m, m, + sizeof state->event.m); } - shared->flags = flags; + state->flags = flags; last_group = group; } entry = cmd_get_entry(cmd); @@ -348,13 +348,13 @@ cmdq_get_command(struct cmd_list *cmdlist, struct cmd_find_state *current, item->type = CMDQ_COMMAND; item->group = group; - item->shared = shared; + item->state = state; item->cmdlist = cmdlist; item->cmd = cmd; log_debug("%s: %s group %u", __func__, item->name, item->group); - shared->references++; + state->references++; cmdlist->references++; if (first == NULL) @@ -394,7 +394,7 @@ cmdq_fire_command(struct cmdq_item *item) { struct client *c = item->client; const char *name = cmdq_name(c); - struct cmdq_shared *shared = item->shared; + struct cmdq_state *state = item->state; struct cmd *cmd = item->cmd; const struct cmd_entry *entry = cmd_get_entry(cmd); enum cmd_retval retval; @@ -408,7 +408,7 @@ cmdq_fire_command(struct cmdq_item *item) free(tmp); } - flags = !!(shared->flags & CMDQ_SHARED_CONTROL); + flags = !!(state->flags & CMDQ_STATE_CONTROL); cmdq_guard(item, "begin", flags); if (item->client == NULL) @@ -427,8 +427,8 @@ cmdq_fire_command(struct cmdq_item *item) if (entry->flags & CMD_AFTERHOOK) { if (cmd_find_valid_state(&item->target)) fsp = &item->target; - else if (cmd_find_valid_state(&item->shared->current)) - fsp = &item->shared->current; + else if (cmd_find_valid_state(&item->state->current)) + fsp = &item->state->current; else if (cmd_find_from_client(&fs, item->client, 0) == 0) fsp = &fs; else @@ -492,7 +492,7 @@ cmdq_fire_callback(struct cmdq_item *item) void cmdq_format(struct cmdq_item *item, const char *key, const char *fmt, ...) { - struct cmdq_shared *shared = item->shared; + struct cmdq_state *state = item->state; va_list ap; char *value; @@ -500,9 +500,9 @@ cmdq_format(struct cmdq_item *item, const char *key, const char *fmt, ...) xvasprintf(&value, fmt, ap); va_end(ap); - if (shared->formats == NULL) - shared->formats = format_create(NULL, NULL, FORMAT_NONE, 0); - format_add(shared->formats, key, "%s", value); + if (state->formats == NULL) + state->formats = format_create(NULL, NULL, FORMAT_NONE, 0); + format_add(state->formats, key, "%s", value); free(value); } diff --git a/usr.bin/tmux/cmd-resize-pane.c b/usr.bin/tmux/cmd-resize-pane.c index c0f1c8b9923..0d8c12ad0f1 100644 --- a/usr.bin/tmux/cmd-resize-pane.c +++ b/usr.bin/tmux/cmd-resize-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-resize-pane.c,v 1.44 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: cmd-resize-pane.c,v 1.45 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -50,7 +50,7 @@ static enum cmd_retval cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); + struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *target = cmdq_get_target(item); struct window_pane *wp = target->wp; struct winlink *wl = target->wl; @@ -76,12 +76,12 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item) } if (args_has(args, 'M')) { - if (cmd_mouse_window(&shared->event.m, &s) == NULL) + if (cmd_mouse_window(&state->event.m, &s) == NULL) return (CMD_RETURN_NORMAL); if (c == NULL || c->session != s) return (CMD_RETURN_NORMAL); c->tty.mouse_drag_update = cmd_resize_pane_mouse_update; - cmd_resize_pane_mouse_update(c, &shared->event.m); + cmd_resize_pane_mouse_update(c, &state->event.m); return (CMD_RETURN_NORMAL); } diff --git a/usr.bin/tmux/cmd-rotate-window.c b/usr.bin/tmux/cmd-rotate-window.c index 34c8b948907..f609ebb0d0e 100644 --- a/usr.bin/tmux/cmd-rotate-window.c +++ b/usr.bin/tmux/cmd-rotate-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-rotate-window.c,v 1.29 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-rotate-window.c,v 1.30 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -44,8 +44,8 @@ static enum cmd_retval cmd_rotate_window_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct winlink *wl = target->wl; struct window *w = wl->window; diff --git a/usr.bin/tmux/cmd-select-pane.c b/usr.bin/tmux/cmd-select-pane.c index 064935551ba..c9f41a84c75 100644 --- a/usr.bin/tmux/cmd-select-pane.c +++ b/usr.bin/tmux/cmd-select-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-pane.c,v 1.56 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-select-pane.c,v 1.57 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -85,8 +85,8 @@ cmd_select_pane_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); const struct cmd_entry *entry = cmd_get_entry(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct client *c = cmd_find_client(item, NULL, 1); struct winlink *wl = target->wl; diff --git a/usr.bin/tmux/cmd-select-window.c b/usr.bin/tmux/cmd-select-window.c index 02bb124c50d..f05e7b7d6ca 100644 --- a/usr.bin/tmux/cmd-select-window.c +++ b/usr.bin/tmux/cmd-select-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-select-window.c,v 1.25 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-select-window.c,v 1.26 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -85,8 +85,8 @@ static enum cmd_retval cmd_select_window_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct winlink *wl = target->wl; struct session *s = target->s; diff --git a/usr.bin/tmux/cmd-send-keys.c b/usr.bin/tmux/cmd-send-keys.c index d4e72e4d4fb..2b1150f057a 100644 --- a/usr.bin/tmux/cmd-send-keys.c +++ b/usr.bin/tmux/cmd-send-keys.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-send-keys.c,v 1.57 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: cmd-send-keys.c,v 1.58 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -134,13 +134,13 @@ static enum cmd_retval cmd_send_keys_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); + struct cmdq_state *state = cmdq_get_state(item); struct cmd_find_state *target = cmdq_get_target(item); struct client *c = cmd_find_client(item, NULL, 1); struct window_pane *wp = target->wp; struct session *s = target->s; struct winlink *wl = target->wl; - struct mouse_event *m = &shared->event.m; + struct mouse_event *m = &state->event.m; struct window_mode_entry *wme = TAILQ_FIRST(&wp->modes); int i; key_code key; diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c index 6b170516f89..4f8b01ddb39 100644 --- a/usr.bin/tmux/cmd-split-window.c +++ b/usr.bin/tmux/cmd-split-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-split-window.c,v 1.100 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-split-window.c,v 1.101 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -54,8 +54,8 @@ static enum cmd_retval cmd_split_window_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state *target = cmdq_get_target(item); struct spawn_context sc; struct client *c = cmd_find_client(item, NULL, 1); diff --git a/usr.bin/tmux/cmd-switch-client.c b/usr.bin/tmux/cmd-switch-client.c index c45ad8d5f27..23d74af1143 100644 --- a/usr.bin/tmux/cmd-switch-client.c +++ b/usr.bin/tmux/cmd-switch-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-switch-client.c,v 1.62 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: cmd-switch-client.c,v 1.63 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -48,8 +48,8 @@ static enum cmd_retval cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item) { struct args *args = cmd_get_args(self); - struct cmdq_shared *shared = cmdq_get_shared(item); - struct cmd_find_state *current = &shared->current; + struct cmdq_state *state = cmdq_get_state(item); + struct cmd_find_state *current = &state->current; struct cmd_find_state target; const char *tflag = args_get(args, 't'); enum cmd_find_type type; @@ -137,7 +137,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item) if (c->session != NULL && c->session != s) c->last_session = c->session; c->session = s; - if (~shared->flags & CMDQ_SHARED_REPEAT) + if (~state->flags & CMDQ_STATE_REPEAT) server_client_set_key_table(c, NULL); tty_update_client_offset(c); status_timer_start(c); diff --git a/usr.bin/tmux/control.c b/usr.bin/tmux/control.c index 845838ab59d..dc551500fc6 100644 --- a/usr.bin/tmux/control.c +++ b/usr.bin/tmux/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.26 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: control.c,v 1.27 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2012 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -86,7 +86,7 @@ control_callback(__unused struct client *c, __unused const char *path, break; case CMD_PARSE_SUCCESS: item = cmdq_get_command(pr->cmdlist, NULL, NULL, 0); - cmdq_get_shared(item)->flags |= CMDQ_SHARED_CONTROL; + cmdq_get_state(item)->flags |= CMDQ_STATE_CONTROL; cmdq_append(c, item); cmd_list_free(pr->cmdlist); break; diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index dd4b8018850..5e99bd57e43 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.238 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.239 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1124,16 +1124,16 @@ format_merge(struct format_tree *ft, struct format_tree *from) static void format_create_add_item(struct format_tree *ft, struct cmdq_item *item) { - struct cmdq_shared *shared = cmdq_get_shared(item); + struct cmdq_state *state = cmdq_get_state(item); struct mouse_event *m; struct window_pane *wp; u_int x, y; cmdq_merge_formats(item, ft); - if (shared == NULL) + if (state == NULL) return; - m = &shared->event.m; + m = &state->event.m; if (m->valid && ((wp = cmd_mouse_pane(m, NULL, NULL)) != NULL)) { format_add(ft, "mouse_pane", "%%%u", wp->id); if (cmd_mouse_at(wp, m, &x, &y, 0) == 0) { diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c index 00c21019195..ba4848982cb 100644 --- a/usr.bin/tmux/key-bindings.c +++ b/usr.bin/tmux/key-bindings.c @@ -1,4 +1,4 @@ -/* $OpenBSD: key-bindings.c,v 1.119 2020/04/13 10:59:58 nicm Exp $ */ +/* $OpenBSD: key-bindings.c,v 1.120 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -549,7 +549,7 @@ key_bindings_dispatch(struct key_binding *bd, struct cmdq_item *item, else { new_item = cmdq_get_command(bd->cmdlist, fs, m, 0); if (bd->flags & KEY_BINDING_REPEAT) - cmdq_get_shared(new_item)->flags |= CMDQ_SHARED_REPEAT; + cmdq_get_state(new_item)->flags |= CMDQ_STATE_REPEAT; } if (item != NULL) new_item = cmdq_insert_after(item, new_item); diff --git a/usr.bin/tmux/menu.c b/usr.bin/tmux/menu.c index 5c60f6dbb43..a6ce64fe865 100644 --- a/usr.bin/tmux/menu.c +++ b/usr.bin/tmux/menu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: menu.c,v 1.17 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: menu.c,v 1.18 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -282,7 +282,7 @@ chosen: break; case CMD_PARSE_SUCCESS: if (md->item != NULL) - m = &cmdq_get_shared(md->item)->event.m; + m = &cmdq_get_state(md->item)->event.m; else m = NULL; new_item = cmdq_get_command(pr->cmdlist, &md->fs, m, 0); diff --git a/usr.bin/tmux/notify.c b/usr.bin/tmux/notify.c index 46aa186f7c5..6755ec4262e 100644 --- a/usr.bin/tmux/notify.c +++ b/usr.bin/tmux/notify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: notify.c,v 1.32 2020/04/13 13:32:09 nicm Exp $ */ +/* $OpenBSD: notify.c,v 1.33 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2012 George Nachman <tmux@georgester.com> @@ -96,7 +96,7 @@ notify_insert_hook(struct cmdq_item *item, struct notify_entry *ne) } new_item = cmdq_get_command(cmdlist, &fs, NULL, - CMDQ_SHARED_NOHOOKS); + CMDQ_STATE_NOHOOKS); cmdq_format(new_item, "hook", "%s", ne->name); notify_hook_formats(new_item, s, w, ne->pane); item = cmdq_insert_after(item, new_item); diff --git a/usr.bin/tmux/popup.c b/usr.bin/tmux/popup.c index 1903ca5425d..047c4bc8167 100644 --- a/usr.bin/tmux/popup.c +++ b/usr.bin/tmux/popup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: popup.c,v 1.9 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: popup.c,v 1.10 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -305,7 +305,7 @@ popup_key_cb(struct client *c, struct key_event *event) break; case CMD_PARSE_SUCCESS: if (pd->item != NULL) - m = &cmdq_get_shared(pd->item)->event.m; + m = &cmdq_get_state(pd->item)->event.m; else m = NULL; new_item = cmdq_get_command(pr->cmdlist, fs, m, 0); diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 380a88605f3..466c75d8923 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.984 2020/04/13 13:42:35 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.985 2020/04/13 14:04:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1378,14 +1378,14 @@ struct cmd_parse_input { struct cmd_find_state fs; }; -/* Command queue item shared state. */ -struct cmdq_shared { +/* Command queue item state. */ +struct cmdq_state { int references; int flags; -#define CMDQ_SHARED_REPEAT 0x1 -#define CMDQ_SHARED_CONTROL 0x2 -#define CMDQ_SHARED_NOHOOKS 0x4 +#define CMDQ_STATE_REPEAT 0x1 +#define CMDQ_STATE_CONTROL 0x2 +#define CMDQ_STATE_NOHOOKS 0x4 struct format_tree *formats; @@ -2108,7 +2108,7 @@ const char *cmdq_get_name(struct cmdq_item *); struct client *cmdq_get_client(struct cmdq_item *); struct cmd_find_state *cmdq_get_target(struct cmdq_item *); struct cmd_find_state *cmdq_get_source(struct cmdq_item *); -struct cmdq_shared *cmdq_get_shared(struct cmdq_item *); +struct cmdq_state *cmdq_get_state(struct cmdq_item *); void cmdq_merge_formats(struct cmdq_item *, struct format_tree *); struct cmdq_item *cmdq_get_command(struct cmd_list *, struct cmd_find_state *, struct mouse_event *, int); |