mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 00:56:10 +00:00 
			
		
		
		
	Remove some dead code in cmd-move-window.c and make a load of local
functions static.
This commit is contained in:
		
							
								
								
									
										42
									
								
								alerts.c
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								alerts.c
									
									
									
									
									
								
							@@ -22,21 +22,21 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int	alerts_fired;
 | 
					static int	alerts_fired;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void	alerts_timer(int, short, void *);
 | 
					static void	alerts_timer(int, short, void *);
 | 
				
			||||||
int	alerts_enabled(struct window *, int);
 | 
					static int	alerts_enabled(struct window *, int);
 | 
				
			||||||
void	alerts_callback(int, short, void *);
 | 
					static void	alerts_callback(int, short, void *);
 | 
				
			||||||
void	alerts_reset(struct window *);
 | 
					static void	alerts_reset(struct window *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void	alerts_run_hook(struct session *, struct winlink *, int);
 | 
					static void	alerts_run_hook(struct session *, struct winlink *, int);
 | 
				
			||||||
int	alerts_check_all(struct session *, struct winlink *);
 | 
					static int	alerts_check_all(struct session *, struct winlink *);
 | 
				
			||||||
int	alerts_check_bell(struct session *, struct winlink *);
 | 
					static int	alerts_check_bell(struct session *, struct winlink *);
 | 
				
			||||||
int	alerts_check_activity(struct session *, struct winlink *);
 | 
					static int	alerts_check_activity(struct session *, struct winlink *);
 | 
				
			||||||
int	alerts_check_silence(struct session *, struct winlink *);
 | 
					static int	alerts_check_silence(struct session *, struct winlink *);
 | 
				
			||||||
void	alerts_ring_bell(struct session *);
 | 
					static void	alerts_ring_bell(struct session *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
alerts_timer(__unused int fd, __unused short events, void *arg)
 | 
					alerts_timer(__unused int fd, __unused short events, void *arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct window	*w = arg;
 | 
						struct window	*w = arg;
 | 
				
			||||||
@@ -46,7 +46,7 @@ alerts_timer(__unused int fd, __unused short events, void *arg)
 | 
				
			|||||||
	alerts_queue(w, WINDOW_SILENCE);
 | 
						alerts_queue(w, WINDOW_SILENCE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
alerts_callback(__unused int fd, __unused short events, __unused void *arg)
 | 
					alerts_callback(__unused int fd, __unused short events, __unused void *arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct window	*w;
 | 
						struct window	*w;
 | 
				
			||||||
@@ -72,7 +72,7 @@ alerts_callback(__unused int fd, __unused short events, __unused void *arg)
 | 
				
			|||||||
	alerts_fired = 0;
 | 
						alerts_fired = 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
alerts_run_hook(struct session *s, struct winlink *wl, int flags)
 | 
					alerts_run_hook(struct session *s, struct winlink *wl, int flags)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct cmd_find_state	 fs;
 | 
						struct cmd_find_state	 fs;
 | 
				
			||||||
@@ -88,7 +88,7 @@ alerts_run_hook(struct session *s, struct winlink *wl, int flags)
 | 
				
			|||||||
		hooks_run(s->hooks, NULL, &fs, "alert-activity");
 | 
							hooks_run(s->hooks, NULL, &fs, "alert-activity");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
alerts_check_all(struct session *s, struct winlink *wl)
 | 
					alerts_check_all(struct session *s, struct winlink *wl)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int	alerts;
 | 
						int	alerts;
 | 
				
			||||||
@@ -113,7 +113,7 @@ alerts_check_session(struct session *s)
 | 
				
			|||||||
		alerts_check_all(s, wl);
 | 
							alerts_check_all(s, wl);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
alerts_enabled(struct window *w, int flags)
 | 
					alerts_enabled(struct window *w, int flags)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (flags & WINDOW_BELL)
 | 
						if (flags & WINDOW_BELL)
 | 
				
			||||||
@@ -138,7 +138,7 @@ alerts_reset_all(void)
 | 
				
			|||||||
		alerts_reset(w);
 | 
							alerts_reset(w);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
alerts_reset(struct window *w)
 | 
					alerts_reset(struct window *w)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct timeval	tv;
 | 
						struct timeval	tv;
 | 
				
			||||||
@@ -175,7 +175,7 @@ alerts_queue(struct window *w, int flags)
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
alerts_check_bell(struct session *s, struct winlink *wl)
 | 
					alerts_check_bell(struct session *s, struct winlink *wl)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct client	*c;
 | 
						struct client	*c;
 | 
				
			||||||
@@ -218,7 +218,7 @@ alerts_check_bell(struct session *s, struct winlink *wl)
 | 
				
			|||||||
	return (WINDOW_BELL);
 | 
						return (WINDOW_BELL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
alerts_check_activity(struct session *s, struct winlink *wl)
 | 
					alerts_check_activity(struct session *s, struct winlink *wl)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct client	*c;
 | 
						struct client	*c;
 | 
				
			||||||
@@ -250,7 +250,7 @@ alerts_check_activity(struct session *s, struct winlink *wl)
 | 
				
			|||||||
	return (WINDOW_ACTIVITY);
 | 
						return (WINDOW_ACTIVITY);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
alerts_check_silence(struct session *s, struct winlink *wl)
 | 
					alerts_check_silence(struct session *s, struct winlink *wl)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct client	*c;
 | 
						struct client	*c;
 | 
				
			||||||
@@ -282,7 +282,7 @@ alerts_check_silence(struct session *s, struct winlink *wl)
 | 
				
			|||||||
	return (WINDOW_SILENCE);
 | 
						return (WINDOW_SILENCE);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
alerts_ring_bell(struct session *s)
 | 
					alerts_ring_bell(struct session *s)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct client	*c;
 | 
						struct client	*c;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										60
									
								
								client.c
									
									
									
									
									
								
							
							
						
						
									
										60
									
								
								client.c
									
									
									
									
									
								
							@@ -34,11 +34,11 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct tmuxproc	*client_proc;
 | 
					static struct tmuxproc	*client_proc;
 | 
				
			||||||
struct tmuxpeer	*client_peer;
 | 
					static struct tmuxpeer	*client_peer;
 | 
				
			||||||
int		 client_flags;
 | 
					static int		 client_flags;
 | 
				
			||||||
struct event	 client_stdin;
 | 
					static struct event	 client_stdin;
 | 
				
			||||||
enum {
 | 
					static enum {
 | 
				
			||||||
	CLIENT_EXIT_NONE,
 | 
						CLIENT_EXIT_NONE,
 | 
				
			||||||
	CLIENT_EXIT_DETACHED,
 | 
						CLIENT_EXIT_DETACHED,
 | 
				
			||||||
	CLIENT_EXIT_DETACHED_HUP,
 | 
						CLIENT_EXIT_DETACHED_HUP,
 | 
				
			||||||
@@ -48,29 +48,29 @@ enum {
 | 
				
			|||||||
	CLIENT_EXIT_EXITED,
 | 
						CLIENT_EXIT_EXITED,
 | 
				
			||||||
	CLIENT_EXIT_SERVER_EXITED,
 | 
						CLIENT_EXIT_SERVER_EXITED,
 | 
				
			||||||
} client_exitreason = CLIENT_EXIT_NONE;
 | 
					} client_exitreason = CLIENT_EXIT_NONE;
 | 
				
			||||||
int		 client_exitval;
 | 
					static int		 client_exitval;
 | 
				
			||||||
enum msgtype	 client_exittype;
 | 
					static enum msgtype	 client_exittype;
 | 
				
			||||||
const char	*client_exitsession;
 | 
					static const char	*client_exitsession;
 | 
				
			||||||
int		 client_attached;
 | 
					static int		 client_attached;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__dead void	client_exec(const char *,const char *);
 | 
					static __dead void	 client_exec(const char *,const char *);
 | 
				
			||||||
int		client_get_lock(char *);
 | 
					static int		 client_get_lock(char *);
 | 
				
			||||||
int		client_connect(struct event_base *, const char *, int);
 | 
					static int		 client_connect(struct event_base *, const char *, int);
 | 
				
			||||||
void		client_send_identify(const char *, const char *);
 | 
					static void		 client_send_identify(const char *, const char *);
 | 
				
			||||||
void		client_stdin_callback(int, short, void *);
 | 
					static void		 client_stdin_callback(int, short, void *);
 | 
				
			||||||
void		client_write(int, const char *, size_t);
 | 
					static void		 client_write(int, const char *, size_t);
 | 
				
			||||||
void		client_signal(int);
 | 
					static void		 client_signal(int);
 | 
				
			||||||
void		client_dispatch(struct imsg *, void *);
 | 
					static void		 client_dispatch(struct imsg *, void *);
 | 
				
			||||||
void		client_dispatch_attached(struct imsg *);
 | 
					static void		 client_dispatch_attached(struct imsg *);
 | 
				
			||||||
void		client_dispatch_wait(struct imsg *, const char *);
 | 
					static void		 client_dispatch_wait(struct imsg *, const char *);
 | 
				
			||||||
const char     *client_exit_message(void);
 | 
					static const char	*client_exit_message(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					/*
 | 
				
			||||||
 * Get server create lock. If already held then server start is happening in
 | 
					 * Get server create lock. If already held then server start is happening in
 | 
				
			||||||
 * another client, so block until the lock is released and return -2 to
 | 
					 * another client, so block until the lock is released and return -2 to
 | 
				
			||||||
 * retry. Return -1 on failure to continue and start the server anyway.
 | 
					 * retry. Return -1 on failure to continue and start the server anyway.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
client_get_lock(char *lockfile)
 | 
					client_get_lock(char *lockfile)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int lockfd;
 | 
						int lockfd;
 | 
				
			||||||
@@ -97,7 +97,7 @@ client_get_lock(char *lockfile)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Connect client to server. */
 | 
					/* Connect client to server. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
client_connect(struct event_base *base, const char *path, int start_server)
 | 
					client_connect(struct event_base *base, const char *path, int start_server)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct sockaddr_un	sa;
 | 
						struct sockaddr_un	sa;
 | 
				
			||||||
@@ -380,7 +380,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Send identify messages to server. */
 | 
					/* Send identify messages to server. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
client_send_identify(const char *ttynam, const char *cwd)
 | 
					client_send_identify(const char *ttynam, const char *cwd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const char	 *s;
 | 
						const char	 *s;
 | 
				
			||||||
@@ -417,7 +417,7 @@ client_send_identify(const char *ttynam, const char *cwd)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Callback for client stdin read events. */
 | 
					/* Callback for client stdin read events. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
client_stdin_callback(__unused int fd, __unused short events,
 | 
					client_stdin_callback(__unused int fd, __unused short events,
 | 
				
			||||||
    __unused void *arg)
 | 
					    __unused void *arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -433,7 +433,7 @@ client_stdin_callback(__unused int fd, __unused short events,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Force write to file descriptor. */
 | 
					/* Force write to file descriptor. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
client_write(int fd, const char *data, size_t size)
 | 
					client_write(int fd, const char *data, size_t size)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	ssize_t	used;
 | 
						ssize_t	used;
 | 
				
			||||||
@@ -451,7 +451,7 @@ client_write(int fd, const char *data, size_t size)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Run command in shell; used for -c. */
 | 
					/* Run command in shell; used for -c. */
 | 
				
			||||||
__dead void
 | 
					static __dead void
 | 
				
			||||||
client_exec(const char *shell, const char *shellcmd)
 | 
					client_exec(const char *shell, const char *shellcmd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const char	*name, *ptr;
 | 
						const char	*name, *ptr;
 | 
				
			||||||
@@ -480,7 +480,7 @@ client_exec(const char *shell, const char *shellcmd)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Callback to handle signals in the client. */
 | 
					/* Callback to handle signals in the client. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
client_signal(int sig)
 | 
					client_signal(int sig)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct sigaction sigact;
 | 
						struct sigaction sigact;
 | 
				
			||||||
@@ -520,7 +520,7 @@ client_signal(int sig)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Callback for client read events. */
 | 
					/* Callback for client read events. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
client_dispatch(struct imsg *imsg, void *arg)
 | 
					client_dispatch(struct imsg *imsg, void *arg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (imsg == NULL) {
 | 
						if (imsg == NULL) {
 | 
				
			||||||
@@ -537,7 +537,7 @@ client_dispatch(struct imsg *imsg, void *arg)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Dispatch imsgs when in wait state (before MSG_READY). */
 | 
					/* Dispatch imsgs when in wait state (before MSG_READY). */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
client_dispatch_wait(struct imsg *imsg, const char *shellcmd)
 | 
					client_dispatch_wait(struct imsg *imsg, const char *shellcmd)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char			*data;
 | 
						char			*data;
 | 
				
			||||||
@@ -631,7 +631,7 @@ client_dispatch_wait(struct imsg *imsg, const char *shellcmd)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Dispatch imsgs in attached state (after MSG_READY). */
 | 
					/* Dispatch imsgs in attached state (after MSG_READY). */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
client_dispatch_attached(struct imsg *imsg)
 | 
					client_dispatch_attached(struct imsg *imsg)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct sigaction	 sigact;
 | 
						struct sigaction	 sigact;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,9 +66,6 @@ cmd_move_window_exec(struct cmd *self, struct cmd_q *cmdq)
 | 
				
			|||||||
	char		*cause;
 | 
						char		*cause;
 | 
				
			||||||
	int		 idx = cmdq->state.tflag.idx, kflag, dflag, sflag;
 | 
						int		 idx = cmdq->state.tflag.idx, kflag, dflag, sflag;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	kflag = args_has(self->args, 'k');
 | 
					 | 
				
			||||||
	dflag = args_has(self->args, 'd');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (args_has(args, 'r')) {
 | 
						if (args_has(args, 'r')) {
 | 
				
			||||||
		session_renumber_windows(dst);
 | 
							session_renumber_windows(dst);
 | 
				
			||||||
		recalculate_sizes();
 | 
							recalculate_sizes();
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,7 @@
 | 
				
			|||||||
 * direction with output).
 | 
					 * direction with output).
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void	 input_key_mouse(struct window_pane *, struct mouse_event *);
 | 
					static void	 input_key_mouse(struct window_pane *, struct mouse_event *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct input_key_ent {
 | 
					struct input_key_ent {
 | 
				
			||||||
	key_code	 key;
 | 
						key_code	 key;
 | 
				
			||||||
@@ -42,7 +42,7 @@ struct input_key_ent {
 | 
				
			|||||||
#define INPUTKEY_CURSOR 0x2	/* cursor key */
 | 
					#define INPUTKEY_CURSOR 0x2	/* cursor key */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const struct input_key_ent input_keys[] = {
 | 
					static const struct input_key_ent input_keys[] = {
 | 
				
			||||||
	/* Backspace key. */
 | 
						/* Backspace key. */
 | 
				
			||||||
	{ KEYC_BSPACE,		"\177",		0 },
 | 
						{ KEYC_BSPACE,		"\177",		0 },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -232,7 +232,7 @@ input_key(struct window_pane *wp, key_code key, struct mouse_event *m)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Translate mouse and output. */
 | 
					/* Translate mouse and output. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_key_mouse(struct window_pane *wp, struct mouse_event *m)
 | 
					input_key_mouse(struct window_pane *wp, struct mouse_event *m)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	char	buf[40];
 | 
						char	buf[40];
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										257
									
								
								input.c
									
									
									
									
									
								
							
							
						
						
									
										257
									
								
								input.c
									
									
									
									
									
								
							@@ -98,45 +98,46 @@ struct input_ctx {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
/* Helper functions. */
 | 
					/* Helper functions. */
 | 
				
			||||||
struct input_transition;
 | 
					struct input_transition;
 | 
				
			||||||
int	input_split(struct input_ctx *);
 | 
					static int	input_split(struct input_ctx *);
 | 
				
			||||||
int	input_get(struct input_ctx *, u_int, int, int);
 | 
					static int	input_get(struct input_ctx *, u_int, int, int);
 | 
				
			||||||
void printflike(2, 3) input_reply(struct input_ctx *, const char *, ...);
 | 
					static void printflike(2, 3) input_reply(struct input_ctx *, const char *, ...);
 | 
				
			||||||
void	input_set_state(struct window_pane *, const struct input_transition *);
 | 
					static void	input_set_state(struct window_pane *,
 | 
				
			||||||
void	input_reset_cell(struct input_ctx *);
 | 
							    const struct input_transition *);
 | 
				
			||||||
 | 
					static void	input_reset_cell(struct input_ctx *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Transition entry/exit handlers. */
 | 
					/* Transition entry/exit handlers. */
 | 
				
			||||||
void	input_clear(struct input_ctx *);
 | 
					static void	input_clear(struct input_ctx *);
 | 
				
			||||||
void	input_ground(struct input_ctx *);
 | 
					static void	input_ground(struct input_ctx *);
 | 
				
			||||||
void	input_enter_osc(struct input_ctx *);
 | 
					static void	input_enter_osc(struct input_ctx *);
 | 
				
			||||||
void	input_exit_osc(struct input_ctx *);
 | 
					static void	input_exit_osc(struct input_ctx *);
 | 
				
			||||||
void	input_enter_apc(struct input_ctx *);
 | 
					static void	input_enter_apc(struct input_ctx *);
 | 
				
			||||||
void	input_exit_apc(struct input_ctx *);
 | 
					static void	input_exit_apc(struct input_ctx *);
 | 
				
			||||||
void	input_enter_rename(struct input_ctx *);
 | 
					static void	input_enter_rename(struct input_ctx *);
 | 
				
			||||||
void	input_exit_rename(struct input_ctx *);
 | 
					static void	input_exit_rename(struct input_ctx *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Input state handlers. */
 | 
					/* Input state handlers. */
 | 
				
			||||||
int	input_print(struct input_ctx *);
 | 
					static int	input_print(struct input_ctx *);
 | 
				
			||||||
int	input_intermediate(struct input_ctx *);
 | 
					static int	input_intermediate(struct input_ctx *);
 | 
				
			||||||
int	input_parameter(struct input_ctx *);
 | 
					static int	input_parameter(struct input_ctx *);
 | 
				
			||||||
int	input_input(struct input_ctx *);
 | 
					static int	input_input(struct input_ctx *);
 | 
				
			||||||
int	input_c0_dispatch(struct input_ctx *);
 | 
					static int	input_c0_dispatch(struct input_ctx *);
 | 
				
			||||||
int	input_esc_dispatch(struct input_ctx *);
 | 
					static int	input_esc_dispatch(struct input_ctx *);
 | 
				
			||||||
int	input_csi_dispatch(struct input_ctx *);
 | 
					static int	input_csi_dispatch(struct input_ctx *);
 | 
				
			||||||
void	input_csi_dispatch_rm(struct input_ctx *);
 | 
					static void	input_csi_dispatch_rm(struct input_ctx *);
 | 
				
			||||||
void	input_csi_dispatch_rm_private(struct input_ctx *);
 | 
					static void	input_csi_dispatch_rm_private(struct input_ctx *);
 | 
				
			||||||
void	input_csi_dispatch_sm(struct input_ctx *);
 | 
					static void	input_csi_dispatch_sm(struct input_ctx *);
 | 
				
			||||||
void	input_csi_dispatch_sm_private(struct input_ctx *);
 | 
					static void	input_csi_dispatch_sm_private(struct input_ctx *);
 | 
				
			||||||
void	input_csi_dispatch_winops(struct input_ctx *);
 | 
					static void	input_csi_dispatch_winops(struct input_ctx *);
 | 
				
			||||||
void	input_csi_dispatch_sgr_256(struct input_ctx *, int, u_int *);
 | 
					static void	input_csi_dispatch_sgr_256(struct input_ctx *, int, u_int *);
 | 
				
			||||||
void	input_csi_dispatch_sgr_rgb(struct input_ctx *, int, u_int *);
 | 
					static void	input_csi_dispatch_sgr_rgb(struct input_ctx *, int, u_int *);
 | 
				
			||||||
void	input_csi_dispatch_sgr(struct input_ctx *);
 | 
					static void	input_csi_dispatch_sgr(struct input_ctx *);
 | 
				
			||||||
int	input_dcs_dispatch(struct input_ctx *);
 | 
					static int	input_dcs_dispatch(struct input_ctx *);
 | 
				
			||||||
int	input_utf8_open(struct input_ctx *);
 | 
					static int	input_utf8_open(struct input_ctx *);
 | 
				
			||||||
int	input_utf8_add(struct input_ctx *);
 | 
					static int	input_utf8_add(struct input_ctx *);
 | 
				
			||||||
int	input_utf8_close(struct input_ctx *);
 | 
					static int	input_utf8_close(struct input_ctx *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Command table comparison function. */
 | 
					/* Command table comparison function. */
 | 
				
			||||||
int	input_table_compare(const void *, const void *);
 | 
					static int	input_table_compare(const void *, const void *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Command table entry. */
 | 
					/* Command table entry. */
 | 
				
			||||||
struct input_table_entry {
 | 
					struct input_table_entry {
 | 
				
			||||||
@@ -164,7 +165,7 @@ enum input_esc_type {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Escape command table. */
 | 
					/* Escape command table. */
 | 
				
			||||||
const struct input_table_entry input_esc_table[] = {
 | 
					static const struct input_table_entry input_esc_table[] = {
 | 
				
			||||||
	{ '0', "(", INPUT_ESC_SCSG0_ON },
 | 
						{ '0', "(", INPUT_ESC_SCSG0_ON },
 | 
				
			||||||
	{ '0', ")", INPUT_ESC_SCSG1_ON },
 | 
						{ '0', ")", INPUT_ESC_SCSG1_ON },
 | 
				
			||||||
	{ '7', "",  INPUT_ESC_DECSC },
 | 
						{ '7', "",  INPUT_ESC_DECSC },
 | 
				
			||||||
@@ -217,7 +218,7 @@ enum input_csi_type {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Control (CSI) command table. */
 | 
					/* Control (CSI) command table. */
 | 
				
			||||||
const struct input_table_entry input_csi_table[] = {
 | 
					static const struct input_table_entry input_csi_table[] = {
 | 
				
			||||||
	{ '@', "",  INPUT_CSI_ICH },
 | 
						{ '@', "",  INPUT_CSI_ICH },
 | 
				
			||||||
	{ 'A', "",  INPUT_CSI_CUU },
 | 
						{ 'A', "",  INPUT_CSI_CUU },
 | 
				
			||||||
	{ 'B', "",  INPUT_CSI_CUD },
 | 
						{ 'B', "",  INPUT_CSI_CUD },
 | 
				
			||||||
@@ -276,169 +277,169 @@ struct input_state {
 | 
				
			|||||||
	{ 0x1b, 0x1b, NULL,		 &input_state_esc_enter }
 | 
						{ 0x1b, 0x1b, NULL,		 &input_state_esc_enter }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Forward declarations of state tables. */
 | 
					/* Forward declarations of state tables. */
 | 
				
			||||||
const struct input_transition input_state_ground_table[];
 | 
					static const struct input_transition input_state_ground_table[];
 | 
				
			||||||
const struct input_transition input_state_esc_enter_table[];
 | 
					static const struct input_transition input_state_esc_enter_table[];
 | 
				
			||||||
const struct input_transition input_state_esc_intermediate_table[];
 | 
					static const struct input_transition input_state_esc_intermediate_table[];
 | 
				
			||||||
const struct input_transition input_state_csi_enter_table[];
 | 
					static const struct input_transition input_state_csi_enter_table[];
 | 
				
			||||||
const struct input_transition input_state_csi_parameter_table[];
 | 
					static const struct input_transition input_state_csi_parameter_table[];
 | 
				
			||||||
const struct input_transition input_state_csi_intermediate_table[];
 | 
					static const struct input_transition input_state_csi_intermediate_table[];
 | 
				
			||||||
const struct input_transition input_state_csi_ignore_table[];
 | 
					static const struct input_transition input_state_csi_ignore_table[];
 | 
				
			||||||
const struct input_transition input_state_dcs_enter_table[];
 | 
					static const struct input_transition input_state_dcs_enter_table[];
 | 
				
			||||||
const struct input_transition input_state_dcs_parameter_table[];
 | 
					static const struct input_transition input_state_dcs_parameter_table[];
 | 
				
			||||||
const struct input_transition input_state_dcs_intermediate_table[];
 | 
					static const struct input_transition input_state_dcs_intermediate_table[];
 | 
				
			||||||
const struct input_transition input_state_dcs_handler_table[];
 | 
					static const struct input_transition input_state_dcs_handler_table[];
 | 
				
			||||||
const struct input_transition input_state_dcs_escape_table[];
 | 
					static const struct input_transition input_state_dcs_escape_table[];
 | 
				
			||||||
const struct input_transition input_state_dcs_ignore_table[];
 | 
					static const struct input_transition input_state_dcs_ignore_table[];
 | 
				
			||||||
const struct input_transition input_state_osc_string_table[];
 | 
					static const struct input_transition input_state_osc_string_table[];
 | 
				
			||||||
const struct input_transition input_state_apc_string_table[];
 | 
					static const struct input_transition input_state_apc_string_table[];
 | 
				
			||||||
const struct input_transition input_state_rename_string_table[];
 | 
					static const struct input_transition input_state_rename_string_table[];
 | 
				
			||||||
const struct input_transition input_state_consume_st_table[];
 | 
					static const struct input_transition input_state_consume_st_table[];
 | 
				
			||||||
const struct input_transition input_state_utf8_three_table[];
 | 
					static const struct input_transition input_state_utf8_three_table[];
 | 
				
			||||||
const struct input_transition input_state_utf8_two_table[];
 | 
					static const struct input_transition input_state_utf8_two_table[];
 | 
				
			||||||
const struct input_transition input_state_utf8_one_table[];
 | 
					static const struct input_transition input_state_utf8_one_table[];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* ground state definition. */
 | 
					/* ground state definition. */
 | 
				
			||||||
const struct input_state input_state_ground = {
 | 
					static const struct input_state input_state_ground = {
 | 
				
			||||||
	"ground",
 | 
						"ground",
 | 
				
			||||||
	input_ground, NULL,
 | 
						input_ground, NULL,
 | 
				
			||||||
	input_state_ground_table
 | 
						input_state_ground_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* esc_enter state definition. */
 | 
					/* esc_enter state definition. */
 | 
				
			||||||
const struct input_state input_state_esc_enter = {
 | 
					static const struct input_state input_state_esc_enter = {
 | 
				
			||||||
	"esc_enter",
 | 
						"esc_enter",
 | 
				
			||||||
	input_clear, NULL,
 | 
						input_clear, NULL,
 | 
				
			||||||
	input_state_esc_enter_table
 | 
						input_state_esc_enter_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* esc_intermediate state definition. */
 | 
					/* esc_intermediate state definition. */
 | 
				
			||||||
const struct input_state input_state_esc_intermediate = {
 | 
					static const struct input_state input_state_esc_intermediate = {
 | 
				
			||||||
	"esc_intermediate",
 | 
						"esc_intermediate",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_esc_intermediate_table
 | 
						input_state_esc_intermediate_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_enter state definition. */
 | 
					/* csi_enter state definition. */
 | 
				
			||||||
const struct input_state input_state_csi_enter = {
 | 
					static const struct input_state input_state_csi_enter = {
 | 
				
			||||||
	"csi_enter",
 | 
						"csi_enter",
 | 
				
			||||||
	input_clear, NULL,
 | 
						input_clear, NULL,
 | 
				
			||||||
	input_state_csi_enter_table
 | 
						input_state_csi_enter_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_parameter state definition. */
 | 
					/* csi_parameter state definition. */
 | 
				
			||||||
const struct input_state input_state_csi_parameter = {
 | 
					static const struct input_state input_state_csi_parameter = {
 | 
				
			||||||
	"csi_parameter",
 | 
						"csi_parameter",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_csi_parameter_table
 | 
						input_state_csi_parameter_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_intermediate state definition. */
 | 
					/* csi_intermediate state definition. */
 | 
				
			||||||
const struct input_state input_state_csi_intermediate = {
 | 
					static const struct input_state input_state_csi_intermediate = {
 | 
				
			||||||
	"csi_intermediate",
 | 
						"csi_intermediate",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_csi_intermediate_table
 | 
						input_state_csi_intermediate_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_ignore state definition. */
 | 
					/* csi_ignore state definition. */
 | 
				
			||||||
const struct input_state input_state_csi_ignore = {
 | 
					static const struct input_state input_state_csi_ignore = {
 | 
				
			||||||
	"csi_ignore",
 | 
						"csi_ignore",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_csi_ignore_table
 | 
						input_state_csi_ignore_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_enter state definition. */
 | 
					/* dcs_enter state definition. */
 | 
				
			||||||
const struct input_state input_state_dcs_enter = {
 | 
					static const struct input_state input_state_dcs_enter = {
 | 
				
			||||||
	"dcs_enter",
 | 
						"dcs_enter",
 | 
				
			||||||
	input_clear, NULL,
 | 
						input_clear, NULL,
 | 
				
			||||||
	input_state_dcs_enter_table
 | 
						input_state_dcs_enter_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_parameter state definition. */
 | 
					/* dcs_parameter state definition. */
 | 
				
			||||||
const struct input_state input_state_dcs_parameter = {
 | 
					static const struct input_state input_state_dcs_parameter = {
 | 
				
			||||||
	"dcs_parameter",
 | 
						"dcs_parameter",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_dcs_parameter_table
 | 
						input_state_dcs_parameter_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_intermediate state definition. */
 | 
					/* dcs_intermediate state definition. */
 | 
				
			||||||
const struct input_state input_state_dcs_intermediate = {
 | 
					static const struct input_state input_state_dcs_intermediate = {
 | 
				
			||||||
	"dcs_intermediate",
 | 
						"dcs_intermediate",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_dcs_intermediate_table
 | 
						input_state_dcs_intermediate_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_handler state definition. */
 | 
					/* dcs_handler state definition. */
 | 
				
			||||||
const struct input_state input_state_dcs_handler = {
 | 
					static const struct input_state input_state_dcs_handler = {
 | 
				
			||||||
	"dcs_handler",
 | 
						"dcs_handler",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_dcs_handler_table
 | 
						input_state_dcs_handler_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_escape state definition. */
 | 
					/* dcs_escape state definition. */
 | 
				
			||||||
const struct input_state input_state_dcs_escape = {
 | 
					static const struct input_state input_state_dcs_escape = {
 | 
				
			||||||
	"dcs_escape",
 | 
						"dcs_escape",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_dcs_escape_table
 | 
						input_state_dcs_escape_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_ignore state definition. */
 | 
					/* dcs_ignore state definition. */
 | 
				
			||||||
const struct input_state input_state_dcs_ignore = {
 | 
					static const struct input_state input_state_dcs_ignore = {
 | 
				
			||||||
	"dcs_ignore",
 | 
						"dcs_ignore",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_dcs_ignore_table
 | 
						input_state_dcs_ignore_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* osc_string state definition. */
 | 
					/* osc_string state definition. */
 | 
				
			||||||
const struct input_state input_state_osc_string = {
 | 
					static const struct input_state input_state_osc_string = {
 | 
				
			||||||
	"osc_string",
 | 
						"osc_string",
 | 
				
			||||||
	input_enter_osc, input_exit_osc,
 | 
						input_enter_osc, input_exit_osc,
 | 
				
			||||||
	input_state_osc_string_table
 | 
						input_state_osc_string_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* apc_string state definition. */
 | 
					/* apc_string state definition. */
 | 
				
			||||||
const struct input_state input_state_apc_string = {
 | 
					static const struct input_state input_state_apc_string = {
 | 
				
			||||||
	"apc_string",
 | 
						"apc_string",
 | 
				
			||||||
	input_enter_apc, input_exit_apc,
 | 
						input_enter_apc, input_exit_apc,
 | 
				
			||||||
	input_state_apc_string_table
 | 
						input_state_apc_string_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* rename_string state definition. */
 | 
					/* rename_string state definition. */
 | 
				
			||||||
const struct input_state input_state_rename_string = {
 | 
					static const struct input_state input_state_rename_string = {
 | 
				
			||||||
	"rename_string",
 | 
						"rename_string",
 | 
				
			||||||
	input_enter_rename, input_exit_rename,
 | 
						input_enter_rename, input_exit_rename,
 | 
				
			||||||
	input_state_rename_string_table
 | 
						input_state_rename_string_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* consume_st state definition. */
 | 
					/* consume_st state definition. */
 | 
				
			||||||
const struct input_state input_state_consume_st = {
 | 
					static const struct input_state input_state_consume_st = {
 | 
				
			||||||
	"consume_st",
 | 
						"consume_st",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_consume_st_table
 | 
						input_state_consume_st_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* utf8_three state definition. */
 | 
					/* utf8_three state definition. */
 | 
				
			||||||
const struct input_state input_state_utf8_three = {
 | 
					static const struct input_state input_state_utf8_three = {
 | 
				
			||||||
	"utf8_three",
 | 
						"utf8_three",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_utf8_three_table
 | 
						input_state_utf8_three_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* utf8_two state definition. */
 | 
					/* utf8_two state definition. */
 | 
				
			||||||
const struct input_state input_state_utf8_two = {
 | 
					static const struct input_state input_state_utf8_two = {
 | 
				
			||||||
	"utf8_two",
 | 
						"utf8_two",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_utf8_two_table
 | 
						input_state_utf8_two_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* utf8_one state definition. */
 | 
					/* utf8_one state definition. */
 | 
				
			||||||
const struct input_state input_state_utf8_one = {
 | 
					static const struct input_state input_state_utf8_one = {
 | 
				
			||||||
	"utf8_one",
 | 
						"utf8_one",
 | 
				
			||||||
	NULL, NULL,
 | 
						NULL, NULL,
 | 
				
			||||||
	input_state_utf8_one_table
 | 
						input_state_utf8_one_table
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* ground state table. */
 | 
					/* ground state table. */
 | 
				
			||||||
const struct input_transition input_state_ground_table[] = {
 | 
					static const struct input_transition input_state_ground_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, input_c0_dispatch, NULL },
 | 
						{ 0x00, 0x17, input_c0_dispatch, NULL },
 | 
				
			||||||
@@ -456,7 +457,7 @@ const struct input_transition input_state_ground_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* esc_enter state table. */
 | 
					/* esc_enter state table. */
 | 
				
			||||||
const struct input_transition input_state_esc_enter_table[] = {
 | 
					static const struct input_transition input_state_esc_enter_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
						{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
				
			||||||
@@ -483,7 +484,7 @@ const struct input_transition input_state_esc_enter_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* esc_interm state table. */
 | 
					/* esc_interm state table. */
 | 
				
			||||||
const struct input_transition input_state_esc_intermediate_table[] = {
 | 
					static const struct input_transition input_state_esc_intermediate_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
						{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
				
			||||||
@@ -497,7 +498,7 @@ const struct input_transition input_state_esc_intermediate_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_enter state table. */
 | 
					/* csi_enter state table. */
 | 
				
			||||||
const struct input_transition input_state_csi_enter_table[] = {
 | 
					static const struct input_transition input_state_csi_enter_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
						{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
				
			||||||
@@ -515,7 +516,7 @@ const struct input_transition input_state_csi_enter_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_parameter state table. */
 | 
					/* csi_parameter state table. */
 | 
				
			||||||
const struct input_transition input_state_csi_parameter_table[] = {
 | 
					static const struct input_transition input_state_csi_parameter_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
						{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
				
			||||||
@@ -533,7 +534,7 @@ const struct input_transition input_state_csi_parameter_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_intermediate state table. */
 | 
					/* csi_intermediate state table. */
 | 
				
			||||||
const struct input_transition input_state_csi_intermediate_table[] = {
 | 
					static const struct input_transition input_state_csi_intermediate_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
						{ 0x00, 0x17, input_c0_dispatch,  NULL },
 | 
				
			||||||
@@ -548,7 +549,7 @@ const struct input_transition input_state_csi_intermediate_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* csi_ignore state table. */
 | 
					/* csi_ignore state table. */
 | 
				
			||||||
const struct input_transition input_state_csi_ignore_table[] = {
 | 
					static const struct input_transition input_state_csi_ignore_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, input_c0_dispatch, NULL },
 | 
						{ 0x00, 0x17, input_c0_dispatch, NULL },
 | 
				
			||||||
@@ -562,7 +563,7 @@ const struct input_transition input_state_csi_ignore_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_enter state table. */
 | 
					/* dcs_enter state table. */
 | 
				
			||||||
const struct input_transition input_state_dcs_enter_table[] = {
 | 
					static const struct input_transition input_state_dcs_enter_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, NULL,		  NULL },
 | 
						{ 0x00, 0x17, NULL,		  NULL },
 | 
				
			||||||
@@ -580,7 +581,7 @@ const struct input_transition input_state_dcs_enter_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_parameter state table. */
 | 
					/* dcs_parameter state table. */
 | 
				
			||||||
const struct input_transition input_state_dcs_parameter_table[] = {
 | 
					static const struct input_transition input_state_dcs_parameter_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, NULL,		  NULL },
 | 
						{ 0x00, 0x17, NULL,		  NULL },
 | 
				
			||||||
@@ -598,7 +599,7 @@ const struct input_transition input_state_dcs_parameter_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_interm state table. */
 | 
					/* dcs_interm state table. */
 | 
				
			||||||
const struct input_transition input_state_dcs_intermediate_table[] = {
 | 
					static const struct input_transition input_state_dcs_intermediate_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, NULL,		  NULL },
 | 
						{ 0x00, 0x17, NULL,		  NULL },
 | 
				
			||||||
@@ -613,7 +614,7 @@ const struct input_transition input_state_dcs_intermediate_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_handler state table. */
 | 
					/* dcs_handler state table. */
 | 
				
			||||||
const struct input_transition input_state_dcs_handler_table[] = {
 | 
					static const struct input_transition input_state_dcs_handler_table[] = {
 | 
				
			||||||
	/* No INPUT_STATE_ANYWHERE */
 | 
						/* No INPUT_STATE_ANYWHERE */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x1a, input_input,  NULL },
 | 
						{ 0x00, 0x1a, input_input,  NULL },
 | 
				
			||||||
@@ -624,7 +625,7 @@ const struct input_transition input_state_dcs_handler_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_escape state table. */
 | 
					/* dcs_escape state table. */
 | 
				
			||||||
const struct input_transition input_state_dcs_escape_table[] = {
 | 
					static const struct input_transition input_state_dcs_escape_table[] = {
 | 
				
			||||||
	/* No INPUT_STATE_ANYWHERE */
 | 
						/* No INPUT_STATE_ANYWHERE */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x5b, input_input,	  &input_state_dcs_handler },
 | 
						{ 0x00, 0x5b, input_input,	  &input_state_dcs_handler },
 | 
				
			||||||
@@ -635,7 +636,7 @@ const struct input_transition input_state_dcs_escape_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* dcs_ignore state table. */
 | 
					/* dcs_ignore state table. */
 | 
				
			||||||
const struct input_transition input_state_dcs_ignore_table[] = {
 | 
					static const struct input_transition input_state_dcs_ignore_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, NULL,	    NULL },
 | 
						{ 0x00, 0x17, NULL,	    NULL },
 | 
				
			||||||
@@ -647,7 +648,7 @@ const struct input_transition input_state_dcs_ignore_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* osc_string state table. */
 | 
					/* osc_string state table. */
 | 
				
			||||||
const struct input_transition input_state_osc_string_table[] = {
 | 
					static const struct input_transition input_state_osc_string_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x06, NULL,	    NULL },
 | 
						{ 0x00, 0x06, NULL,	    NULL },
 | 
				
			||||||
@@ -661,7 +662,7 @@ const struct input_transition input_state_osc_string_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* apc_string state table. */
 | 
					/* apc_string state table. */
 | 
				
			||||||
const struct input_transition input_state_apc_string_table[] = {
 | 
					static const struct input_transition input_state_apc_string_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, NULL,	    NULL },
 | 
						{ 0x00, 0x17, NULL,	    NULL },
 | 
				
			||||||
@@ -673,7 +674,7 @@ const struct input_transition input_state_apc_string_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* rename_string state table. */
 | 
					/* rename_string state table. */
 | 
				
			||||||
const struct input_transition input_state_rename_string_table[] = {
 | 
					static const struct input_transition input_state_rename_string_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, NULL,	    NULL },
 | 
						{ 0x00, 0x17, NULL,	    NULL },
 | 
				
			||||||
@@ -685,7 +686,7 @@ const struct input_transition input_state_rename_string_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* consume_st state table. */
 | 
					/* consume_st state table. */
 | 
				
			||||||
const struct input_transition input_state_consume_st_table[] = {
 | 
					static const struct input_transition input_state_consume_st_table[] = {
 | 
				
			||||||
	INPUT_STATE_ANYWHERE,
 | 
						INPUT_STATE_ANYWHERE,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x17, NULL,	    NULL },
 | 
						{ 0x00, 0x17, NULL,	    NULL },
 | 
				
			||||||
@@ -697,7 +698,7 @@ const struct input_transition input_state_consume_st_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* utf8_three state table. */
 | 
					/* utf8_three state table. */
 | 
				
			||||||
const struct input_transition input_state_utf8_three_table[] = {
 | 
					static const struct input_transition input_state_utf8_three_table[] = {
 | 
				
			||||||
	/* No INPUT_STATE_ANYWHERE */
 | 
						/* No INPUT_STATE_ANYWHERE */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x7f, NULL,		&input_state_ground },
 | 
						{ 0x00, 0x7f, NULL,		&input_state_ground },
 | 
				
			||||||
@@ -708,7 +709,7 @@ const struct input_transition input_state_utf8_three_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* utf8_two state table. */
 | 
					/* utf8_two state table. */
 | 
				
			||||||
const struct input_transition input_state_utf8_two_table[] = {
 | 
					static const struct input_transition input_state_utf8_two_table[] = {
 | 
				
			||||||
	/* No INPUT_STATE_ANYWHERE */
 | 
						/* No INPUT_STATE_ANYWHERE */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x7f, NULL,	      &input_state_ground },
 | 
						{ 0x00, 0x7f, NULL,	      &input_state_ground },
 | 
				
			||||||
@@ -719,7 +720,7 @@ const struct input_transition input_state_utf8_two_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* utf8_one state table. */
 | 
					/* utf8_one state table. */
 | 
				
			||||||
const struct input_transition input_state_utf8_one_table[] = {
 | 
					static const struct input_transition input_state_utf8_one_table[] = {
 | 
				
			||||||
	/* No INPUT_STATE_ANYWHERE */
 | 
						/* No INPUT_STATE_ANYWHERE */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	{ 0x00, 0x7f, NULL,		&input_state_ground },
 | 
						{ 0x00, 0x7f, NULL,		&input_state_ground },
 | 
				
			||||||
@@ -730,7 +731,7 @@ const struct input_transition input_state_utf8_one_table[] = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Input table compare. */
 | 
					/* Input table compare. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_table_compare(const void *key, const void *value)
 | 
					input_table_compare(const void *key, const void *value)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const struct input_ctx		*ictx = key;
 | 
						const struct input_ctx		*ictx = key;
 | 
				
			||||||
@@ -742,7 +743,7 @@ input_table_compare(const void *key, const void *value)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Reset cell state to default. */
 | 
					/* Reset cell state to default. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_reset_cell(struct input_ctx *ictx)
 | 
					input_reset_cell(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	memcpy(&ictx->cell.cell, &grid_default_cell, sizeof ictx->cell.cell);
 | 
						memcpy(&ictx->cell.cell, &grid_default_cell, sizeof ictx->cell.cell);
 | 
				
			||||||
@@ -821,7 +822,7 @@ input_pending(struct window_pane *wp)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Change input state. */
 | 
					/* Change input state. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_set_state(struct window_pane *wp, const struct input_transition *itr)
 | 
					input_set_state(struct window_pane *wp, const struct input_transition *itr)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct input_ctx	*ictx = wp->ictx;
 | 
						struct input_ctx	*ictx = wp->ictx;
 | 
				
			||||||
@@ -906,7 +907,7 @@ input_parse(struct window_pane *wp)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Split the parameter list (if any). */
 | 
					/* Split the parameter list (if any). */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_split(struct input_ctx *ictx)
 | 
					input_split(struct input_ctx *ictx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -937,7 +938,7 @@ input_split(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Get an argument or return default value. */
 | 
					/* Get an argument or return default value. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_get(struct input_ctx *ictx, u_int validx, int minval, int defval)
 | 
					input_get(struct input_ctx *ictx, u_int validx, int minval, int defval)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int	retval;
 | 
						int	retval;
 | 
				
			||||||
@@ -954,7 +955,7 @@ input_get(struct input_ctx *ictx, u_int validx, int minval, int defval)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Reply to terminal query. */
 | 
					/* Reply to terminal query. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_reply(struct input_ctx *ictx, const char *fmt, ...)
 | 
					input_reply(struct input_ctx *ictx, const char *fmt, ...)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	va_list	ap;
 | 
						va_list	ap;
 | 
				
			||||||
@@ -969,7 +970,7 @@ input_reply(struct input_ctx *ictx, const char *fmt, ...)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Clear saved state. */
 | 
					/* Clear saved state. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_clear(struct input_ctx *ictx)
 | 
					input_clear(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	*ictx->interm_buf = '\0';
 | 
						*ictx->interm_buf = '\0';
 | 
				
			||||||
@@ -985,7 +986,7 @@ input_clear(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Reset for ground state. */
 | 
					/* Reset for ground state. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_ground(struct input_ctx *ictx)
 | 
					input_ground(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	evbuffer_drain(ictx->since_ground, EVBUFFER_LENGTH(ictx->since_ground));
 | 
						evbuffer_drain(ictx->since_ground, EVBUFFER_LENGTH(ictx->since_ground));
 | 
				
			||||||
@@ -997,7 +998,7 @@ input_ground(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Output this character to the screen. */
 | 
					/* Output this character to the screen. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_print(struct input_ctx *ictx)
 | 
					input_print(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int	set;
 | 
						int	set;
 | 
				
			||||||
@@ -1017,7 +1018,7 @@ input_print(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Collect intermediate string. */
 | 
					/* Collect intermediate string. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_intermediate(struct input_ctx *ictx)
 | 
					input_intermediate(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (ictx->interm_len == (sizeof ictx->interm_buf) - 1)
 | 
						if (ictx->interm_len == (sizeof ictx->interm_buf) - 1)
 | 
				
			||||||
@@ -1031,7 +1032,7 @@ input_intermediate(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Collect parameter string. */
 | 
					/* Collect parameter string. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_parameter(struct input_ctx *ictx)
 | 
					input_parameter(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (ictx->param_len == (sizeof ictx->param_buf) - 1)
 | 
						if (ictx->param_len == (sizeof ictx->param_buf) - 1)
 | 
				
			||||||
@@ -1045,7 +1046,7 @@ input_parameter(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Collect input string. */
 | 
					/* Collect input string. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_input(struct input_ctx *ictx)
 | 
					input_input(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	size_t available;
 | 
						size_t available;
 | 
				
			||||||
@@ -1067,7 +1068,7 @@ input_input(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Execute C0 control sequence. */
 | 
					/* Execute C0 control sequence. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_c0_dispatch(struct input_ctx *ictx)
 | 
					input_c0_dispatch(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct screen_write_ctx	*sctx = &ictx->ctx;
 | 
						struct screen_write_ctx	*sctx = &ictx->ctx;
 | 
				
			||||||
@@ -1120,7 +1121,7 @@ input_c0_dispatch(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Execute escape sequence. */
 | 
					/* Execute escape sequence. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_esc_dispatch(struct input_ctx *ictx)
 | 
					input_esc_dispatch(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct screen_write_ctx		*sctx = &ictx->ctx;
 | 
						struct screen_write_ctx		*sctx = &ictx->ctx;
 | 
				
			||||||
@@ -1193,7 +1194,7 @@ input_esc_dispatch(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Execute control sequence. */
 | 
					/* Execute control sequence. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_csi_dispatch(struct input_ctx *ictx)
 | 
					input_csi_dispatch(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct screen_write_ctx	       *sctx = &ictx->ctx;
 | 
						struct screen_write_ctx	       *sctx = &ictx->ctx;
 | 
				
			||||||
@@ -1410,7 +1411,7 @@ input_csi_dispatch(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI RM. */
 | 
					/* Handle CSI RM. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_rm(struct input_ctx *ictx)
 | 
					input_csi_dispatch_rm(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	u_int	i;
 | 
						u_int	i;
 | 
				
			||||||
@@ -1431,7 +1432,7 @@ input_csi_dispatch_rm(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI private RM. */
 | 
					/* Handle CSI private RM. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_rm_private(struct input_ctx *ictx)
 | 
					input_csi_dispatch_rm_private(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct window_pane	*wp = ictx->wp;
 | 
						struct window_pane	*wp = ictx->wp;
 | 
				
			||||||
@@ -1487,7 +1488,7 @@ input_csi_dispatch_rm_private(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI SM. */
 | 
					/* Handle CSI SM. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_sm(struct input_ctx *ictx)
 | 
					input_csi_dispatch_sm(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	u_int	i;
 | 
						u_int	i;
 | 
				
			||||||
@@ -1508,7 +1509,7 @@ input_csi_dispatch_sm(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI private SM. */
 | 
					/* Handle CSI private SM. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_sm_private(struct input_ctx *ictx)
 | 
					input_csi_dispatch_sm_private(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct window_pane	*wp = ictx->wp;
 | 
						struct window_pane	*wp = ictx->wp;
 | 
				
			||||||
@@ -1570,7 +1571,7 @@ input_csi_dispatch_sm_private(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI window operations. */
 | 
					/* Handle CSI window operations. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_winops(struct input_ctx *ictx)
 | 
					input_csi_dispatch_winops(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct window_pane	*wp = ictx->wp;
 | 
						struct window_pane	*wp = ictx->wp;
 | 
				
			||||||
@@ -1619,7 +1620,7 @@ input_csi_dispatch_winops(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI SGR for 256 colours. */
 | 
					/* Handle CSI SGR for 256 colours. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_sgr_256(struct input_ctx *ictx, int fgbg, u_int *i)
 | 
					input_csi_dispatch_sgr_256(struct input_ctx *ictx, int fgbg, u_int *i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct grid_cell	*gc = &ictx->cell.cell;
 | 
						struct grid_cell	*gc = &ictx->cell.cell;
 | 
				
			||||||
@@ -1641,7 +1642,7 @@ input_csi_dispatch_sgr_256(struct input_ctx *ictx, int fgbg, u_int *i)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI SGR for RGB colours. */
 | 
					/* Handle CSI SGR for RGB colours. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_sgr_rgb(struct input_ctx *ictx, int fgbg, u_int *i)
 | 
					input_csi_dispatch_sgr_rgb(struct input_ctx *ictx, int fgbg, u_int *i)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct grid_cell	*gc = &ictx->cell.cell;
 | 
						struct grid_cell	*gc = &ictx->cell.cell;
 | 
				
			||||||
@@ -1667,7 +1668,7 @@ input_csi_dispatch_sgr_rgb(struct input_ctx *ictx, int fgbg, u_int *i)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Handle CSI SGR. */
 | 
					/* Handle CSI SGR. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_csi_dispatch_sgr(struct input_ctx *ictx)
 | 
					input_csi_dispatch_sgr(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct grid_cell	*gc = &ictx->cell.cell;
 | 
						struct grid_cell	*gc = &ictx->cell.cell;
 | 
				
			||||||
@@ -1787,7 +1788,7 @@ input_csi_dispatch_sgr(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* DCS terminator (ST) received. */
 | 
					/* DCS terminator (ST) received. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_dcs_dispatch(struct input_ctx *ictx)
 | 
					input_dcs_dispatch(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const char	prefix[] = "tmux;";
 | 
						const char	prefix[] = "tmux;";
 | 
				
			||||||
@@ -1809,7 +1810,7 @@ input_dcs_dispatch(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* OSC string started. */
 | 
					/* OSC string started. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_enter_osc(struct input_ctx *ictx)
 | 
					input_enter_osc(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	log_debug("%s", __func__);
 | 
						log_debug("%s", __func__);
 | 
				
			||||||
@@ -1818,7 +1819,7 @@ input_enter_osc(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* OSC terminator (ST) received. */
 | 
					/* OSC terminator (ST) received. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_exit_osc(struct input_ctx *ictx)
 | 
					input_exit_osc(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	u_char	*p = ictx->input_buf;
 | 
						u_char	*p = ictx->input_buf;
 | 
				
			||||||
@@ -1858,7 +1859,7 @@ input_exit_osc(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* APC string started. */
 | 
					/* APC string started. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_enter_apc(struct input_ctx *ictx)
 | 
					input_enter_apc(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	log_debug("%s", __func__);
 | 
						log_debug("%s", __func__);
 | 
				
			||||||
@@ -1867,7 +1868,7 @@ input_enter_apc(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* APC terminator (ST) received. */
 | 
					/* APC terminator (ST) received. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_exit_apc(struct input_ctx *ictx)
 | 
					input_exit_apc(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (ictx->flags & INPUT_DISCARD)
 | 
						if (ictx->flags & INPUT_DISCARD)
 | 
				
			||||||
@@ -1879,7 +1880,7 @@ input_exit_apc(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Rename string started. */
 | 
					/* Rename string started. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_enter_rename(struct input_ctx *ictx)
 | 
					input_enter_rename(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	log_debug("%s", __func__);
 | 
						log_debug("%s", __func__);
 | 
				
			||||||
@@ -1888,7 +1889,7 @@ input_enter_rename(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Rename terminator (ST) received. */
 | 
					/* Rename terminator (ST) received. */
 | 
				
			||||||
void
 | 
					static void
 | 
				
			||||||
input_exit_rename(struct input_ctx *ictx)
 | 
					input_exit_rename(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (ictx->flags & INPUT_DISCARD)
 | 
						if (ictx->flags & INPUT_DISCARD)
 | 
				
			||||||
@@ -1904,7 +1905,7 @@ input_exit_rename(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Open UTF-8 character. */
 | 
					/* Open UTF-8 character. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_utf8_open(struct input_ctx *ictx)
 | 
					input_utf8_open(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct utf8_data	*ud = &ictx->utf8data;
 | 
						struct utf8_data	*ud = &ictx->utf8data;
 | 
				
			||||||
@@ -1918,7 +1919,7 @@ input_utf8_open(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Append to UTF-8 character. */
 | 
					/* Append to UTF-8 character. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_utf8_add(struct input_ctx *ictx)
 | 
					input_utf8_add(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct utf8_data	*ud = &ictx->utf8data;
 | 
						struct utf8_data	*ud = &ictx->utf8data;
 | 
				
			||||||
@@ -1932,7 +1933,7 @@ input_utf8_add(struct input_ctx *ictx)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Close UTF-8 string. */
 | 
					/* Close UTF-8 string. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
input_utf8_close(struct input_ctx *ictx)
 | 
					input_utf8_close(struct input_ctx *ictx)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct utf8_data	*ud = &ictx->utf8data;
 | 
						struct utf8_data	*ud = &ictx->utf8data;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,25 +33,25 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Choice option type lists. */
 | 
					/* Choice option type lists. */
 | 
				
			||||||
const char *options_table_mode_keys_list[] = {
 | 
					static const char *options_table_mode_keys_list[] = {
 | 
				
			||||||
	"emacs", "vi", NULL
 | 
						"emacs", "vi", NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *options_table_clock_mode_style_list[] = {
 | 
					static const char *options_table_clock_mode_style_list[] = {
 | 
				
			||||||
	"12", "24", NULL
 | 
						"12", "24", NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *options_table_status_keys_list[] = {
 | 
					static const char *options_table_status_keys_list[] = {
 | 
				
			||||||
	"emacs", "vi", NULL
 | 
						"emacs", "vi", NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *options_table_status_justify_list[] = {
 | 
					static const char *options_table_status_justify_list[] = {
 | 
				
			||||||
	"left", "centre", "right", NULL
 | 
						"left", "centre", "right", NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *options_table_status_position_list[] = {
 | 
					static const char *options_table_status_position_list[] = {
 | 
				
			||||||
	"top", "bottom", NULL
 | 
						"top", "bottom", NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *options_table_bell_action_list[] = {
 | 
					static const char *options_table_bell_action_list[] = {
 | 
				
			||||||
	"none", "any", "current", "other", NULL
 | 
						"none", "any", "current", "other", NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const char *options_table_pane_status_list[] = {
 | 
					static const char *options_table_pane_status_list[] = {
 | 
				
			||||||
	"off", "top", "bottom", NULL
 | 
						"off", "top", "bottom", NULL
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,14 +22,14 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "tmux.h"
 | 
					#include "tmux.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int	tty_acs_cmp(const void *, const void *);
 | 
					static int	tty_acs_cmp(const void *, const void *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Table mapping ACS entries to UTF-8. */
 | 
					/* Table mapping ACS entries to UTF-8. */
 | 
				
			||||||
struct tty_acs_entry {
 | 
					struct tty_acs_entry {
 | 
				
			||||||
	u_char	 	 key;
 | 
						u_char	 	 key;
 | 
				
			||||||
	const char	*string;
 | 
						const char	*string;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
const struct tty_acs_entry tty_acs_table[] = {
 | 
					static const struct tty_acs_entry tty_acs_table[] = {
 | 
				
			||||||
	{ '+', "\342\206\222" },	/* arrow pointing right */
 | 
						{ '+', "\342\206\222" },	/* arrow pointing right */
 | 
				
			||||||
	{ ',', "\342\206\220" },	/* arrow pointing left */
 | 
						{ ',', "\342\206\220" },	/* arrow pointing left */
 | 
				
			||||||
	{ '-', "\342\206\221" },	/* arrow pointing up */
 | 
						{ '-', "\342\206\221" },	/* arrow pointing up */
 | 
				
			||||||
@@ -64,7 +64,7 @@ const struct tty_acs_entry tty_acs_table[] = {
 | 
				
			|||||||
	{ '~', "\302\267" }		/* bullet */
 | 
						{ '~', "\302\267" }		/* bullet */
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
tty_acs_cmp(const void *key, const void *value)
 | 
					tty_acs_cmp(const void *key, const void *value)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	const struct tty_acs_entry	*entry = value;
 | 
						const struct tty_acs_entry	*entry = value;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -948,13 +948,13 @@ window_copy_key_input(struct window_pane *wp, key_code key)
 | 
				
			|||||||
			data->searchtype = data->inputtype;
 | 
								data->searchtype = data->inputtype;
 | 
				
			||||||
			data->searchstr = xstrdup(data->inputstr);
 | 
								data->searchstr = xstrdup(data->inputstr);
 | 
				
			||||||
			for (; np != 0; np--)
 | 
								for (; np != 0; np--)
 | 
				
			||||||
				window_copy_search_up(wp, data->inputstr, 0);
 | 
									window_copy_search_up(wp, data->inputstr, 1);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case WINDOW_COPY_SEARCHDOWN:
 | 
							case WINDOW_COPY_SEARCHDOWN:
 | 
				
			||||||
			data->searchtype = data->inputtype;
 | 
								data->searchtype = data->inputtype;
 | 
				
			||||||
			data->searchstr = xstrdup(data->inputstr);
 | 
								data->searchstr = xstrdup(data->inputstr);
 | 
				
			||||||
			for (; np != 0; np--)
 | 
								for (; np != 0; np--)
 | 
				
			||||||
				window_copy_search_down(wp, data->inputstr, 0);
 | 
									window_copy_search_down(wp, data->inputstr, 1);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
		case WINDOW_COPY_NAMEDBUFFER:
 | 
							case WINDOW_COPY_NAMEDBUFFER:
 | 
				
			||||||
			window_copy_copy_selection(wp, data->inputstr);
 | 
								window_copy_copy_selection(wp, data->inputstr);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										13
									
								
								xterm-keys.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								xterm-keys.c
									
									
									
									
									
								
							@@ -40,16 +40,17 @@
 | 
				
			|||||||
 * We accept any but always output the latter (it comes first in the table).
 | 
					 * We accept any but always output the latter (it comes first in the table).
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int	xterm_keys_match(const char *, const char *, size_t, size_t *,
 | 
					static int	xterm_keys_match(const char *, const char *, size_t, size_t *,
 | 
				
			||||||
	    key_code *);
 | 
							    key_code *);
 | 
				
			||||||
int	xterm_keys_modifiers(const char *, size_t, size_t *, key_code *);
 | 
					static int	xterm_keys_modifiers(const char *, size_t, size_t *,
 | 
				
			||||||
 | 
							    key_code *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct xterm_keys_entry {
 | 
					struct xterm_keys_entry {
 | 
				
			||||||
	key_code	 key;
 | 
						key_code	 key;
 | 
				
			||||||
	const char	*template;
 | 
						const char	*template;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const struct xterm_keys_entry xterm_keys_table[] = {
 | 
					static const struct xterm_keys_entry xterm_keys_table[] = {
 | 
				
			||||||
	{ KEYC_F1,	"\033[1;_P" },
 | 
						{ KEYC_F1,	"\033[1;_P" },
 | 
				
			||||||
	{ KEYC_F1,	"\033O1;_P" },
 | 
						{ KEYC_F1,	"\033O1;_P" },
 | 
				
			||||||
	{ KEYC_F1,	"\033O_P" },
 | 
						{ KEYC_F1,	"\033O_P" },
 | 
				
			||||||
@@ -114,7 +115,7 @@ const struct xterm_keys_entry xterm_keys_table[] = {
 | 
				
			|||||||
 * Match key against buffer, treating _ as a wildcard. Return -1 for no match,
 | 
					 * Match key against buffer, treating _ as a wildcard. Return -1 for no match,
 | 
				
			||||||
 * 0 for match, 1 if the end of the buffer is reached (need more data).
 | 
					 * 0 for match, 1 if the end of the buffer is reached (need more data).
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
xterm_keys_match(const char *template, const char *buf, size_t len,
 | 
					xterm_keys_match(const char *template, const char *buf, size_t len,
 | 
				
			||||||
    size_t *size, key_code *modifiers)
 | 
					    size_t *size, key_code *modifiers)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
@@ -148,7 +149,7 @@ xterm_keys_match(const char *template, const char *buf, size_t len,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Find modifiers from buffer. */
 | 
					/* Find modifiers from buffer. */
 | 
				
			||||||
int
 | 
					static int
 | 
				
			||||||
xterm_keys_modifiers(const char *buf, size_t len, size_t *pos,
 | 
					xterm_keys_modifiers(const char *buf, size_t len, size_t *pos,
 | 
				
			||||||
    key_code *modifiers)
 | 
					    key_code *modifiers)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user