diff options
author | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:37:32 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2012-07-11 19:37:32 +0000 |
commit | 1f5e6e35d5046693f0ef5ec76535f517757b7122 (patch) | |
tree | e53808c90f3a53279554f8580d2b96df606baec3 /tmux.h | |
parent | a432fcd30617610b46d65f49b7513bf5da5694de (diff) | |
download | rtmux-1f5e6e35d5046693f0ef5ec76535f517757b7122.tar.gz rtmux-1f5e6e35d5046693f0ef5ec76535f517757b7122.tar.bz2 rtmux-1f5e6e35d5046693f0ef5ec76535f517757b7122.zip |
Sync OpenBSD patchset 1151:
Make command exec functions return an enum rather than -1/0/1 values and
add a new value to mean "leave client running but don't attach" to fix
problems with using some commands in a command sequence. Most of the
work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -1327,6 +1327,13 @@ struct cmd_list { TAILQ_HEAD(, cmd) list; }; +enum cmd_retval { + CMD_RETURN_ERROR = -1, + CMD_RETURN_NORMAL = 0, + CMD_RETURN_YIELD, + CMD_RETURN_ATTACH +}; + struct cmd_entry { const char *name; const char *alias; @@ -1345,7 +1352,7 @@ struct cmd_entry { void (*key_binding)(struct cmd *, int); int (*check)(struct args *); - int (*exec)(struct cmd *, struct cmd_ctx *); + enum cmd_retval (*exec)(struct cmd *, struct cmd_ctx *); }; /* Key binding. */ @@ -1637,7 +1644,7 @@ int cmd_unpack_argv(char *, size_t, int, char ***); char **cmd_copy_argv(int, char *const *); void cmd_free_argv(int, char **); struct cmd *cmd_parse(int, char **, char **); -int cmd_exec(struct cmd *, struct cmd_ctx *); +enum cmd_retval cmd_exec(struct cmd *, struct cmd_ctx *); void cmd_free(struct cmd *); size_t cmd_print(struct cmd *, char *, size_t); struct session *cmd_current_session(struct cmd_ctx *, int); @@ -1741,7 +1748,7 @@ extern const struct cmd_entry cmd_up_pane_entry; /* cmd-list.c */ struct cmd_list *cmd_list_parse(int, char **, char **); -int cmd_list_exec(struct cmd_list *, struct cmd_ctx *); +enum cmd_retval cmd_list_exec(struct cmd_list *, struct cmd_ctx *); void cmd_list_free(struct cmd_list *); size_t cmd_list_print(struct cmd_list *, char *, size_t); |