diff options
author | Thomas Adam <thomas@xteddy.org> | 2021-08-22 12:08:05 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2021-08-22 12:08:05 +0100 |
commit | 324f87cf142fb1b7ed8cd738316bdb3f6fa7c1df (patch) | |
tree | c1116c69cccb5f9c2af6dec76886d05e0a6e093e /tmux.h | |
parent | 921991c98d6fd596c958b07b5f5aba7c434e8f9f (diff) | |
parent | 0084cbef5ad9f1f860b50fb7c485ac841817b3a8 (diff) | |
download | rtmux-324f87cf142fb1b7ed8cd738316bdb3f6fa7c1df.tar.gz rtmux-324f87cf142fb1b7ed8cd738316bdb3f6fa7c1df.tar.bz2 rtmux-324f87cf142fb1b7ed8cd738316bdb3f6fa7c1df.zip |
Merge branch 'obsd-master' into master
Diffstat (limited to 'tmux.h')
-rw-r--r-- | tmux.h | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -1356,9 +1356,21 @@ struct message_entry { }; TAILQ_HEAD(message_list, message_entry); +/* Argument type. */ +enum args_type { + ARGS_NONE, + ARGS_STRING, + ARGS_COMMANDS +}; + /* Argument value. */ struct args_value { - char *string; + enum args_type type; + union { + char *string; + struct cmd_list *cmdlist; + }; + char *cached; TAILQ_ENTRY(args_value) entry; }; @@ -2186,10 +2198,12 @@ void tty_keys_free(struct tty *); int tty_keys_next(struct tty *); /* arguments.c */ -void args_set(struct args *, u_char, const char *); +void args_set(struct args *, u_char, struct args_value *); struct args *args_create(void); -struct args *args_parse(const struct args_parse *, int, char **); +struct args *args_parse(const struct args_parse *, struct args_value *, + u_int); void args_vector(struct args *, int *, char ***); +void args_free_value(struct args_value *); void args_free(struct args *); char *args_print(struct args *); char *args_escape(const char *); @@ -2198,6 +2212,7 @@ const char *args_get(struct args *, u_char); u_char args_first(struct args *, struct args_entry **); u_char args_next(struct args_entry **); u_int args_count(struct args *); +struct args_value *args_value(struct args *, u_int); const char *args_string(struct args *, u_int); struct args_value *args_first_value(struct args *, u_char); struct args_value *args_next_value(struct args_value *); @@ -2251,7 +2266,8 @@ const struct cmd_entry *cmd_get_entry(struct cmd *); struct args *cmd_get_args(struct cmd *); u_int cmd_get_group(struct cmd *); void cmd_get_source(struct cmd *, const char **, u_int *); -struct cmd *cmd_parse(int, char **, const char *, u_int, char **); +struct cmd *cmd_parse(struct args_value *, u_int, const char *, u_int, + char **); void cmd_free(struct cmd *); char *cmd_print(struct cmd *); struct cmd_list *cmd_list_new(void); |