aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-02-18 23:20:21 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-02-18 23:20:21 +0000
commit293e331d69def60110bdc49b6453af905e0509b3 (patch)
tree3dbb4230607dc6bb0a40d3a1e9b71d0f56774c7a /tmux.h
parent2a91025581ddaa934ffa471f5b27a33d19e4ea2d (diff)
downloadrtmux-293e331d69def60110bdc49b6453af905e0509b3.tar.gz
rtmux-293e331d69def60110bdc49b6453af905e0509b3.tar.bz2
rtmux-293e331d69def60110bdc49b6453af905e0509b3.zip
Add functions to allocate and free command contexts rather than doing it all on
the stack.
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/tmux.h b/tmux.h
index d602b145..df47cdb3 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1362,8 +1362,10 @@ struct cmd_ctx {
* cmdclient and curclient may both be NULL if the command is in the
* configuration file.
*/
- struct client *curclient;
- struct client *cmdclient;
+ struct client *curclient;
+ struct client *cmdclient;
+
+ int references;
struct msg_command_data *msgdata;
@@ -1710,13 +1712,14 @@ long long args_strtonum(
struct args *, u_char, long long, long long, char **);
/* cmd.c */
+struct cmd_ctx *cmd_get_ctx(void);
+void cmd_free_ctx(struct cmd_ctx *);
+void cmd_ref_ctx(struct cmd_ctx *);
int cmd_pack_argv(int, char **, char *, size_t);
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 **);
-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);
struct client *cmd_current_client(struct cmd_ctx *);