=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tmux.h,v retrieving revision 1.602 retrieving revision 1.603 diff -c -r1.602 -r1.603 *** src/usr.bin/tmux/tmux.h 2015/12/12 18:32:24 1.602 --- src/usr.bin/tmux/tmux.h 2015/12/13 14:32:38 1.603 *************** *** 1,4 **** ! /* $OpenBSD: tmux.h,v 1.602 2015/12/12 18:32:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tmux.h,v 1.603 2015/12/13 14:32:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1293,1298 **** --- 1293,1312 ---- char **argv; }; + /* Context for a command about to be executed. */ + struct cmd_state_flag { + struct session *s; + struct winlink *wl; + struct window_pane *wp; + int idx; + + }; + struct cmd_state { + struct client *c; + struct cmd_state_flag tflag; + struct cmd_state_flag sflag; + }; + /* Command and list of commands. */ struct cmd { const struct cmd_entry *entry; *************** *** 1343,1348 **** --- 1357,1364 ---- struct cmd_q_item *item; struct cmd *cmd; + struct cmd_state state; + time_t time; u_int number; *************** *** 1365,1374 **** --- 1381,1411 ---- #define CMD_STARTSERVER 0x1 #define CMD_READONLY 0x2 + #define CMD_SESSION_T 0x4 + #define CMD_SESSION_S 0x8 + #define CMD_WINDOW_T 0x10 + #define CMD_WINDOW_S 0x20 + #define CMD_PANE_T 0x40 + #define CMD_PANE_S 0x80 + #define CMD_CLIENT_T 0x100 + #define CMD_CLIENT_C 0x200 + #define CMD_INDEX_T 0x400 + #define CMD_INDEX_S 0x800 + #define CMD_CANFAIL 0x1000 + #define CMD_PREFERUNATTACHED 0x2000 + #define CMD_MOVEW_R 0x4000 /* for movew -r only */ + #define CMD_PANE_MARKED_S 0x8000 + #define CMD_PANE_MARKED_T 0x10000 + #define CMD_WINDOW_MARKED_T 0x20000 + #define CMD_WINDOW_MARKED_S 0x40000 int flags; enum cmd_retval (*exec)(struct cmd *, struct cmd_q *); }; + #define CMD_ALL_T (CMD_SESSION_T|CMD_WINDOW_T|CMD_PANE_T|CMD_INDEX_T| \ + CMD_MOVEW_R|CMD_PANE_MARKED_T|CMD_WINDOW_MARKED_T) + #define CMD_ALL_S (CMD_SESSION_S|CMD_WINDOW_S|CMD_PANE_S|CMD_INDEX_S| \ + CMD_PANE_MARKED_S|CMD_WINDOW_MARKED_S) /* Key binding and key table. */ struct key_binding { *************** *** 1718,1723 **** --- 1755,1761 ---- void cmd_free_argv(int, char **); char *cmd_stringify_argv(int, char **); struct cmd *cmd_parse(int, char **, const char *, u_int, char **); + int cmd_prepare_state(struct cmd *, struct cmd_q *); char *cmd_print(struct cmd *); int cmd_mouse_at(struct window_pane *, struct mouse_event *, u_int *, u_int *, int); *************** *** 1728,1735 **** extern const struct cmd_entry *cmd_table[]; /* cmd-attach-session.c */ ! enum cmd_retval cmd_attach_session(struct cmd_q *, const char *, int, int, ! const char *, int); /* cmd-list.c */ struct cmd_list *cmd_list_parse(int, char **, const char *, u_int, char **); --- 1766,1773 ---- extern const struct cmd_entry *cmd_table[]; /* cmd-attach-session.c */ ! enum cmd_retval cmd_attach_session(struct cmd_q *, int, int, const char *, ! int); /* cmd-list.c */ struct cmd_list *cmd_list_parse(int, char **, const char *, u_int, char **);