📄 sltermin.c
字号:
} i++; }#ifdef SLANG_UNTIC fp_open_label:#endif if (fp != NULL) { if (NULL != read_terminal_names (fp, ti)) { if (NULL != read_boolean_flags (fp, ti)) { if (NULL != read_numbers (fp, ti)) { if (NULL != read_string_offsets (fp, ti)) { if (NULL != read_string_table (fp, ti)) { /* success */ fclose (fp); ti->flags = SLTERMINFO; return ti; } SLfree ((char *)ti->string_offsets); } SLfree ((char *)ti->numbers); } SLfree ((char *)ti->boolean_flags); } SLfree ((char *)ti->terminal_names); } fclose (fp); } SLfree ((char *)ti); return NULL;}#ifdef SLANG_UNTIC# define UNTIC_COMMENT(x) ,x#else# define UNTIC_COMMENT(x)#endiftypedef SLCONST struct{ char name[3]; int offset;#ifdef SLANG_UNTIC char *comment;#endif}Tgetstr_Map_Type;/* I need to add: K1-5, %0-5(not important), @8, &8... */static Tgetstr_Map_Type Tgetstr_Map [] ={ {"!1", 212 UNTIC_COMMENT("shifted key")}, {"!2", 213 UNTIC_COMMENT("shifted key")}, {"!3", 214 UNTIC_COMMENT("shifted key")}, {"#1", 198 UNTIC_COMMENT("shifted key")}, {"#2", 199 UNTIC_COMMENT("Key S-Home")}, {"#3", 200 UNTIC_COMMENT("Key S-Insert")}, {"#4", 201 UNTIC_COMMENT("Key S-Left")}, {"%0", 177 UNTIC_COMMENT("redo key")}, {"%1", 168 UNTIC_COMMENT("help key")}, {"%2", 169 UNTIC_COMMENT("mark key")}, {"%3", 170 UNTIC_COMMENT("message key")}, {"%4", 171 UNTIC_COMMENT("move key")}, {"%5", 172 UNTIC_COMMENT("next key")}, {"%6", 173 UNTIC_COMMENT("open key")}, {"%7", 174 UNTIC_COMMENT("options key")}, {"%8", 175 UNTIC_COMMENT("previous key")}, {"%9", 176 UNTIC_COMMENT("print key")}, {"%a", 202 UNTIC_COMMENT("shifted key")}, {"%b", 203 UNTIC_COMMENT("shifted key")}, {"%c", 204 UNTIC_COMMENT("Key S-Next")}, {"%d", 205 UNTIC_COMMENT("shifted key")}, {"%e", 206 UNTIC_COMMENT("Key S-Previous")}, {"%f", 207 UNTIC_COMMENT("shifted key")}, {"%g", 208 UNTIC_COMMENT("shifted key")}, {"%h", 209 UNTIC_COMMENT("shifted key")}, {"%i", 210 UNTIC_COMMENT("Key S-Right")}, {"%j", 211 UNTIC_COMMENT("shifted key")}, {"&0", 187 UNTIC_COMMENT("shifted key")}, {"&1", 178 UNTIC_COMMENT("reference key")}, {"&2", 179 UNTIC_COMMENT("refresh key")}, {"&3", 180 UNTIC_COMMENT("replace key")}, {"&4", 181 UNTIC_COMMENT("restart key")}, {"&5", 182 UNTIC_COMMENT("resume key")}, {"&6", 183 UNTIC_COMMENT("save key")}, {"&7", 184 UNTIC_COMMENT("suspend key")}, {"&8", 185 UNTIC_COMMENT("undo key")}, {"&9", 186 UNTIC_COMMENT("shifted key")}, {"*0", 197 UNTIC_COMMENT("shifted key")}, {"*1", 188 UNTIC_COMMENT("shifted key")}, {"*2", 189 UNTIC_COMMENT("shifted key")}, {"*3", 190 UNTIC_COMMENT("shifted key")}, {"*4", 191 UNTIC_COMMENT("Key S-Delete")}, {"*5", 192 UNTIC_COMMENT("shifted key")}, {"*6", 193 UNTIC_COMMENT("select key")}, {"*7", 194 UNTIC_COMMENT("Key S-End")}, {"*8", 195 UNTIC_COMMENT("shifted key")}, {"*9", 196 UNTIC_COMMENT("shifted key")}, {"@0", 167 UNTIC_COMMENT("find key")}, {"@1", 158 UNTIC_COMMENT("begin key")}, {"@2", 159 UNTIC_COMMENT("cancel key")}, {"@3", 160 UNTIC_COMMENT("close key")}, {"@4", 161 UNTIC_COMMENT("command key")}, {"@5", 162 UNTIC_COMMENT("copy key")}, {"@6", 163 UNTIC_COMMENT("create key")}, {"@7", 164 UNTIC_COMMENT("Key End")}, {"@8", 165 UNTIC_COMMENT("enter/send key")}, {"@9", 166 UNTIC_COMMENT("exit key")}, {"AB", 360 UNTIC_COMMENT("set ANSI color background")}, {"AF", 359 UNTIC_COMMENT("set ANSI color foreground")}, {"AL", 110 UNTIC_COMMENT("parm_insert_line")}, {"CC", 9 UNTIC_COMMENT("terminal settable cmd character in prototype !?")}, {"CM", 15 UNTIC_COMMENT("memory relative cursor addressing")}, {"CW", 277 UNTIC_COMMENT("define a window #1 from #2, #3 to #4, #5")}, {"DC", 105 UNTIC_COMMENT("delete #1 chars")}, {"DI", 280 UNTIC_COMMENT("dial number #1")}, {"DK", 275 UNTIC_COMMENT("display clock at (#1,#2)")}, {"DL", 106 UNTIC_COMMENT("parm_delete_line")}, {"DO", 107 UNTIC_COMMENT("down #1 lines")}, {"F1", 216 UNTIC_COMMENT("key_f11")}, {"F2", 217 UNTIC_COMMENT("key_f12")}, {"F3", 218 UNTIC_COMMENT("key_f13")}, {"F4", 219 UNTIC_COMMENT("key_f14")}, {"F5", 220 UNTIC_COMMENT("key_f15")}, {"F6", 221 UNTIC_COMMENT("key_f16")}, {"F7", 222 UNTIC_COMMENT("key_f17")}, {"F8", 223 UNTIC_COMMENT("key_f18")}, {"F9", 224 UNTIC_COMMENT("key_f19")}, {"FA", 225 UNTIC_COMMENT("key_f20")}, {"FB", 226 UNTIC_COMMENT("F21 function key")}, {"FC", 227 UNTIC_COMMENT("F22 function key")}, {"FD", 228 UNTIC_COMMENT("F23 function key")}, {"FE", 229 UNTIC_COMMENT("F24 function key")}, {"FF", 230 UNTIC_COMMENT("F25 function key")}, {"FG", 231 UNTIC_COMMENT("F26 function key")}, {"FH", 232 UNTIC_COMMENT("F27 function key")}, {"FI", 233 UNTIC_COMMENT("F28 function key")}, {"FJ", 234 UNTIC_COMMENT("F29 function key")}, {"FK", 235 UNTIC_COMMENT("F30 function key")}, {"FL", 236 UNTIC_COMMENT("F31 function key")}, {"FM", 237 UNTIC_COMMENT("F32 function key")}, {"FN", 238 UNTIC_COMMENT("F33 function key")}, {"FO", 239 UNTIC_COMMENT("F34 function key")}, {"FP", 240 UNTIC_COMMENT("F35 function key")}, {"FQ", 241 UNTIC_COMMENT("F36 function key")}, {"FR", 242 UNTIC_COMMENT("F37 function key")}, {"FS", 243 UNTIC_COMMENT("F38 function key")}, {"FT", 244 UNTIC_COMMENT("F39 function key")}, {"FU", 245 UNTIC_COMMENT("F40 function key")}, {"FV", 246 UNTIC_COMMENT("F41 function key")}, {"FW", 247 UNTIC_COMMENT("F42 function key")}, {"FX", 248 UNTIC_COMMENT("F43 function key")}, {"FY", 249 UNTIC_COMMENT("F44 function key")}, {"FZ", 250 UNTIC_COMMENT("F45 function key")}, {"Fa", 251 UNTIC_COMMENT("F46 function key")}, {"Fb", 252 UNTIC_COMMENT("F47 function key")}, {"Fc", 253 UNTIC_COMMENT("F48 function key")}, {"Fd", 254 UNTIC_COMMENT("F49 function key")}, {"Fe", 255 UNTIC_COMMENT("F50 function key")}, {"Ff", 256 UNTIC_COMMENT("F51 function key")}, {"Fg", 257 UNTIC_COMMENT("F52 function key")}, {"Fh", 258 UNTIC_COMMENT("F53 function key")}, {"Fi", 259 UNTIC_COMMENT("F54 function key")}, {"Fj", 260 UNTIC_COMMENT("F55 function key")}, {"Fk", 261 UNTIC_COMMENT("F56 function key")}, {"Fl", 262 UNTIC_COMMENT("F57 function key")}, {"Fm", 263 UNTIC_COMMENT("F58 function key")}, {"Fn", 264 UNTIC_COMMENT("F59 function key")}, {"Fo", 265 UNTIC_COMMENT("F60 function key")}, {"Fp", 266 UNTIC_COMMENT("F61 function key")}, {"Fq", 267 UNTIC_COMMENT("F62 function key")}, {"Fr", 268 UNTIC_COMMENT("F63 function key")}, {"G1", 400 UNTIC_COMMENT("single upper right")}, {"G2", 398 UNTIC_COMMENT("single upper left")}, {"G3", 399 UNTIC_COMMENT("single lower left")}, {"G4", 401 UNTIC_COMMENT("single lower right")}, {"GC", 408 UNTIC_COMMENT("single intersection")}, {"GD", 405 UNTIC_COMMENT("tee pointing down")}, {"GH", 406 UNTIC_COMMENT("single horizontal line")}, {"GL", 403 UNTIC_COMMENT("tee pointing left")}, {"GR", 402 UNTIC_COMMENT("tee pointing right")}, {"GU", 404 UNTIC_COMMENT("tee pointing up")}, {"GV", 407 UNTIC_COMMENT("single vertical line")}, {"Gm", 358 UNTIC_COMMENT("Curses should get button events")}, {"HU", 279 UNTIC_COMMENT("hang-up phone")}, {"IC", 108 UNTIC_COMMENT("insert #1 chars")}, {"Ic", 299 UNTIC_COMMENT("initialize color #1 to (#2,#3,#4)")}, {"Ip", 300 UNTIC_COMMENT("Initialize color pair #1 to fg=(#2,#3,#4), bg=(#5,#6,#7)")}, {"K1", 139 UNTIC_COMMENT("upper left of keypad")}, {"K2", 141 UNTIC_COMMENT("center of keypad")}, {"K3", 140 UNTIC_COMMENT("upper right of keypad")}, {"K4", 142 UNTIC_COMMENT("lower left of keypad")}, {"K5", 143 UNTIC_COMMENT("lower right of keypad")}, {"Km", 355 UNTIC_COMMENT("Mouse event has occurred")}, {"LE", 111 UNTIC_COMMENT("move #1 chars to the left")}, {"LF", 157 UNTIC_COMMENT("turn off soft labels")}, {"LO", 156 UNTIC_COMMENT("turn on soft labels")}, {"Lf", 273 UNTIC_COMMENT("label format")}, {"MC", 270 UNTIC_COMMENT("clear right and left soft margins")}, {"ML", 271 UNTIC_COMMENT("set left soft margin")}, {"ML", 368 UNTIC_COMMENT("Set both left and right margins to #1, #2")}, {"MR", 272 UNTIC_COMMENT("set right soft margin")}, {"MT", 369 UNTIC_COMMENT("Sets both top and bottom margins to #1, #2")}, {"Mi", 356 UNTIC_COMMENT("Mouse status information")}, {"PA", 285 UNTIC_COMMENT("pause for 2-3 seconds")}, {"PU", 283 UNTIC_COMMENT("select pulse dialling")}, {"QD", 281 UNTIC_COMMENT("dial number #1 without checking")}, {"RA", 152 UNTIC_COMMENT("turn off automatic margins")}, {"RC", 276 UNTIC_COMMENT("remove clock")}, {"RF", 215 UNTIC_COMMENT("send next input char (for ptys)")}, {"RI", 112 UNTIC_COMMENT("parm_right_cursor")}, {"RQ", 357 UNTIC_COMMENT("Request mouse position")}, {"RX", 150 UNTIC_COMMENT("turn off xon/xoff handshaking")}, {"S1", 378 UNTIC_COMMENT("Display PC character")}, {"S2", 379 UNTIC_COMMENT("Enter PC character display mode")}, {"S3", 380 UNTIC_COMMENT("Exit PC character display mode")}, {"S4", 381 UNTIC_COMMENT("Enter PC scancode mode")}, {"S5", 382 UNTIC_COMMENT("Exit PC scancode mode")}, {"S6", 383 UNTIC_COMMENT("PC terminal options")}, {"S7", 384 UNTIC_COMMENT("Escape for scancode emulation")}, {"S8", 385 UNTIC_COMMENT("Alternate escape for scancode emulation")}, {"SA", 151 UNTIC_COMMENT("turn on automatic margins")}, {"SC", 274 UNTIC_COMMENT("set clock, #1 hrs #2 mins #3 secs")}, {"SF", 109 UNTIC_COMMENT("scroll forward #1 lines")}, {"SR", 113 UNTIC_COMMENT("scroll back #1 lines")}, {"SX", 149 UNTIC_COMMENT("turn on xon/xoff handshaking")}, {"Sb", 303 UNTIC_COMMENT("set background (color)")}, {"Sf", 302 UNTIC_COMMENT("set foreground (color)")}, {"TO", 282 UNTIC_COMMENT("select touch tone dialing")}, {"UP", 114 UNTIC_COMMENT("up #1 lines")}, {"WA", 286 UNTIC_COMMENT("wait for dial-tone")}, {"WG", 278 UNTIC_COMMENT("go to window #1")}, {"XF", 154 UNTIC_COMMENT("XOFF character")}, {"XN", 153 UNTIC_COMMENT("XON character")}, {"Xh", 386 UNTIC_COMMENT("Enter horizontal highlight mode")}, {"Xl", 387 UNTIC_COMMENT("Enter left highlight mode")}, {"Xo", 388 UNTIC_COMMENT("Enter low highlight mode")}, {"Xr", 389 UNTIC_COMMENT("Enter right highlight mode")}, {"Xt", 390 UNTIC_COMMENT("Enter top highlight mode")}, {"Xv", 391 UNTIC_COMMENT("Enter vertical highlight mode")}, {"Xy", 370 UNTIC_COMMENT("Repeat bit image cell #1 #2 times")}, {"YZ", 377 UNTIC_COMMENT("Set page length to #1 lines")}, {"Yv", 372 UNTIC_COMMENT("Move to beginning of same row")}, {"Yw", 373 UNTIC_COMMENT("Give name for color #1")}, {"Yx", 374 UNTIC_COMMENT("Define rectangualar bit image region")}, {"Yy", 375 UNTIC_COMMENT("End a bit-image region")}, {"Yz", 376 UNTIC_COMMENT("Change to ribbon color #1")}, {"ZA", 304 UNTIC_COMMENT("Change number of characters per inch")}, {"ZB", 305 UNTIC_COMMENT("Change number of lines per inch")}, {"ZC", 306 UNTIC_COMMENT("Change horizontal resolution")}, {"ZD", 307 UNTIC_COMMENT("Change vertical resolution")}, {"ZE", 308 UNTIC_COMMENT("Define a character")}, {"ZF", 309 UNTIC_COMMENT("Enter double-wide mode")}, {"ZG", 310 UNTIC_COMMENT("Enter draft-quality mode")}, {"ZH", 311 UNTIC_COMMENT("Enter italic mode")}, {"ZI", 312 UNTIC_COMMENT("Start leftward carriage motion")}, {"ZJ", 313 UNTIC_COMMENT("Start micro-motion mode")}, {"ZK", 314 UNTIC_COMMENT("Enter NLQ mode")}, {"ZL", 315 UNTIC_COMMENT("Wnter normal-quality mode")}, {"ZM", 316 UNTIC_COMMENT("Enter shadow-print mode")}, {"ZN", 317 UNTIC_COMMENT("Enter subscript mode")}, {"ZO", 318 UNTIC_COMMENT("Enter superscript mode")}, {"ZP", 319 UNTIC_COMMENT("Start upward carriage motion")}, {"ZQ", 320 UNTIC_COMMENT("End double-wide mode")}, {"ZR", 321 UNTIC_COMMENT("End italic mode")}, {"ZS", 322 UNTIC_COMMENT("End left-motion mode")}, {"ZT", 323 UNTIC_COMMENT("End micro-motion mode")}, {"ZU", 324 UNTIC_COMMENT("End shadow-print mode")}, {"ZV", 325 UNTIC_COMMENT("End subscript mode")}, {"ZW", 326 UNTIC_COMMENT("End superscript mode")}, {"ZX", 327 UNTIC_COMMENT("End reverse character motion")}, {"ZY", 328 UNTIC_COMMENT("Like column_address in micro mode")}, {"ZZ", 329 UNTIC_COMMENT("Like cursor_down in micro mode")}, {"Za", 330 UNTIC_COMMENT("Like cursor_left in micro mode")}, {"Zb", 331 UNTIC_COMMENT("Like cursor_right in micro mode")}, {"Zc", 332 UNTIC_COMMENT("Like row_address in micro mode")}, {"Zd", 333 UNTIC_COMMENT("Like cursor_up in micro mode")}, {"Ze", 334 UNTIC_COMMENT("Match software bits to print-head pins")}, {"Zf", 335 UNTIC_COMMENT("Like parm_down_cursor in micro mode")}, {"Zg", 336 UNTIC_COMMENT("Like parm_left_cursor in micro mode")}, {"Zh", 337 UNTIC_COMMENT("Like parm_right_cursor in micro mode")}, {"Zi", 338 UNTIC_COMMENT("Like parm_up_cursor in micro mode")}, {"Zj", 339 UNTIC_COMMENT("Select character set")}, {"Zk", 340 UNTIC_COMMENT("Set bottom margin at current line")}, {"Zl", 341 UNTIC_COMMENT("Set bottom margin at line #1 or #2 lines from bottom")}, {"Zm", 342 UNTIC_COMMENT("Set left (right) margin at column #1 (#2)")}, {"Zn", 343 UNTIC_COMMENT("Set right margin at column #1")},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -