| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | |
|---|
| 24 | |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | #ifndef included_VTparse_h |
|---|
| 48 | #define included_VTparse_h 1 |
|---|
| 49 | |
|---|
| 50 | #include <xterm.h> |
|---|
| 51 | |
|---|
| 52 | #ifndef Const |
|---|
| 53 | # if defined(__STDC__) && !defined(__cplusplus) |
|---|
| 54 | # define Const const |
|---|
| 55 | # else |
|---|
| 56 | # define Const |
|---|
| 57 | # endif |
|---|
| 58 | #endif |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | typedef unsigned char PARSE_T; |
|---|
| 64 | |
|---|
| 65 | extern Const PARSE_T ansi_table[]; |
|---|
| 66 | extern Const PARSE_T cigtable[]; |
|---|
| 67 | extern Const PARSE_T csi2_table[]; |
|---|
| 68 | extern Const PARSE_T csi_ex_table[]; |
|---|
| 69 | extern Const PARSE_T csi_quo_table[]; |
|---|
| 70 | extern Const PARSE_T csi_table[]; |
|---|
| 71 | extern Const PARSE_T dec2_table[]; |
|---|
| 72 | extern Const PARSE_T dec3_table[]; |
|---|
| 73 | extern Const PARSE_T dec_table[]; |
|---|
| 74 | extern Const PARSE_T eigtable[]; |
|---|
| 75 | extern Const PARSE_T esc_sp_table[]; |
|---|
| 76 | extern Const PARSE_T esc_table[]; |
|---|
| 77 | extern Const PARSE_T scrtable[]; |
|---|
| 78 | extern Const PARSE_T scstable[]; |
|---|
| 79 | extern Const PARSE_T sos_table[]; |
|---|
| 80 | |
|---|
| 81 | #if OPT_DEC_LOCATOR |
|---|
| 82 | extern Const PARSE_T csi_tick_table[]; |
|---|
| 83 | #endif |
|---|
| 84 | |
|---|
| 85 | #if OPT_DEC_RECTOPS |
|---|
| 86 | extern Const PARSE_T csi_dollar_table[]; |
|---|
| 87 | extern Const PARSE_T csi_star_table[]; |
|---|
| 88 | #endif |
|---|
| 89 | |
|---|
| 90 | #if OPT_VT52_MODE |
|---|
| 91 | extern Const PARSE_T vt52_table[]; |
|---|
| 92 | extern Const PARSE_T vt52_esc_table[]; |
|---|
| 93 | extern Const PARSE_T vt52_ignore_table[]; |
|---|
| 94 | #endif |
|---|
| 95 | |
|---|
| 96 | #if OPT_WIDE_CHARS |
|---|
| 97 | extern Const PARSE_T esc_pct_table[]; |
|---|
| 98 | #endif |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | #define CASE_GROUND_STATE 0 |
|---|
| 112 | #define CASE_IGNORE 1 |
|---|
| 113 | #define CASE_BELL 2 |
|---|
| 114 | #define CASE_BS 3 |
|---|
| 115 | #define CASE_CR 4 |
|---|
| 116 | #define CASE_ESC 5 |
|---|
| 117 | #define CASE_VMOT 6 |
|---|
| 118 | #define CASE_TAB 7 |
|---|
| 119 | #define CASE_SI 8 |
|---|
| 120 | #define CASE_SO 9 |
|---|
| 121 | #define CASE_SCR_STATE 10 |
|---|
| 122 | #define CASE_SCS0_STATE 11 |
|---|
| 123 | #define CASE_SCS1_STATE 12 |
|---|
| 124 | #define CASE_SCS2_STATE 13 |
|---|
| 125 | #define CASE_SCS3_STATE 14 |
|---|
| 126 | #define CASE_ESC_IGNORE 15 |
|---|
| 127 | #define CASE_ESC_DIGIT 16 |
|---|
| 128 | #define CASE_ESC_SEMI 17 |
|---|
| 129 | #define CASE_DEC_STATE 18 |
|---|
| 130 | #define CASE_ICH 19 |
|---|
| 131 | #define CASE_CUU 20 |
|---|
| 132 | #define CASE_CUD 21 |
|---|
| 133 | #define CASE_CUF 22 |
|---|
| 134 | #define CASE_CUB 23 |
|---|
| 135 | #define CASE_CUP 24 |
|---|
| 136 | #define CASE_ED 25 |
|---|
| 137 | #define CASE_EL 26 |
|---|
| 138 | #define CASE_IL 27 |
|---|
| 139 | #define CASE_DL 28 |
|---|
| 140 | #define CASE_DCH 29 |
|---|
| 141 | #define CASE_DA1 30 |
|---|
| 142 | #define CASE_TRACK_MOUSE 31 |
|---|
| 143 | #define CASE_TBC 32 |
|---|
| 144 | #define CASE_SET 33 |
|---|
| 145 | #define CASE_RST 34 |
|---|
| 146 | #define CASE_SGR 35 |
|---|
| 147 | #define CASE_CPR 36 |
|---|
| 148 | #define CASE_DECSTBM 37 |
|---|
| 149 | #define CASE_DECREQTPARM 38 |
|---|
| 150 | #define CASE_DECSET 39 |
|---|
| 151 | #define CASE_DECRST 40 |
|---|
| 152 | #define CASE_DECALN 41 |
|---|
| 153 | #define CASE_GSETS 42 |
|---|
| 154 | #define CASE_DECSC 43 |
|---|
| 155 | #define CASE_DECRC 44 |
|---|
| 156 | #define CASE_DECKPAM 45 |
|---|
| 157 | #define CASE_DECKPNM 46 |
|---|
| 158 | #define CASE_IND 47 |
|---|
| 159 | #define CASE_NEL 48 |
|---|
| 160 | #define CASE_HTS 49 |
|---|
| 161 | #define CASE_RI 50 |
|---|
| 162 | #define CASE_SS2 51 |
|---|
| 163 | #define CASE_SS3 52 |
|---|
| 164 | #define CASE_CSI_STATE 53 |
|---|
| 165 | #define CASE_OSC 54 |
|---|
| 166 | #define CASE_RIS 55 |
|---|
| 167 | #define CASE_LS2 56 |
|---|
| 168 | #define CASE_LS3 57 |
|---|
| 169 | #define CASE_LS3R 58 |
|---|
| 170 | #define CASE_LS2R 59 |
|---|
| 171 | #define CASE_LS1R 60 |
|---|
| 172 | #define CASE_PRINT 61 |
|---|
| 173 | #define CASE_XTERM_SAVE 62 |
|---|
| 174 | #define CASE_XTERM_RESTORE 63 |
|---|
| 175 | #define CASE_XTERM_TITLE 64 |
|---|
| 176 | #define CASE_DECID 65 |
|---|
| 177 | #define CASE_HP_MEM_LOCK 66 |
|---|
| 178 | #define CASE_HP_MEM_UNLOCK 67 |
|---|
| 179 | #define CASE_HP_BUGGY_LL 68 |
|---|
| 180 | #define CASE_HPA 69 |
|---|
| 181 | #define CASE_VPA 70 |
|---|
| 182 | #define CASE_XTERM_WINOPS 71 |
|---|
| 183 | #define CASE_ECH 72 |
|---|
| 184 | #define CASE_CHT 73 |
|---|
| 185 | #define CASE_CPL 74 |
|---|
| 186 | #define CASE_CNL 75 |
|---|
| 187 | #define CASE_CBT 76 |
|---|
| 188 | #define CASE_SU 77 |
|---|
| 189 | #define CASE_SD 78 |
|---|
| 190 | #define CASE_S7C1T 79 |
|---|
| 191 | #define CASE_S8C1T 80 |
|---|
| 192 | #define CASE_ESC_SP_STATE 81 |
|---|
| 193 | #define CASE_ENQ 82 |
|---|
| 194 | #define CASE_DECSCL 83 |
|---|
| 195 | #define CASE_DECSCA 84 |
|---|
| 196 | #define CASE_DECSED 85 |
|---|
| 197 | #define CASE_DECSEL 86 |
|---|
| 198 | #define CASE_DCS 87 |
|---|
| 199 | #define CASE_PM 88 |
|---|
| 200 | #define CASE_SOS 89 |
|---|
| 201 | #define CASE_ST 90 |
|---|
| 202 | #define CASE_APC 91 |
|---|
| 203 | #define CASE_EPA 92 |
|---|
| 204 | #define CASE_SPA 93 |
|---|
| 205 | #define CASE_CSI_QUOTE_STATE 94 |
|---|
| 206 | #define CASE_DSR 95 |
|---|
| 207 | #define CASE_ANSI_LEVEL_1 96 |
|---|
| 208 | #define CASE_ANSI_LEVEL_2 97 |
|---|
| 209 | #define CASE_ANSI_LEVEL_3 98 |
|---|
| 210 | #define CASE_MC 99 |
|---|
| 211 | #define CASE_DEC2_STATE 100 |
|---|
| 212 | #define CASE_DA2 101 |
|---|
| 213 | #define CASE_DEC3_STATE 102 |
|---|
| 214 | #define CASE_DECRPTUI 103 |
|---|
| 215 | #define CASE_VT52_CUP 104 |
|---|
| 216 | #define CASE_REP 105 |
|---|
| 217 | #define CASE_CSI_EX_STATE 106 |
|---|
| 218 | #define CASE_DECSTR 107 |
|---|
| 219 | #define CASE_DECDHL 108 |
|---|
| 220 | #define CASE_DECSWL 109 |
|---|
| 221 | #define CASE_DECDWL 110 |
|---|
| 222 | #define CASE_DEC_MC 111 |
|---|
| 223 | #define CASE_ESC_PERCENT 112 |
|---|
| 224 | #define CASE_UTF8 113 |
|---|
| 225 | #define CASE_CSI_TICK_STATE 114 |
|---|
| 226 | #define CASE_DECELR 115 |
|---|
| 227 | #define CASE_DECRQLP 116 |
|---|
| 228 | #define CASE_DECEFR 117 |
|---|
| 229 | #define CASE_DECSLE 118 |
|---|
| 230 | #define CASE_CSI_IGNORE 119 |
|---|
| 231 | #define CASE_VT52_IGNORE 120 |
|---|
| 232 | #define CASE_VT52_FINISH 121 |
|---|
| 233 | #define CASE_CSI_DOLLAR_STATE 122 |
|---|
| 234 | #define CASE_DECCRA 123 |
|---|
| 235 | #define CASE_DECERA 124 |
|---|
| 236 | #define CASE_DECFRA 125 |
|---|
| 237 | #define CASE_DECSERA 126 |
|---|
| 238 | #define CASE_DECSACE 127 |
|---|
| 239 | #define CASE_DECCARA 128 |
|---|
| 240 | #define CASE_DECRARA 129 |
|---|
| 241 | #define CASE_CSI_STAR_STATE 130 |
|---|
| 242 | #define CASE_SET_MOD_FKEYS 131 |
|---|
| 243 | #define CASE_SET_MOD_FKEYS0 132 |
|---|
| 244 | #define CASE_HIDE_POINTER 133 |
|---|
| 245 | |
|---|
| 246 | #endif |
|---|