From 0b39e6427fde3fadb9a3453b6423865829a59ad6 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 6 May 2015 23:56:46 +0000 Subject: Remove ARRAY_* from history and expand completion to complete a) layout names and b) targets beginning with -t or -s. --- tmux.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 83b6e4a8..9783a65f 100644 --- a/tmux.h +++ b/tmux.h @@ -43,9 +43,6 @@ extern char **environ; /* Default global configuration file. */ #define TMUX_CONF "/etc/tmux.conf" -/* Default prompt history length. */ -#define PROMPT_HISTORY 100 - /* * Minimum layout cell size, NOT including separator line. The scroll region * cannot be one line in height so this must be at least two. -- cgit From 1282bb81fe9fbb1b2ff1b63a9c4e8978444703c4 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 7 May 2015 08:08:54 +0000 Subject: array.h can be local to window-choose.c now. --- tmux.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 9783a65f..72e172e6 100644 --- a/tmux.h +++ b/tmux.h @@ -35,8 +35,6 @@ #include #include -#include "array.h" - extern char *__progname; extern char **environ; -- cgit From c4a4bd6ac5748939c7c17beba9e14bee5929c552 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 8 May 2015 16:18:04 +0000 Subject: Move input parser structs into input.c (removing fairly useless saved_cursor_[xy] formats as a side-effect). --- tmux.h | 54 ++++-------------------------------------------------- 1 file changed, 4 insertions(+), 50 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 72e172e6..ad79d79d 100644 --- a/tmux.h +++ b/tmux.h @@ -785,55 +785,6 @@ struct screen_write_ctx { #define screen_hsize(s) ((s)->grid->hsize) #define screen_hlimit(s) ((s)->grid->hlimit) -/* Input parser cell. */ -struct input_cell { - struct grid_cell cell; - int set; - int g0set; /* 1 if ACS */ - int g1set; /* 1 if ACS */ -}; - -/* Input parser context. */ -struct input_ctx { - struct window_pane *wp; - struct screen_write_ctx ctx; - - struct input_cell cell; - - struct input_cell old_cell; - u_int old_cx; - u_int old_cy; - - u_char interm_buf[4]; - size_t interm_len; - - u_char param_buf[64]; - size_t param_len; - -#define INPUT_BUF_START 32 -#define INPUT_BUF_LIMIT 1048576 - u_char *input_buf; - size_t input_len; - size_t input_space; - - int param_list[24]; /* -1 not present */ - u_int param_list_len; - - struct utf8_data utf8data; - - int ch; - int flags; -#define INPUT_DISCARD 0x1 - - const struct input_state *state; - - /* - * All input received since we were last in the ground state. Sent to - * control clients on connection. - */ - struct evbuffer *since_ground; -}; - /* * Window mode. Windows can be in several modes and this is used to call the * right function to handle input and output. @@ -881,6 +832,7 @@ struct window_choose_mode_item { }; /* Child window structure. */ +struct input_ctx; struct window_pane { u_int id; u_int active_point; @@ -920,7 +872,7 @@ struct window_pane { int fd; struct bufferevent *event; - struct input_ctx ictx; + struct input_ctx *ictx; struct grid_cell colgc; @@ -1983,6 +1935,8 @@ void recalculate_sizes(void); /* input.c */ void input_init(struct window_pane *); void input_free(struct window_pane *); +void input_reset(struct window_pane *); +struct evbuffer *input_pending(struct window_pane *); void input_parse(struct window_pane *); /* input-key.c */ -- cgit From a538141a72882e10988b68d7d1ede94cbb7140c1 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 8 May 2015 16:23:34 +0000 Subject: window_choose_mode_item can move into window-choose.c. --- tmux.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index ad79d79d..f48797dc 100644 --- a/tmux.h +++ b/tmux.h @@ -823,14 +823,6 @@ struct window_choose_data { char *command; }; -struct window_choose_mode_item { - struct window_choose_data *wcd; - char *name; - int pos; - int state; -#define TREE_EXPANDED 0x1 -}; - /* Child window structure. */ struct input_ctx; struct window_pane { -- cgit From 74b2c40b1b2f38b1aafe4178cb33db63d3be8de0 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 8 May 2015 16:33:29 +0000 Subject: mode_key_entry can go into mode-key.c; also a few spaces->tabs. --- tmux.h | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index f48797dc..3c9db501 100644 --- a/tmux.h +++ b/tmux.h @@ -566,20 +566,6 @@ enum mode_key_cmd { MODEKEYCOPY_UP, }; -/* Entry in the default mode key tables. */ -struct mode_key_entry { - int key; - - /* - * Editing mode for vi: 0 is edit mode, keys not in the table are - * returned as MODEKEY_OTHER; 1 is command mode, keys not in the table - * are returned as MODEKEY_NONE. This is also matched on, allowing some - * keys to be bound in edit mode. - */ - int mode; - enum mode_key_cmd cmd; -}; - /* Data required while mode keys are in use. */ struct mode_key_data { struct mode_key_tree *tree; @@ -607,6 +593,7 @@ struct mode_key_cmdstr { }; /* Named mode key table description. */ +struct mode_key_entry; struct mode_key_table { const char *name; const struct mode_key_cmdstr *cmdstr; @@ -1192,16 +1179,16 @@ struct tty_ctx { /* Saved message entry. */ struct message_entry { - char *msg; - u_int msg_num; - time_t msg_time; + char *msg; + u_int msg_num; + time_t msg_time; TAILQ_ENTRY(message_entry) entry; }; /* Status output data from a job. */ struct status_out { - char *cmd; - char *out; + char *cmd; + char *out; RB_ENTRY(status_out) entry; }; @@ -1322,6 +1309,7 @@ struct cmd { TAILQ_ENTRY(cmd) qentry; }; + struct cmd_list { int references; TAILQ_HEAD(, cmd) list; @@ -1394,6 +1382,7 @@ struct key_binding { RB_ENTRY(key_binding) entry; }; RB_HEAD(key_bindings, key_binding); + struct key_table { const char *name; struct key_bindings key_bindings; -- cgit From 592cb73a69e23d321a29ae367d52b9e9b4f506c2 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 8 May 2015 16:44:03 +0000 Subject: grid_marker_cell is no longer used. --- tmux.h | 1 - 1 file changed, 1 deletion(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index 3c9db501..f1575d21 100644 --- a/tmux.h +++ b/tmux.h @@ -1940,7 +1940,6 @@ int attributes_fromstring(const char *); /* grid.c */ extern const struct grid_cell grid_default_cell; -extern const struct grid_cell grid_marker_cell; struct grid *grid_create(u_int, u_int, u_int); void grid_destroy(struct grid *); int grid_compare(struct grid *, struct grid *); -- cgit From 92faa2eaebd32117f01b0b7d7ae81abdfde2d935 Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 8 May 2015 16:48:12 +0000 Subject: Put the tty structs together, and tabify. --- tmux.h | 96 +++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) (limited to 'tmux.h') diff --git a/tmux.h b/tmux.h index f1575d21..6d4e29fd 100644 --- a/tmux.h +++ b/tmux.h @@ -689,7 +689,7 @@ struct options_entry { } type; char *str; - long long num; + long long num; struct grid_cell style; RB_ENTRY(options_entry) entry; @@ -804,7 +804,7 @@ struct window_choose_data { struct winlink *wl; int pane_id; - char *ft_template; + char *ft_template; struct format_tree *ft; char *command; @@ -882,7 +882,7 @@ struct window { u_int id; char *name; struct event name_timer; - struct timeval silence_timer; + struct timeval silence_timer; struct window_pane *active; struct window_pane *last; @@ -923,7 +923,7 @@ struct winlink { struct grid_cell status_cell; char *status_text; - int flags; + int flags; #define WINLINK_BELL 0x1 #define WINLINK_ACTIVITY 0x2 #define WINLINK_SILENCE 0x4 @@ -1015,7 +1015,7 @@ struct session { #define SESSION_UNATTACHED 0x1 /* not attached to any clients */ int flags; - u_int attached; + u_int attached; struct termios *tio; @@ -1028,33 +1028,6 @@ struct session { }; RB_HEAD(sessions, session); -/* TTY information. */ -struct tty_key { - char ch; - int key; - - struct tty_key *left; - struct tty_key *right; - - struct tty_key *next; -}; - -struct tty_term { - char *name; - u_int references; - - char acs[UCHAR_MAX + 1][2]; - - struct tty_code codes[NTTYCODE]; - -#define TERM_256COLOURS 0x1 -#define TERM_EARLYWRAP 0x2 - int flags; - - LIST_ENTRY(tty_term) entry; -}; -LIST_HEAD(tty_terms, tty_term); - /* Mouse button masks. */ #define MOUSE_MASK_BUTTONS 3 #define MOUSE_MASK_SHIFT 4 @@ -1096,6 +1069,33 @@ struct mouse_event { u_int sgr_b; }; +/* TTY information. */ +struct tty_key { + char ch; + int key; + + struct tty_key *left; + struct tty_key *right; + + struct tty_key *next; +}; + +struct tty_term { + char *name; + u_int references; + + char acs[UCHAR_MAX + 1][2]; + + struct tty_code codes[NTTYCODE]; + +#define TERM_256COLOURS 0x1 +#define TERM_EARLYWRAP 0x2 + int flags; + + LIST_ENTRY(tty_term) entry; +}; +LIST_HEAD(tty_terms, tty_term); + struct tty { struct client *client; @@ -1143,7 +1143,7 @@ struct tty { void (*mouse_drag_update)(struct client *, struct mouse_event *); void (*mouse_drag_release)(struct client *, - struct mouse_event *); + struct mouse_event *); struct event key_timer; struct tty_key *key_tree; @@ -1217,7 +1217,7 @@ struct client { void (*stdin_callback)(struct client *, int, void *); void *stdin_callback_data; struct evbuffer *stdin_data; - int stdin_closed; + int stdin_closed; struct evbuffer *stdout_data; struct evbuffer *stderr_data; @@ -1263,7 +1263,7 @@ struct client { int (*prompt_callbackfn)(void *, const char *); void (*prompt_freefn)(void *); void *prompt_data; - u_int prompt_hindex; + u_int prompt_hindex; #define PROMPT_SINGLE 0x1 int prompt_flags; @@ -1292,8 +1292,8 @@ RB_HEAD(args_tree, args_entry); struct args { struct args_tree tree; - int argc; - char **argv; + int argc; + char **argv; }; /* Command and list of commands. */ @@ -1311,8 +1311,8 @@ struct cmd { }; struct cmd_list { - int references; - TAILQ_HEAD(, cmd) list; + int references; + TAILQ_HEAD(, cmd) list; }; /* Command return values. */ @@ -1351,7 +1351,7 @@ struct cmd_q { void (*emptyfn)(struct cmd_q *); void *data; - TAILQ_ENTRY(cmd_q) waitentry; + TAILQ_ENTRY(cmd_q) waitentry; }; /* Command definition. */ @@ -1413,8 +1413,8 @@ struct options_table_entry { const char *name; enum options_table_type type; - u_int minimum; - u_int maximum; + u_int minimum; + u_int maximum; const char **choices; const char *default_str; @@ -1801,7 +1801,7 @@ void printflike(2, 3) cmdq_print(struct cmd_q *, const char *, ...); void printflike(2, 3) cmdq_error(struct cmd_q *, const char *, ...); void cmdq_guard(struct cmd_q *, const char *, int); void cmdq_run(struct cmd_q *, struct cmd_list *, - struct mouse_event *); + struct mouse_event *); void cmdq_append(struct cmd_q *, struct cmd_list *, struct mouse_event *); int cmdq_continue(struct cmd_q *); @@ -1823,8 +1823,8 @@ RB_PROTOTYPE(key_tables, key_table, entry, key_table_cmp); extern struct key_tables key_tables; int key_table_cmp(struct key_table *, struct key_table *); int key_bindings_cmp(struct key_binding *, struct key_binding *); -struct key_table *key_bindings_get_table(const char *, int); -void key_bindings_unref_table(struct key_table *); +struct key_table *key_bindings_get_table(const char *, int); +void key_bindings_unref_table(struct key_table *); void key_bindings_add(const char *, int, int, struct cmd_list *); void key_bindings_remove(const char *, int); void key_bindings_remove_table(const char *); @@ -1846,7 +1846,7 @@ void server_add_accept(int); /* server-client.c */ void server_client_handle_key(struct client *, int); void server_client_create(int); -int server_client_open(struct client *, char **); +int server_client_open(struct client *, char **); void server_client_lost(struct client *); void server_client_callback(int, short, void *); void server_client_status_timer(void); @@ -2097,9 +2097,9 @@ void window_lost_pane(struct window *, struct window_pane *); void window_remove_pane(struct window *, struct window_pane *); struct window_pane *window_pane_at_index(struct window *, u_int); struct window_pane *window_pane_next_by_number(struct window *, - struct window_pane *, u_int); + struct window_pane *, u_int); struct window_pane *window_pane_previous_by_number(struct window *, - struct window_pane *, u_int); + struct window_pane *, u_int); int window_pane_index(struct window_pane *, u_int *); u_int window_count_panes(struct window *); void window_destroy_panes(struct window *); -- cgit