version 1.666, 2016/10/15 09:27:52 |
version 1.667, 2016/10/16 17:55:14 |
|
|
|
|
struct args; |
struct args; |
struct client; |
struct client; |
|
struct cmd_q; |
|
struct cmd_q_list; |
struct environ; |
struct environ; |
struct input_ctx; |
struct input_ctx; |
struct mode_key_cmdstr; |
struct mode_key_cmdstr; |
|
|
struct hook { |
struct hook { |
const char *name; |
const char *name; |
|
|
struct cmd_q *cmdq; |
|
struct cmd_list *cmdlist; |
struct cmd_list *cmdlist; |
|
|
RB_ENTRY(hook) entry; |
RB_ENTRY(hook) entry; |
|
|
TAILQ_ENTRY(message_entry) entry; |
TAILQ_ENTRY(message_entry) entry; |
}; |
}; |
|
|
/* Client connection. */ |
|
struct client { |
|
struct tmuxpeer *peer; |
|
|
|
pid_t pid; |
|
int fd; |
|
struct event event; |
|
int retval; |
|
|
|
struct timeval creation_time; |
|
struct timeval activity_time; |
|
|
|
struct environ *environ; |
|
|
|
char *title; |
|
const char *cwd; |
|
|
|
char *term; |
|
char *ttyname; |
|
struct tty tty; |
|
|
|
void (*stdin_callback)(struct client *, int, void *); |
|
void *stdin_callback_data; |
|
struct evbuffer *stdin_data; |
|
int stdin_closed; |
|
struct evbuffer *stdout_data; |
|
struct evbuffer *stderr_data; |
|
|
|
struct event repeat_timer; |
|
|
|
struct event click_timer; |
|
u_int click_button; |
|
|
|
struct event status_timer; |
|
struct screen status; |
|
|
|
#define CLIENT_TERMINAL 0x1 |
|
#define CLIENT_LOGIN 0x2 |
|
#define CLIENT_EXIT 0x4 |
|
#define CLIENT_REDRAW 0x8 |
|
#define CLIENT_STATUS 0x10 |
|
#define CLIENT_REPEAT 0x20 |
|
#define CLIENT_SUSPENDED 0x40 |
|
/* 0x80 unused */ |
|
#define CLIENT_IDENTIFY 0x100 |
|
#define CLIENT_DEAD 0x200 |
|
#define CLIENT_BORDERS 0x400 |
|
#define CLIENT_READONLY 0x800 |
|
#define CLIENT_REDRAWWINDOW 0x1000 |
|
#define CLIENT_CONTROL 0x2000 |
|
#define CLIENT_CONTROLCONTROL 0x4000 |
|
#define CLIENT_FOCUSED 0x8000 |
|
#define CLIENT_UTF8 0x10000 |
|
#define CLIENT_256COLOURS 0x20000 |
|
#define CLIENT_IDENTIFIED 0x40000 |
|
#define CLIENT_STATUSFORCE 0x80000 |
|
#define CLIENT_DOUBLECLICK 0x100000 |
|
#define CLIENT_TRIPLECLICK 0x200000 |
|
int flags; |
|
struct key_table *keytable; |
|
|
|
struct event identify_timer; |
|
void (*identify_callback)(struct client *, struct window_pane *); |
|
void *identify_callback_data; |
|
|
|
char *message_string; |
|
struct event message_timer; |
|
u_int message_next; |
|
TAILQ_HEAD(, message_entry) message_log; |
|
|
|
char *prompt_string; |
|
struct utf8_data *prompt_buffer; |
|
size_t prompt_index; |
|
int (*prompt_callbackfn)(void *, const char *); |
|
void (*prompt_freefn)(void *); |
|
void *prompt_data; |
|
u_int prompt_hindex; |
|
enum { PROMPT_ENTRY, PROMPT_COMMAND } prompt_mode; |
|
|
|
#define PROMPT_SINGLE 0x1 |
|
#define PROMPT_NUMERIC 0x2 |
|
int prompt_flags; |
|
|
|
struct session *session; |
|
struct session *last_session; |
|
|
|
int wlmouse; |
|
|
|
struct cmd_q *cmdq; |
|
int references; |
|
|
|
TAILQ_ENTRY(client) entry; |
|
}; |
|
TAILQ_HEAD(clients, client); |
|
|
|
/* Parsed arguments structures. */ |
/* Parsed arguments structures. */ |
struct args_entry; |
struct args_entry; |
RB_HEAD(args_tree, args_entry); |
RB_HEAD(args_tree, args_entry); |
|
|
CMD_RETURN_STOP |
CMD_RETURN_STOP |
}; |
}; |
|
|
/* Command queue entry. */ |
/* Command queue item type. */ |
struct cmd_q_item { |
enum cmd_q_type { |
struct cmd_list *cmdlist; |
CMD_Q_COMMAND, |
|
CMD_Q_CALLBACK, |
struct mouse_event mouse; |
|
|
|
TAILQ_ENTRY(cmd_q_item) qentry; |
|
}; |
}; |
TAILQ_HEAD(cmd_q_items, cmd_q_item); |
|
|
|
/* Command queue. */ |
/* Command queue item. */ |
|
typedef enum cmd_retval (*cmd_q_cb) (struct cmd_q *, void *); |
struct cmd_q { |
struct cmd_q { |
int references; |
struct cmd_q_list *queue; |
int flags; |
struct cmd_q *next; |
#define CMD_Q_DEAD 0x1 |
|
#define CMD_Q_NOHOOKS 0x2 |
|
|
|
struct client *client; |
struct client *client; |
int client_exit; |
|
|
|
struct cmd_q_items queue; |
enum cmd_q_type type; |
struct cmd_q_item *item; |
u_int group; |
|
|
|
u_int number; |
|
time_t time; |
|
|
|
const char *hook; |
|
int flags; |
|
#define CMD_Q_FIRED 0x1 |
|
#define CMD_Q_WAITING 0x2 |
|
#define CMD_Q_NOHOOKS 0x4 |
|
|
|
struct cmd_list *cmdlist; |
struct cmd *cmd; |
struct cmd *cmd; |
struct cmd_q *parent; |
|
|
|
|
cmd_q_cb cb; |
|
void *data; |
|
|
struct cmd_find_state current; |
struct cmd_find_state current; |
struct cmd_state state; |
struct cmd_state state; |
|
|
time_t time; |
struct mouse_event mouse; |
u_int number; |
|
|
|
void (*emptyfn)(struct cmd_q *); |
TAILQ_ENTRY(cmd_q) entry; |
void *data; |
|
|
|
TAILQ_ENTRY(cmd_q) waitentry; |
|
}; |
}; |
|
TAILQ_HEAD(cmd_q_list, cmd_q); |
|
|
/* Command -c, -t or -s flags. */ |
/* Command -c, -t or -s flags. */ |
enum cmd_entry_flag { |
enum cmd_entry_flag { |
|
|
enum cmd_retval (*exec)(struct cmd *, struct cmd_q *); |
enum cmd_retval (*exec)(struct cmd *, struct cmd_q *); |
}; |
}; |
|
|
|
/* Client connection. */ |
|
struct client { |
|
struct tmuxpeer *peer; |
|
struct cmd_q_list queue; |
|
|
|
pid_t pid; |
|
int fd; |
|
struct event event; |
|
int retval; |
|
|
|
struct timeval creation_time; |
|
struct timeval activity_time; |
|
|
|
struct environ *environ; |
|
|
|
char *title; |
|
const char *cwd; |
|
|
|
char *term; |
|
char *ttyname; |
|
struct tty tty; |
|
|
|
void (*stdin_callback)(struct client *, int, void *); |
|
void *stdin_callback_data; |
|
struct evbuffer *stdin_data; |
|
int stdin_closed; |
|
struct evbuffer *stdout_data; |
|
struct evbuffer *stderr_data; |
|
|
|
struct event repeat_timer; |
|
|
|
struct event click_timer; |
|
u_int click_button; |
|
|
|
struct event status_timer; |
|
struct screen status; |
|
|
|
#define CLIENT_TERMINAL 0x1 |
|
#define CLIENT_LOGIN 0x2 |
|
#define CLIENT_EXIT 0x4 |
|
#define CLIENT_REDRAW 0x8 |
|
#define CLIENT_STATUS 0x10 |
|
#define CLIENT_REPEAT 0x20 |
|
#define CLIENT_SUSPENDED 0x40 |
|
#define CLIENT_ATTACHED 0x80 |
|
#define CLIENT_IDENTIFY 0x100 |
|
#define CLIENT_DEAD 0x200 |
|
#define CLIENT_BORDERS 0x400 |
|
#define CLIENT_READONLY 0x800 |
|
#define CLIENT_REDRAWWINDOW 0x1000 |
|
#define CLIENT_CONTROL 0x2000 |
|
#define CLIENT_CONTROLCONTROL 0x4000 |
|
#define CLIENT_FOCUSED 0x8000 |
|
#define CLIENT_UTF8 0x10000 |
|
#define CLIENT_256COLOURS 0x20000 |
|
#define CLIENT_IDENTIFIED 0x40000 |
|
#define CLIENT_STATUSFORCE 0x80000 |
|
#define CLIENT_DOUBLECLICK 0x100000 |
|
#define CLIENT_TRIPLECLICK 0x200000 |
|
int flags; |
|
struct key_table *keytable; |
|
|
|
struct event identify_timer; |
|
void (*identify_callback)(struct client *, struct window_pane *); |
|
void *identify_callback_data; |
|
|
|
char *message_string; |
|
struct event message_timer; |
|
u_int message_next; |
|
TAILQ_HEAD(, message_entry) message_log; |
|
|
|
char *prompt_string; |
|
struct utf8_data *prompt_buffer; |
|
size_t prompt_index; |
|
int (*prompt_callbackfn)(void *, const char *); |
|
void (*prompt_freefn)(void *); |
|
void *prompt_data; |
|
u_int prompt_hindex; |
|
enum { PROMPT_ENTRY, PROMPT_COMMAND } prompt_mode; |
|
|
|
#define PROMPT_SINGLE 0x1 |
|
#define PROMPT_NUMERIC 0x2 |
|
int prompt_flags; |
|
|
|
struct session *session; |
|
struct session *last_session; |
|
|
|
int wlmouse; |
|
|
|
int references; |
|
|
|
TAILQ_ENTRY(client) entry; |
|
}; |
|
TAILQ_HEAD(clients, client); |
|
|
/* Key binding and key table. */ |
/* Key binding and key table. */ |
struct key_binding { |
struct key_binding { |
key_code key; |
key_code key; |
|
|
|
|
/* cfg.c */ |
/* cfg.c */ |
extern int cfg_finished; |
extern int cfg_finished; |
extern int cfg_references; |
|
extern struct client *cfg_client; |
extern struct client *cfg_client; |
void start_cfg(void); |
void start_cfg(void); |
int load_cfg(const char *, struct cmd_q *, int); |
int load_cfg(const char *, struct client *, struct cmd_q *, int); |
void set_cfg_file(const char *); |
void set_cfg_file(const char *); |
void printflike(1, 2) cfg_add_cause(const char *, ...); |
void printflike(1, 2) cfg_add_cause(const char *, ...); |
void cfg_print_causes(struct cmd_q *); |
void cfg_print_causes(struct cmd_q *); |
|
|
void hooks_copy(struct hooks *, struct hooks *); |
void hooks_copy(struct hooks *, struct hooks *); |
void hooks_remove(struct hooks *, const char *); |
void hooks_remove(struct hooks *, const char *); |
struct hook *hooks_find(struct hooks *, const char *); |
struct hook *hooks_find(struct hooks *, const char *); |
int printflike(4, 5) hooks_run(struct hooks *, struct client *, |
void printflike(4, 5) hooks_run(struct hooks *, struct client *, |
struct cmd_find_state *, const char *, ...); |
struct cmd_find_state *, const char *, ...); |
int printflike(4, 5) hooks_wait(struct hooks *, struct cmd_q *, |
void printflike(4, 5) hooks_insert(struct hooks *, struct cmd_q *, |
struct cmd_find_state *, const char *, ...); |
struct cmd_find_state *, const char *, ...); |
|
|
/* mode-key.c */ |
/* mode-key.c */ |
|
|
void cmd_free_argv(int, char **); |
void cmd_free_argv(int, char **); |
char *cmd_stringify_argv(int, char **); |
char *cmd_stringify_argv(int, char **); |
struct cmd *cmd_parse(int, char **, const char *, u_int, char **); |
struct cmd *cmd_parse(int, char **, const char *, u_int, char **); |
int cmd_prepare_state(struct cmd *, struct cmd_q *, |
int cmd_prepare_state(struct cmd *, struct cmd_q *); |
struct cmd_q *); |
|
char *cmd_print(struct cmd *); |
char *cmd_print(struct cmd *); |
int cmd_mouse_at(struct window_pane *, struct mouse_event *, |
int cmd_mouse_at(struct window_pane *, struct mouse_event *, |
u_int *, u_int *, int); |
u_int *, u_int *, int); |
|
|
char *cmd_list_print(struct cmd_list *); |
char *cmd_list_print(struct cmd_list *); |
|
|
/* cmd-queue.c */ |
/* cmd-queue.c */ |
struct cmd_q *cmdq_new(struct client *); |
struct cmd_q *cmdq_get_command(struct cmd_list *, struct cmd_find_state *, |
int cmdq_free(struct cmd_q *); |
struct mouse_event *, int); |
|
struct cmd_q *cmdq_get_callback(cmd_q_cb, void *); |
|
void cmdq_insert_after(struct cmd_q *, struct cmd_q *); |
|
void cmdq_append(struct client *, struct cmd_q *); |
|
u_int cmdq_next(struct client *); |
|
void cmdq_guard(struct cmd_q *, const char *, int); |
void printflike(2, 3) cmdq_print(struct cmd_q *, const char *, ...); |
void printflike(2, 3) cmdq_print(struct cmd_q *, const char *, ...); |
void printflike(2, 3) cmdq_error(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 *); |
|
void cmdq_append(struct cmd_q *, struct cmd_list *, |
|
struct mouse_event *); |
|
int cmdq_continue(struct cmd_q *); |
|
|
|
/* cmd-string.c */ |
/* cmd-string.c */ |
int cmd_string_parse(const char *, struct cmd_list **, const char *, |
int cmd_string_parse(const char *, struct cmd_list **, const char *, |