diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-04-21 14:01:20 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-04-21 14:01:20 +0000 |
commit | c521d87a41b11d6987fdcaf75709093b0a77e53a (patch) | |
tree | 7c33f37a1241ef688f36146b3479ca22637a7025 /usr.bin/tmux/tmux.h | |
parent | 012593b8fe9dfa1f026f22abd12ff45e0190cf7b (diff) |
Store state shared between multiple commands in the queue in a shared
structure.
Diffstat (limited to 'usr.bin/tmux/tmux.h')
-rw-r--r-- | usr.bin/tmux/tmux.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 3c46b8ded0b..2c02e644613 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.744 2017/04/20 17:49:26 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.745 2017/04/21 14:01:19 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -41,6 +41,7 @@ extern char **environ; struct args; struct client; struct cmdq_item; +struct cmdq_subitem; struct cmdq_list; struct environ; struct input_ctx; @@ -1204,6 +1205,19 @@ enum cmdq_type { CMDQ_CALLBACK, }; +/* Command queue item shared state. */ +struct cmdq_shared { + int references; + + int flags; +#define CMDQ_SHARED_REPEAT 0x1 + + struct format_tree *formats; + + struct mouse_event mouse; + struct cmd_find_state current; +}; + /* Command queue item. */ typedef enum cmd_retval (*cmdq_cb) (struct cmdq_item *, void *); struct cmdq_item { @@ -1219,25 +1233,20 @@ struct cmdq_item { u_int number; time_t time; - struct format_tree *formats; - int flags; #define CMDQ_FIRED 0x1 #define CMDQ_WAITING 0x2 #define CMDQ_NOHOOKS 0x4 + struct cmdq_shared *shared; struct cmd_list *cmdlist; struct cmd *cmd; - int repeat; cmdq_cb cb; void *data; - struct cmd_find_state current; struct cmd_state state; - struct mouse_event mouse; - TAILQ_ENTRY(cmdq_item) entry; }; TAILQ_HEAD(cmdq_list, cmdq_item); @@ -1394,7 +1403,9 @@ TAILQ_HEAD(clients, client); struct key_binding { key_code key; struct cmd_list *cmdlist; - int can_repeat; + + int flags; +#define KEY_BINDING_REPEAT 0x1 RB_ENTRY(key_binding) entry; }; |