=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/input.c,v retrieving revision 1.103 retrieving revision 1.104 diff -c -r1.103 -r1.104 *** src/usr.bin/tmux/input.c 2016/09/28 14:40:07 1.103 --- src/usr.bin/tmux/input.c 2016/10/03 22:52:11 1.104 *************** *** 1,4 **** ! /* $OpenBSD: input.c,v 1.103 2016/09/28 14:40:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: input.c,v 1.104 2016/10/03 22:52:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 98,142 **** /* Helper functions. */ struct input_transition; ! int input_split(struct input_ctx *); ! int input_get(struct input_ctx *, u_int, int, int); ! void printflike(2, 3) input_reply(struct input_ctx *, const char *, ...); ! void input_set_state(struct window_pane *, const struct input_transition *); ! void input_reset_cell(struct input_ctx *); /* Transition entry/exit handlers. */ ! void input_clear(struct input_ctx *); ! void input_ground(struct input_ctx *); ! void input_enter_osc(struct input_ctx *); ! void input_exit_osc(struct input_ctx *); ! void input_enter_apc(struct input_ctx *); ! void input_exit_apc(struct input_ctx *); ! void input_enter_rename(struct input_ctx *); ! void input_exit_rename(struct input_ctx *); /* Input state handlers. */ ! int input_print(struct input_ctx *); ! int input_intermediate(struct input_ctx *); ! int input_parameter(struct input_ctx *); ! int input_input(struct input_ctx *); ! int input_c0_dispatch(struct input_ctx *); ! int input_esc_dispatch(struct input_ctx *); ! int input_csi_dispatch(struct input_ctx *); ! void input_csi_dispatch_rm(struct input_ctx *); ! void input_csi_dispatch_rm_private(struct input_ctx *); ! void input_csi_dispatch_sm(struct input_ctx *); ! void input_csi_dispatch_sm_private(struct input_ctx *); ! void input_csi_dispatch_winops(struct input_ctx *); ! void input_csi_dispatch_sgr_256(struct input_ctx *, int, u_int *); ! void input_csi_dispatch_sgr_rgb(struct input_ctx *, int, u_int *); ! void input_csi_dispatch_sgr(struct input_ctx *); ! int input_dcs_dispatch(struct input_ctx *); ! int input_utf8_open(struct input_ctx *); ! int input_utf8_add(struct input_ctx *); ! int input_utf8_close(struct input_ctx *); /* Command table comparison function. */ ! int input_table_compare(const void *, const void *); /* Command table entry. */ struct input_table_entry { --- 98,143 ---- /* Helper functions. */ struct input_transition; ! static int input_split(struct input_ctx *); ! static int input_get(struct input_ctx *, u_int, int, int); ! static void printflike(2, 3) input_reply(struct input_ctx *, const char *, ...); ! static void input_set_state(struct window_pane *, ! const struct input_transition *); ! static void input_reset_cell(struct input_ctx *); /* Transition entry/exit handlers. */ ! static void input_clear(struct input_ctx *); ! static void input_ground(struct input_ctx *); ! static void input_enter_osc(struct input_ctx *); ! static void input_exit_osc(struct input_ctx *); ! static void input_enter_apc(struct input_ctx *); ! static void input_exit_apc(struct input_ctx *); ! static void input_enter_rename(struct input_ctx *); ! static void input_exit_rename(struct input_ctx *); /* Input state handlers. */ ! static int input_print(struct input_ctx *); ! static int input_intermediate(struct input_ctx *); ! static int input_parameter(struct input_ctx *); ! static int input_input(struct input_ctx *); ! static int input_c0_dispatch(struct input_ctx *); ! static int input_esc_dispatch(struct input_ctx *); ! static int input_csi_dispatch(struct input_ctx *); ! static void input_csi_dispatch_rm(struct input_ctx *); ! static void input_csi_dispatch_rm_private(struct input_ctx *); ! static void input_csi_dispatch_sm(struct input_ctx *); ! static void input_csi_dispatch_sm_private(struct input_ctx *); ! static void input_csi_dispatch_winops(struct input_ctx *); ! static void input_csi_dispatch_sgr_256(struct input_ctx *, int, u_int *); ! static void input_csi_dispatch_sgr_rgb(struct input_ctx *, int, u_int *); ! static void input_csi_dispatch_sgr(struct input_ctx *); ! static int input_dcs_dispatch(struct input_ctx *); ! static int input_utf8_open(struct input_ctx *); ! static int input_utf8_add(struct input_ctx *); ! static int input_utf8_close(struct input_ctx *); /* Command table comparison function. */ ! static int input_table_compare(const void *, const void *); /* Command table entry. */ struct input_table_entry { *************** *** 164,170 **** }; /* Escape command table. */ ! const struct input_table_entry input_esc_table[] = { { '0', "(", INPUT_ESC_SCSG0_ON }, { '0', ")", INPUT_ESC_SCSG1_ON }, { '7', "", INPUT_ESC_DECSC }, --- 165,171 ---- }; /* Escape command table. */ ! static const struct input_table_entry input_esc_table[] = { { '0', "(", INPUT_ESC_SCSG0_ON }, { '0', ")", INPUT_ESC_SCSG1_ON }, { '7', "", INPUT_ESC_DECSC }, *************** *** 217,223 **** }; /* Control (CSI) command table. */ ! const struct input_table_entry input_csi_table[] = { { '@', "", INPUT_CSI_ICH }, { 'A', "", INPUT_CSI_CUU }, { 'B', "", INPUT_CSI_CUD }, --- 218,224 ---- }; /* Control (CSI) command table. */ ! static const struct input_table_entry input_csi_table[] = { { '@', "", INPUT_CSI_ICH }, { 'A', "", INPUT_CSI_CUU }, { 'B', "", INPUT_CSI_CUD }, *************** *** 276,444 **** { 0x1b, 0x1b, NULL, &input_state_esc_enter } /* Forward declarations of state tables. */ ! const struct input_transition input_state_ground_table[]; ! const struct input_transition input_state_esc_enter_table[]; ! const struct input_transition input_state_esc_intermediate_table[]; ! const struct input_transition input_state_csi_enter_table[]; ! const struct input_transition input_state_csi_parameter_table[]; ! const struct input_transition input_state_csi_intermediate_table[]; ! const struct input_transition input_state_csi_ignore_table[]; ! const struct input_transition input_state_dcs_enter_table[]; ! const struct input_transition input_state_dcs_parameter_table[]; ! const struct input_transition input_state_dcs_intermediate_table[]; ! const struct input_transition input_state_dcs_handler_table[]; ! const struct input_transition input_state_dcs_escape_table[]; ! const struct input_transition input_state_dcs_ignore_table[]; ! const struct input_transition input_state_osc_string_table[]; ! const struct input_transition input_state_apc_string_table[]; ! const struct input_transition input_state_rename_string_table[]; ! const struct input_transition input_state_consume_st_table[]; ! const struct input_transition input_state_utf8_three_table[]; ! const struct input_transition input_state_utf8_two_table[]; ! const struct input_transition input_state_utf8_one_table[]; /* ground state definition. */ ! const struct input_state input_state_ground = { "ground", input_ground, NULL, input_state_ground_table }; /* esc_enter state definition. */ ! const struct input_state input_state_esc_enter = { "esc_enter", input_clear, NULL, input_state_esc_enter_table }; /* esc_intermediate state definition. */ ! const struct input_state input_state_esc_intermediate = { "esc_intermediate", NULL, NULL, input_state_esc_intermediate_table }; /* csi_enter state definition. */ ! const struct input_state input_state_csi_enter = { "csi_enter", input_clear, NULL, input_state_csi_enter_table }; /* csi_parameter state definition. */ ! const struct input_state input_state_csi_parameter = { "csi_parameter", NULL, NULL, input_state_csi_parameter_table }; /* csi_intermediate state definition. */ ! const struct input_state input_state_csi_intermediate = { "csi_intermediate", NULL, NULL, input_state_csi_intermediate_table }; /* csi_ignore state definition. */ ! const struct input_state input_state_csi_ignore = { "csi_ignore", NULL, NULL, input_state_csi_ignore_table }; /* dcs_enter state definition. */ ! const struct input_state input_state_dcs_enter = { "dcs_enter", input_clear, NULL, input_state_dcs_enter_table }; /* dcs_parameter state definition. */ ! const struct input_state input_state_dcs_parameter = { "dcs_parameter", NULL, NULL, input_state_dcs_parameter_table }; /* dcs_intermediate state definition. */ ! const struct input_state input_state_dcs_intermediate = { "dcs_intermediate", NULL, NULL, input_state_dcs_intermediate_table }; /* dcs_handler state definition. */ ! const struct input_state input_state_dcs_handler = { "dcs_handler", NULL, NULL, input_state_dcs_handler_table }; /* dcs_escape state definition. */ ! const struct input_state input_state_dcs_escape = { "dcs_escape", NULL, NULL, input_state_dcs_escape_table }; /* dcs_ignore state definition. */ ! const struct input_state input_state_dcs_ignore = { "dcs_ignore", NULL, NULL, input_state_dcs_ignore_table }; /* osc_string state definition. */ ! const struct input_state input_state_osc_string = { "osc_string", input_enter_osc, input_exit_osc, input_state_osc_string_table }; /* apc_string state definition. */ ! const struct input_state input_state_apc_string = { "apc_string", input_enter_apc, input_exit_apc, input_state_apc_string_table }; /* rename_string state definition. */ ! const struct input_state input_state_rename_string = { "rename_string", input_enter_rename, input_exit_rename, input_state_rename_string_table }; /* consume_st state definition. */ ! const struct input_state input_state_consume_st = { "consume_st", NULL, NULL, input_state_consume_st_table }; /* utf8_three state definition. */ ! const struct input_state input_state_utf8_three = { "utf8_three", NULL, NULL, input_state_utf8_three_table }; /* utf8_two state definition. */ ! const struct input_state input_state_utf8_two = { "utf8_two", NULL, NULL, input_state_utf8_two_table }; /* utf8_one state definition. */ ! const struct input_state input_state_utf8_one = { "utf8_one", NULL, NULL, input_state_utf8_one_table }; /* ground state table. */ ! const struct input_transition input_state_ground_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, --- 277,445 ---- { 0x1b, 0x1b, NULL, &input_state_esc_enter } /* Forward declarations of state tables. */ ! static const struct input_transition input_state_ground_table[]; ! static const struct input_transition input_state_esc_enter_table[]; ! static const struct input_transition input_state_esc_intermediate_table[]; ! static const struct input_transition input_state_csi_enter_table[]; ! static const struct input_transition input_state_csi_parameter_table[]; ! static const struct input_transition input_state_csi_intermediate_table[]; ! static const struct input_transition input_state_csi_ignore_table[]; ! static const struct input_transition input_state_dcs_enter_table[]; ! static const struct input_transition input_state_dcs_parameter_table[]; ! static const struct input_transition input_state_dcs_intermediate_table[]; ! static const struct input_transition input_state_dcs_handler_table[]; ! static const struct input_transition input_state_dcs_escape_table[]; ! static const struct input_transition input_state_dcs_ignore_table[]; ! static const struct input_transition input_state_osc_string_table[]; ! static const struct input_transition input_state_apc_string_table[]; ! static const struct input_transition input_state_rename_string_table[]; ! static const struct input_transition input_state_consume_st_table[]; ! static const struct input_transition input_state_utf8_three_table[]; ! static const struct input_transition input_state_utf8_two_table[]; ! static const struct input_transition input_state_utf8_one_table[]; /* ground state definition. */ ! static const struct input_state input_state_ground = { "ground", input_ground, NULL, input_state_ground_table }; /* esc_enter state definition. */ ! static const struct input_state input_state_esc_enter = { "esc_enter", input_clear, NULL, input_state_esc_enter_table }; /* esc_intermediate state definition. */ ! static const struct input_state input_state_esc_intermediate = { "esc_intermediate", NULL, NULL, input_state_esc_intermediate_table }; /* csi_enter state definition. */ ! static const struct input_state input_state_csi_enter = { "csi_enter", input_clear, NULL, input_state_csi_enter_table }; /* csi_parameter state definition. */ ! static const struct input_state input_state_csi_parameter = { "csi_parameter", NULL, NULL, input_state_csi_parameter_table }; /* csi_intermediate state definition. */ ! static const struct input_state input_state_csi_intermediate = { "csi_intermediate", NULL, NULL, input_state_csi_intermediate_table }; /* csi_ignore state definition. */ ! static const struct input_state input_state_csi_ignore = { "csi_ignore", NULL, NULL, input_state_csi_ignore_table }; /* dcs_enter state definition. */ ! static const struct input_state input_state_dcs_enter = { "dcs_enter", input_clear, NULL, input_state_dcs_enter_table }; /* dcs_parameter state definition. */ ! static const struct input_state input_state_dcs_parameter = { "dcs_parameter", NULL, NULL, input_state_dcs_parameter_table }; /* dcs_intermediate state definition. */ ! static const struct input_state input_state_dcs_intermediate = { "dcs_intermediate", NULL, NULL, input_state_dcs_intermediate_table }; /* dcs_handler state definition. */ ! static const struct input_state input_state_dcs_handler = { "dcs_handler", NULL, NULL, input_state_dcs_handler_table }; /* dcs_escape state definition. */ ! static const struct input_state input_state_dcs_escape = { "dcs_escape", NULL, NULL, input_state_dcs_escape_table }; /* dcs_ignore state definition. */ ! static const struct input_state input_state_dcs_ignore = { "dcs_ignore", NULL, NULL, input_state_dcs_ignore_table }; /* osc_string state definition. */ ! static const struct input_state input_state_osc_string = { "osc_string", input_enter_osc, input_exit_osc, input_state_osc_string_table }; /* apc_string state definition. */ ! static const struct input_state input_state_apc_string = { "apc_string", input_enter_apc, input_exit_apc, input_state_apc_string_table }; /* rename_string state definition. */ ! static const struct input_state input_state_rename_string = { "rename_string", input_enter_rename, input_exit_rename, input_state_rename_string_table }; /* consume_st state definition. */ ! static const struct input_state input_state_consume_st = { "consume_st", NULL, NULL, input_state_consume_st_table }; /* utf8_three state definition. */ ! static const struct input_state input_state_utf8_three = { "utf8_three", NULL, NULL, input_state_utf8_three_table }; /* utf8_two state definition. */ ! static const struct input_state input_state_utf8_two = { "utf8_two", NULL, NULL, input_state_utf8_two_table }; /* utf8_one state definition. */ ! static const struct input_state input_state_utf8_one = { "utf8_one", NULL, NULL, input_state_utf8_one_table }; /* ground state table. */ ! static const struct input_transition input_state_ground_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, *************** *** 456,462 **** }; /* esc_enter state table. */ ! const struct input_transition input_state_esc_enter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, --- 457,463 ---- }; /* esc_enter state table. */ ! static const struct input_transition input_state_esc_enter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, *************** *** 483,489 **** }; /* esc_interm state table. */ ! const struct input_transition input_state_esc_intermediate_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, --- 484,490 ---- }; /* esc_interm state table. */ ! static const struct input_transition input_state_esc_intermediate_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, *************** *** 497,503 **** }; /* csi_enter state table. */ ! const struct input_transition input_state_csi_enter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, --- 498,504 ---- }; /* csi_enter state table. */ ! static const struct input_transition input_state_csi_enter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, *************** *** 515,521 **** }; /* csi_parameter state table. */ ! const struct input_transition input_state_csi_parameter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, --- 516,522 ---- }; /* csi_parameter state table. */ ! static const struct input_transition input_state_csi_parameter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, *************** *** 533,539 **** }; /* csi_intermediate state table. */ ! const struct input_transition input_state_csi_intermediate_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, --- 534,540 ---- }; /* csi_intermediate state table. */ ! static const struct input_transition input_state_csi_intermediate_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, *************** *** 548,554 **** }; /* csi_ignore state table. */ ! const struct input_transition input_state_csi_ignore_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, --- 549,555 ---- }; /* csi_ignore state table. */ ! static const struct input_transition input_state_csi_ignore_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, input_c0_dispatch, NULL }, *************** *** 562,568 **** }; /* dcs_enter state table. */ ! const struct input_transition input_state_dcs_enter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, --- 563,569 ---- }; /* dcs_enter state table. */ ! static const struct input_transition input_state_dcs_enter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, *************** *** 580,586 **** }; /* dcs_parameter state table. */ ! const struct input_transition input_state_dcs_parameter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, --- 581,587 ---- }; /* dcs_parameter state table. */ ! static const struct input_transition input_state_dcs_parameter_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, *************** *** 598,604 **** }; /* dcs_interm state table. */ ! const struct input_transition input_state_dcs_intermediate_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, --- 599,605 ---- }; /* dcs_interm state table. */ ! static const struct input_transition input_state_dcs_intermediate_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, *************** *** 613,619 **** }; /* dcs_handler state table. */ ! const struct input_transition input_state_dcs_handler_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x1a, input_input, NULL }, --- 614,620 ---- }; /* dcs_handler state table. */ ! static const struct input_transition input_state_dcs_handler_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x1a, input_input, NULL }, *************** *** 624,630 **** }; /* dcs_escape state table. */ ! const struct input_transition input_state_dcs_escape_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x5b, input_input, &input_state_dcs_handler }, --- 625,631 ---- }; /* dcs_escape state table. */ ! static const struct input_transition input_state_dcs_escape_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x5b, input_input, &input_state_dcs_handler }, *************** *** 635,641 **** }; /* dcs_ignore state table. */ ! const struct input_transition input_state_dcs_ignore_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, --- 636,642 ---- }; /* dcs_ignore state table. */ ! static const struct input_transition input_state_dcs_ignore_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, *************** *** 647,653 **** }; /* osc_string state table. */ ! const struct input_transition input_state_osc_string_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x06, NULL, NULL }, --- 648,654 ---- }; /* osc_string state table. */ ! static const struct input_transition input_state_osc_string_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x06, NULL, NULL }, *************** *** 661,667 **** }; /* apc_string state table. */ ! const struct input_transition input_state_apc_string_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, --- 662,668 ---- }; /* apc_string state table. */ ! static const struct input_transition input_state_apc_string_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, *************** *** 673,679 **** }; /* rename_string state table. */ ! const struct input_transition input_state_rename_string_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, --- 674,680 ---- }; /* rename_string state table. */ ! static const struct input_transition input_state_rename_string_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, *************** *** 685,691 **** }; /* consume_st state table. */ ! const struct input_transition input_state_consume_st_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, --- 686,692 ---- }; /* consume_st state table. */ ! static const struct input_transition input_state_consume_st_table[] = { INPUT_STATE_ANYWHERE, { 0x00, 0x17, NULL, NULL }, *************** *** 697,703 **** }; /* utf8_three state table. */ ! const struct input_transition input_state_utf8_three_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x7f, NULL, &input_state_ground }, --- 698,704 ---- }; /* utf8_three state table. */ ! static const struct input_transition input_state_utf8_three_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x7f, NULL, &input_state_ground }, *************** *** 708,714 **** }; /* utf8_two state table. */ ! const struct input_transition input_state_utf8_two_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x7f, NULL, &input_state_ground }, --- 709,715 ---- }; /* utf8_two state table. */ ! static const struct input_transition input_state_utf8_two_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x7f, NULL, &input_state_ground }, *************** *** 719,725 **** }; /* utf8_one state table. */ ! const struct input_transition input_state_utf8_one_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x7f, NULL, &input_state_ground }, --- 720,726 ---- }; /* utf8_one state table. */ ! static const struct input_transition input_state_utf8_one_table[] = { /* No INPUT_STATE_ANYWHERE */ { 0x00, 0x7f, NULL, &input_state_ground }, *************** *** 730,736 **** }; /* Input table compare. */ ! int input_table_compare(const void *key, const void *value) { const struct input_ctx *ictx = key; --- 731,737 ---- }; /* Input table compare. */ ! static int input_table_compare(const void *key, const void *value) { const struct input_ctx *ictx = key; *************** *** 742,748 **** } /* Reset cell state to default. */ ! void input_reset_cell(struct input_ctx *ictx) { memcpy(&ictx->cell.cell, &grid_default_cell, sizeof ictx->cell.cell); --- 743,749 ---- } /* Reset cell state to default. */ ! static void input_reset_cell(struct input_ctx *ictx) { memcpy(&ictx->cell.cell, &grid_default_cell, sizeof ictx->cell.cell); *************** *** 821,827 **** } /* Change input state. */ ! void input_set_state(struct window_pane *wp, const struct input_transition *itr) { struct input_ctx *ictx = wp->ictx; --- 822,828 ---- } /* Change input state. */ ! static void input_set_state(struct window_pane *wp, const struct input_transition *itr) { struct input_ctx *ictx = wp->ictx; *************** *** 906,912 **** } /* Split the parameter list (if any). */ ! int input_split(struct input_ctx *ictx) { --- 907,913 ---- } /* Split the parameter list (if any). */ ! static int input_split(struct input_ctx *ictx) { *************** *** 937,943 **** } /* Get an argument or return default value. */ ! int input_get(struct input_ctx *ictx, u_int validx, int minval, int defval) { int retval; --- 938,944 ---- } /* Get an argument or return default value. */ ! static int input_get(struct input_ctx *ictx, u_int validx, int minval, int defval) { int retval; *************** *** 954,960 **** } /* Reply to terminal query. */ ! void input_reply(struct input_ctx *ictx, const char *fmt, ...) { va_list ap; --- 955,961 ---- } /* Reply to terminal query. */ ! static void input_reply(struct input_ctx *ictx, const char *fmt, ...) { va_list ap; *************** *** 969,975 **** } /* Clear saved state. */ ! void input_clear(struct input_ctx *ictx) { *ictx->interm_buf = '\0'; --- 970,976 ---- } /* Clear saved state. */ ! static void input_clear(struct input_ctx *ictx) { *ictx->interm_buf = '\0'; *************** *** 985,991 **** } /* Reset for ground state. */ ! void input_ground(struct input_ctx *ictx) { evbuffer_drain(ictx->since_ground, EVBUFFER_LENGTH(ictx->since_ground)); --- 986,992 ---- } /* Reset for ground state. */ ! static void input_ground(struct input_ctx *ictx) { evbuffer_drain(ictx->since_ground, EVBUFFER_LENGTH(ictx->since_ground)); *************** *** 997,1003 **** } /* Output this character to the screen. */ ! int input_print(struct input_ctx *ictx) { int set; --- 998,1004 ---- } /* Output this character to the screen. */ ! static int input_print(struct input_ctx *ictx) { int set; *************** *** 1017,1023 **** } /* Collect intermediate string. */ ! int input_intermediate(struct input_ctx *ictx) { if (ictx->interm_len == (sizeof ictx->interm_buf) - 1) --- 1018,1024 ---- } /* Collect intermediate string. */ ! static int input_intermediate(struct input_ctx *ictx) { if (ictx->interm_len == (sizeof ictx->interm_buf) - 1) *************** *** 1031,1037 **** } /* Collect parameter string. */ ! int input_parameter(struct input_ctx *ictx) { if (ictx->param_len == (sizeof ictx->param_buf) - 1) --- 1032,1038 ---- } /* Collect parameter string. */ ! static int input_parameter(struct input_ctx *ictx) { if (ictx->param_len == (sizeof ictx->param_buf) - 1) *************** *** 1045,1051 **** } /* Collect input string. */ ! int input_input(struct input_ctx *ictx) { size_t available; --- 1046,1052 ---- } /* Collect input string. */ ! static int input_input(struct input_ctx *ictx) { size_t available; *************** *** 1067,1073 **** } /* Execute C0 control sequence. */ ! int input_c0_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; --- 1068,1074 ---- } /* Execute C0 control sequence. */ ! static int input_c0_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; *************** *** 1120,1126 **** } /* Execute escape sequence. */ ! int input_esc_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; --- 1121,1127 ---- } /* Execute escape sequence. */ ! static int input_esc_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; *************** *** 1193,1199 **** } /* Execute control sequence. */ ! int input_csi_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; --- 1194,1200 ---- } /* Execute control sequence. */ ! static int input_csi_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; *************** *** 1410,1416 **** } /* Handle CSI RM. */ ! void input_csi_dispatch_rm(struct input_ctx *ictx) { u_int i; --- 1411,1417 ---- } /* Handle CSI RM. */ ! static void input_csi_dispatch_rm(struct input_ctx *ictx) { u_int i; *************** *** 1431,1437 **** } /* Handle CSI private RM. */ ! void input_csi_dispatch_rm_private(struct input_ctx *ictx) { struct window_pane *wp = ictx->wp; --- 1432,1438 ---- } /* Handle CSI private RM. */ ! static void input_csi_dispatch_rm_private(struct input_ctx *ictx) { struct window_pane *wp = ictx->wp; *************** *** 1487,1493 **** } /* Handle CSI SM. */ ! void input_csi_dispatch_sm(struct input_ctx *ictx) { u_int i; --- 1488,1494 ---- } /* Handle CSI SM. */ ! static void input_csi_dispatch_sm(struct input_ctx *ictx) { u_int i; *************** *** 1508,1514 **** } /* Handle CSI private SM. */ ! void input_csi_dispatch_sm_private(struct input_ctx *ictx) { struct window_pane *wp = ictx->wp; --- 1509,1515 ---- } /* Handle CSI private SM. */ ! static void input_csi_dispatch_sm_private(struct input_ctx *ictx) { struct window_pane *wp = ictx->wp; *************** *** 1570,1576 **** } /* Handle CSI window operations. */ ! void input_csi_dispatch_winops(struct input_ctx *ictx) { struct window_pane *wp = ictx->wp; --- 1571,1577 ---- } /* Handle CSI window operations. */ ! static void input_csi_dispatch_winops(struct input_ctx *ictx) { struct window_pane *wp = ictx->wp; *************** *** 1619,1625 **** } /* Handle CSI SGR for 256 colours. */ ! void input_csi_dispatch_sgr_256(struct input_ctx *ictx, int fgbg, u_int *i) { struct grid_cell *gc = &ictx->cell.cell; --- 1620,1626 ---- } /* Handle CSI SGR for 256 colours. */ ! static void input_csi_dispatch_sgr_256(struct input_ctx *ictx, int fgbg, u_int *i) { struct grid_cell *gc = &ictx->cell.cell; *************** *** 1641,1647 **** } /* Handle CSI SGR for RGB colours. */ ! void input_csi_dispatch_sgr_rgb(struct input_ctx *ictx, int fgbg, u_int *i) { struct grid_cell *gc = &ictx->cell.cell; --- 1642,1648 ---- } /* Handle CSI SGR for RGB colours. */ ! static void input_csi_dispatch_sgr_rgb(struct input_ctx *ictx, int fgbg, u_int *i) { struct grid_cell *gc = &ictx->cell.cell; *************** *** 1667,1673 **** } /* Handle CSI SGR. */ ! void input_csi_dispatch_sgr(struct input_ctx *ictx) { struct grid_cell *gc = &ictx->cell.cell; --- 1668,1674 ---- } /* Handle CSI SGR. */ ! static void input_csi_dispatch_sgr(struct input_ctx *ictx) { struct grid_cell *gc = &ictx->cell.cell; *************** *** 1787,1793 **** } /* DCS terminator (ST) received. */ ! int input_dcs_dispatch(struct input_ctx *ictx) { const char prefix[] = "tmux;"; --- 1788,1794 ---- } /* DCS terminator (ST) received. */ ! static int input_dcs_dispatch(struct input_ctx *ictx) { const char prefix[] = "tmux;"; *************** *** 1809,1815 **** } /* OSC string started. */ ! void input_enter_osc(struct input_ctx *ictx) { log_debug("%s", __func__); --- 1810,1816 ---- } /* OSC string started. */ ! static void input_enter_osc(struct input_ctx *ictx) { log_debug("%s", __func__); *************** *** 1818,1824 **** } /* OSC terminator (ST) received. */ ! void input_exit_osc(struct input_ctx *ictx) { u_char *p = ictx->input_buf; --- 1819,1825 ---- } /* OSC terminator (ST) received. */ ! static void input_exit_osc(struct input_ctx *ictx) { u_char *p = ictx->input_buf; *************** *** 1858,1864 **** } /* APC string started. */ ! void input_enter_apc(struct input_ctx *ictx) { log_debug("%s", __func__); --- 1859,1865 ---- } /* APC string started. */ ! static void input_enter_apc(struct input_ctx *ictx) { log_debug("%s", __func__); *************** *** 1867,1873 **** } /* APC terminator (ST) received. */ ! void input_exit_apc(struct input_ctx *ictx) { if (ictx->flags & INPUT_DISCARD) --- 1868,1874 ---- } /* APC terminator (ST) received. */ ! static void input_exit_apc(struct input_ctx *ictx) { if (ictx->flags & INPUT_DISCARD) *************** *** 1879,1885 **** } /* Rename string started. */ ! void input_enter_rename(struct input_ctx *ictx) { log_debug("%s", __func__); --- 1880,1886 ---- } /* Rename string started. */ ! static void input_enter_rename(struct input_ctx *ictx) { log_debug("%s", __func__); *************** *** 1888,1894 **** } /* Rename terminator (ST) received. */ ! void input_exit_rename(struct input_ctx *ictx) { if (ictx->flags & INPUT_DISCARD) --- 1889,1895 ---- } /* Rename terminator (ST) received. */ ! static void input_exit_rename(struct input_ctx *ictx) { if (ictx->flags & INPUT_DISCARD) *************** *** 1904,1910 **** } /* Open UTF-8 character. */ ! int input_utf8_open(struct input_ctx *ictx) { struct utf8_data *ud = &ictx->utf8data; --- 1905,1911 ---- } /* Open UTF-8 character. */ ! static int input_utf8_open(struct input_ctx *ictx) { struct utf8_data *ud = &ictx->utf8data; *************** *** 1918,1924 **** } /* Append to UTF-8 character. */ ! int input_utf8_add(struct input_ctx *ictx) { struct utf8_data *ud = &ictx->utf8data; --- 1919,1925 ---- } /* Append to UTF-8 character. */ ! static int input_utf8_add(struct input_ctx *ictx) { struct utf8_data *ud = &ictx->utf8data; *************** *** 1932,1938 **** } /* Close UTF-8 string. */ ! int input_utf8_close(struct input_ctx *ictx) { struct utf8_data *ud = &ictx->utf8data; --- 1933,1939 ---- } /* Close UTF-8 string. */ ! static int input_utf8_close(struct input_ctx *ictx) { struct utf8_data *ud = &ictx->utf8data;