aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h49
1 files changed, 20 insertions, 29 deletions
diff --git a/tmux.h b/tmux.h
index 8f8640bf..539309da 100644
--- a/tmux.h
+++ b/tmux.h
@@ -39,9 +39,11 @@ extern char **environ;
struct args;
struct args_value;
struct client;
+struct cmd;
struct cmd_find_state;
struct cmdq_item;
struct cmdq_list;
+struct cmds;
struct environ;
struct format_job_tree;
struct format_tree;
@@ -50,8 +52,8 @@ struct job;
struct mode_tree_data;
struct mouse_event;
struct options;
-struct options_entry;
struct options_array_item;
+struct options_entry;
struct session;
struct tmuxpeer;
struct tmuxproc;
@@ -1335,27 +1337,11 @@ struct cmd_find_state {
#define CMD_FIND_EXACT_WINDOW 0x20
#define CMD_FIND_CANFAIL 0x40
-/* Command and list of commands. */
-struct cmd {
- const struct cmd_entry *entry;
- struct args *args;
- u_int group;
-
- char *file;
- u_int line;
-
- char *alias;
- int argc;
- char **argv;
-
- TAILQ_ENTRY(cmd) qentry;
-};
-TAILQ_HEAD(cmds, cmd);
-
+/* List of commands. */
struct cmd_list {
- int references;
- u_int group;
- struct cmds list;
+ int references;
+ u_int group;
+ struct cmds *list;
};
/* Command return values. */
@@ -2102,6 +2088,7 @@ int cmd_find_from_mouse(struct cmd_find_state *,
int cmd_find_from_nothing(struct cmd_find_state *, int);
/* cmd.c */
+extern const struct cmd_entry *cmd_table[];
void printflike(3, 4) cmd_log_argv(int, char **, const char *, ...);
void cmd_prepend_argv(int *, char ***, char *);
void cmd_append_argv(int *, char ***, char *);
@@ -2111,16 +2098,27 @@ char **cmd_copy_argv(int, char **);
void cmd_free_argv(int, char **);
char *cmd_stringify_argv(int, char **);
char *cmd_get_alias(const char *);
+const struct cmd_entry *cmd_get_entry(struct cmd *);
+struct args *cmd_get_args(struct cmd *);
+void cmd_get_source(struct cmd *, const char **, u_int *);
struct cmd *cmd_parse(int, char **, const char *, u_int, char **);
void cmd_free(struct cmd *);
char *cmd_print(struct cmd *);
+struct cmd_list *cmd_list_new(void);
+void cmd_list_append(struct cmd_list *, struct cmd *);
+void cmd_list_move(struct cmd_list *, struct cmd_list *);
+void cmd_list_free(struct cmd_list *);
+char *cmd_list_print(struct cmd_list *, int);
+struct cmd *cmd_list_first(struct cmd_list *, u_int *);
+struct cmd *cmd_list_next(struct cmd *, u_int *);
+int cmd_list_all_have(struct cmd_list *, int);
+int cmd_list_any_have(struct cmd_list *, int);
int cmd_mouse_at(struct window_pane *, struct mouse_event *,
u_int *, u_int *, int);
struct winlink *cmd_mouse_window(struct mouse_event *, struct session **);
struct window_pane *cmd_mouse_pane(struct mouse_event *, struct session **,
struct winlink **);
char *cmd_template_replace(const char *, const char *, int);
-extern const struct cmd_entry *cmd_table[];
/* cmd-attach-session.c */
enum cmd_retval cmd_attach_session(struct cmdq_item *, const char *, int, int,
@@ -2136,13 +2134,6 @@ struct cmd_parse_result *cmd_parse_from_buffer(const void *, size_t,
struct cmd_parse_result *cmd_parse_from_arguments(int, char **,
struct cmd_parse_input *);
-/* cmd-list.c */
-struct cmd_list *cmd_list_new(void);
-void cmd_list_append(struct cmd_list *, struct cmd *);
-void cmd_list_move(struct cmd_list *, struct cmd_list *);
-void cmd_list_free(struct cmd_list *);
-char *cmd_list_print(struct cmd_list *, int);
-
/* cmd-queue.c */
struct cmdq_item *cmdq_get_command(struct cmd_list *, struct cmd_find_state *,
struct mouse_event *, int);