1 /* $OpenBSD: term.h,v 1.13 2002/02/18 22:24:32 deraadt Exp $ */ 2 3 /**************************************************************************** 4 * Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. * 5 * * 6 * Permission is hereby granted, free of charge, to any person obtaining a * 7 * copy of this software and associated documentation files (the * 8 * "Software"), to deal in the Software without restriction, including * 9 * without limitation the rights to use, copy, modify, merge, publish, * 10 * distribute, distribute with modifications, sublicense, and/or sell * 11 * copies of the Software, and to permit persons to whom the Software is * 12 * furnished to do so, subject to the following conditions: * 13 * * 14 * The above copyright notice and this permission notice shall be included * 15 * in all copies or substantial portions of the Software. * 16 * * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 20 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 21 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 22 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 23 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 24 * * 25 * Except as contained in this notice, the name(s) of the above copyright * 26 * holders shall not be used in advertising or otherwise to promote the * 27 * sale, use or other dealings in this Software without prior written * 28 * authorization. * 29 ****************************************************************************/ 30 31 /****************************************************************************/ 32 /* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 */ 33 /* and: Eric S. Raymond <esr@snark.thyrsus.com> */ 34 /****************************************************************************/ 35 36 /* $From: MKterm.h.awk.in,v 1.38 2000/12/09 23:54:00 tom Exp $ */ 37 38 /* 39 ** term.h -- Definition of struct term 40 */ 41 42 #ifndef _NCU_TERM_H 43 #define _NCU_TERM_H 1 44 45 #ifdef _USE_OLD_CURSES_ 46 #error Cannot mix ncurses term.h with old curses.h 47 #endif 48 49 #undef NCURSES_VERSION 50 #define NCURSES_VERSION "5.2" 51 52 #if !defined(NCURSES_IMPEXP) 53 # define NCURSES_IMPEXP /* nothing */ 54 #endif 55 #if !defined(NCURSES_API) 56 # define NCURSES_API /* nothing */ 57 #endif 58 #if !defined(NCURSES_EXPORT) 59 # define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API 60 #endif 61 #if !defined(NCURSES_EXPORT_VAR) 62 # define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type 63 #endif 64 65 66 #ifdef __cplusplus 67 extern "C" { 68 #endif 69 70 /* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H 71 * and BROKEN_LINKER definition (based on the system for which this was 72 * configured). 73 */ 74 75 #ifdef __OpenBSD__ 76 #define BROKEN_LINKER 0 77 #define TERMIOS 1 78 #define NCURSES_CONST /*nothing*/ 79 #define NCURSES_XNAMES 1 80 81 #include <termios.h> 82 #define TTY struct termios 83 84 #else 85 86 #undef HAVE_TERMIOS_H 87 #define HAVE_TERMIOS_H 1 88 89 #undef HAVE_TERMIO_H 90 #define HAVE_TERMIO_H 0 91 92 #undef HAVE_TCGETATTR 93 #define HAVE_TCGETATTR 1 94 95 #undef BROKEN_LINKER 96 #define BROKEN_LINKER 0 97 98 #undef NCURSES_CONST 99 #define NCURSES_CONST /*nothing*/ 100 101 #undef NCURSES_XNAMES 102 #define NCURSES_XNAMES 1 103 104 /* We will use these symbols to hide differences between 105 * termios/termio/sgttyb interfaces. 106 */ 107 #undef TTY 108 #undef SET_TTY 109 #undef GET_TTY 110 111 /* Assume Posix termio if we have the header and function */ 112 #if HAVE_TERMIOS_H && HAVE_TCGETATTR 113 114 #undef TERMIOS 115 #define TERMIOS 1 116 117 #include <termios.h> 118 #define TTY struct termios 119 120 #else /* !HAVE_TERMIOS_H */ 121 122 #if HAVE_TERMIO_H 123 124 #undef TERMIOS 125 #define TERMIOS 1 126 127 #include <termio.h> 128 #define TTY struct termio 129 130 /* Add definitions to make termio look like termios. 131 * But ifdef it, since there are some implementations 132 * that try to do this for us in a fake <termio.h>. 133 */ 134 #ifndef TCSANOW 135 #define TCSANOW TCSETA 136 #endif 137 #ifndef TCSADRAIN 138 #define TCSADRAIN TCSETAW 139 #endif 140 #ifndef TCSAFLUSH 141 #define TCSAFLUSH TCSETAF 142 #endif 143 #ifndef tcsetattr 144 #define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg) 145 #endif 146 #ifndef tcgetattr 147 #define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg) 148 #endif 149 #ifndef cfgetospeed 150 #define cfgetospeed(t) ((t)->c_cflag & CBAUD) 151 #endif 152 #ifndef TCIFLUSH 153 #define TCIFLUSH 0 154 #endif 155 #ifndef TCOFLUSH 156 #define TCOFLUSH 1 157 #endif 158 #ifndef TCIOFLUSH 159 #define TCIOFLUSH 2 160 #endif 161 #ifndef tcflush 162 #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg) 163 #endif 164 165 #else /* !HAVE_TERMIO_H */ 166 167 #undef TERMIOS 168 #include <sgtty.h> 169 #include <sys/ioctl.h> 170 #define TTY struct sgttyb 171 172 #endif /* HAVE_TERMIO_H */ 173 174 #endif /* HAVE_TERMIOS_H */ 175 176 #endif /* OpenBSD */ 177 178 #ifdef TERMIOS 179 #define GET_TTY(fd, buf) tcgetattr(fd, buf) 180 #define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf) 181 #else 182 #define GET_TTY(fd, buf) gtty(fd, buf) 183 #define SET_TTY(fd, buf) stty(fd, buf) 184 #endif 185 186 #define NAMESIZE 256 187 188 #define CUR cur_term->type. 189 190 #define auto_left_margin CUR Booleans[0] 191 #define auto_right_margin CUR Booleans[1] 192 #define no_esc_ctlc CUR Booleans[2] 193 #define ceol_standout_glitch CUR Booleans[3] 194 #define eat_newline_glitch CUR Booleans[4] 195 #define erase_overstrike CUR Booleans[5] 196 #define generic_type CUR Booleans[6] 197 #define hard_copy CUR Booleans[7] 198 #define has_meta_key CUR Booleans[8] 199 #define has_status_line CUR Booleans[9] 200 #define insert_null_glitch CUR Booleans[10] 201 #define memory_above CUR Booleans[11] 202 #define memory_below CUR Booleans[12] 203 #define move_insert_mode CUR Booleans[13] 204 #define move_standout_mode CUR Booleans[14] 205 #define over_strike CUR Booleans[15] 206 #define status_line_esc_ok CUR Booleans[16] 207 #define dest_tabs_magic_smso CUR Booleans[17] 208 #define tilde_glitch CUR Booleans[18] 209 #define transparent_underline CUR Booleans[19] 210 #define xon_xoff CUR Booleans[20] 211 #define needs_xon_xoff CUR Booleans[21] 212 #define prtr_silent CUR Booleans[22] 213 #define hard_cursor CUR Booleans[23] 214 #define non_rev_rmcup CUR Booleans[24] 215 #define no_pad_char CUR Booleans[25] 216 #define non_dest_scroll_region CUR Booleans[26] 217 #define can_change CUR Booleans[27] 218 #define back_color_erase CUR Booleans[28] 219 #define hue_lightness_saturation CUR Booleans[29] 220 #define col_addr_glitch CUR Booleans[30] 221 #define cr_cancels_micro_mode CUR Booleans[31] 222 #define has_print_wheel CUR Booleans[32] 223 #define row_addr_glitch CUR Booleans[33] 224 #define semi_auto_right_margin CUR Booleans[34] 225 #define cpi_changes_res CUR Booleans[35] 226 #define lpi_changes_res CUR Booleans[36] 227 #define columns CUR Numbers[0] 228 #define init_tabs CUR Numbers[1] 229 #define lines CUR Numbers[2] 230 #define lines_of_memory CUR Numbers[3] 231 #define magic_cookie_glitch CUR Numbers[4] 232 #define padding_baud_rate CUR Numbers[5] 233 #define virtual_terminal CUR Numbers[6] 234 #define width_status_line CUR Numbers[7] 235 #define num_labels CUR Numbers[8] 236 #define label_height CUR Numbers[9] 237 #define label_width CUR Numbers[10] 238 #define max_attributes CUR Numbers[11] 239 #define maximum_windows CUR Numbers[12] 240 #define max_colors CUR Numbers[13] 241 #define max_pairs CUR Numbers[14] 242 #define no_color_video CUR Numbers[15] 243 #define buffer_capacity CUR Numbers[16] 244 #define dot_vert_spacing CUR Numbers[17] 245 #define dot_horz_spacing CUR Numbers[18] 246 #define max_micro_address CUR Numbers[19] 247 #define max_micro_jump CUR Numbers[20] 248 #define micro_col_size CUR Numbers[21] 249 #define micro_line_size CUR Numbers[22] 250 #define number_of_pins CUR Numbers[23] 251 #define output_res_char CUR Numbers[24] 252 #define output_res_line CUR Numbers[25] 253 #define output_res_horz_inch CUR Numbers[26] 254 #define output_res_vert_inch CUR Numbers[27] 255 #define print_rate CUR Numbers[28] 256 #define wide_char_size CUR Numbers[29] 257 #define buttons CUR Numbers[30] 258 #define bit_image_entwining CUR Numbers[31] 259 #define bit_image_type CUR Numbers[32] 260 #define back_tab CUR Strings[0] 261 #define bell CUR Strings[1] 262 #define carriage_return CUR Strings[2] 263 #define change_scroll_region CUR Strings[3] 264 #define clear_all_tabs CUR Strings[4] 265 #define clear_screen CUR Strings[5] 266 #define clr_eol CUR Strings[6] 267 #define clr_eos CUR Strings[7] 268 #define column_address CUR Strings[8] 269 #define command_character CUR Strings[9] 270 #define cursor_address CUR Strings[10] 271 #define cursor_down CUR Strings[11] 272 #define cursor_home CUR Strings[12] 273 #define cursor_invisible CUR Strings[13] 274 #define cursor_left CUR Strings[14] 275 #define cursor_mem_address CUR Strings[15] 276 #define cursor_normal CUR Strings[16] 277 #define cursor_right CUR Strings[17] 278 #define cursor_to_ll CUR Strings[18] 279 #define cursor_up CUR Strings[19] 280 #define cursor_visible CUR Strings[20] 281 #define delete_character CUR Strings[21] 282 #define delete_line CUR Strings[22] 283 #define dis_status_line CUR Strings[23] 284 #define down_half_line CUR Strings[24] 285 #define enter_alt_charset_mode CUR Strings[25] 286 #define enter_blink_mode CUR Strings[26] 287 #define enter_bold_mode CUR Strings[27] 288 #define enter_ca_mode CUR Strings[28] 289 #define enter_delete_mode CUR Strings[29] 290 #define enter_dim_mode CUR Strings[30] 291 #define enter_insert_mode CUR Strings[31] 292 #define enter_secure_mode CUR Strings[32] 293 #define enter_protected_mode CUR Strings[33] 294 #define enter_reverse_mode CUR Strings[34] 295 #define enter_standout_mode CUR Strings[35] 296 #define enter_underline_mode CUR Strings[36] 297 #define erase_chars CUR Strings[37] 298 #define exit_alt_charset_mode CUR Strings[38] 299 #define exit_attribute_mode CUR Strings[39] 300 #define exit_ca_mode CUR Strings[40] 301 #define exit_delete_mode CUR Strings[41] 302 #define exit_insert_mode CUR Strings[42] 303 #define exit_standout_mode CUR Strings[43] 304 #define exit_underline_mode CUR Strings[44] 305 #define flash_screen CUR Strings[45] 306 #define form_feed CUR Strings[46] 307 #define from_status_line CUR Strings[47] 308 #define init_1string CUR Strings[48] 309 #define init_2string CUR Strings[49] 310 #define init_3string CUR Strings[50] 311 #define init_file CUR Strings[51] 312 #define insert_character CUR Strings[52] 313 #define insert_line CUR Strings[53] 314 #define insert_padding CUR Strings[54] 315 #define key_backspace CUR Strings[55] 316 #define key_catab CUR Strings[56] 317 #define key_clear CUR Strings[57] 318 #define key_ctab CUR Strings[58] 319 #define key_dc CUR Strings[59] 320 #define key_dl CUR Strings[60] 321 #define key_down CUR Strings[61] 322 #define key_eic CUR Strings[62] 323 #define key_eol CUR Strings[63] 324 #define key_eos CUR Strings[64] 325 #define key_f0 CUR Strings[65] 326 #define key_f1 CUR Strings[66] 327 #define key_f10 CUR Strings[67] 328 #define key_f2 CUR Strings[68] 329 #define key_f3 CUR Strings[69] 330 #define key_f4 CUR Strings[70] 331 #define key_f5 CUR Strings[71] 332 #define key_f6 CUR Strings[72] 333 #define key_f7 CUR Strings[73] 334 #define key_f8 CUR Strings[74] 335 #define key_f9 CUR Strings[75] 336 #define key_home CUR Strings[76] 337 #define key_ic CUR Strings[77] 338 #define key_il CUR Strings[78] 339 #define key_left CUR Strings[79] 340 #define key_ll CUR Strings[80] 341 #define key_npage CUR Strings[81] 342 #define key_ppage CUR Strings[82] 343 #define key_right CUR Strings[83] 344 #define key_sf CUR Strings[84] 345 #define key_sr CUR Strings[85] 346 #define key_stab CUR Strings[86] 347 #define key_up CUR Strings[87] 348 #define keypad_local CUR Strings[88] 349 #define keypad_xmit CUR Strings[89] 350 #define lab_f0 CUR Strings[90] 351 #define lab_f1 CUR Strings[91] 352 #define lab_f10 CUR Strings[92] 353 #define lab_f2 CUR Strings[93] 354 #define lab_f3 CUR Strings[94] 355 #define lab_f4 CUR Strings[95] 356 #define lab_f5 CUR Strings[96] 357 #define lab_f6 CUR Strings[97] 358 #define lab_f7 CUR Strings[98] 359 #define lab_f8 CUR Strings[99] 360 #define lab_f9 CUR Strings[100] 361 #define meta_off CUR Strings[101] 362 #define meta_on CUR Strings[102] 363 #define newline CUR Strings[103] 364 #define pad_char CUR Strings[104] 365 #define parm_dch CUR Strings[105] 366 #define parm_delete_line CUR Strings[106] 367 #define parm_down_cursor CUR Strings[107] 368 #define parm_ich CUR Strings[108] 369 #define parm_index CUR Strings[109] 370 #define parm_insert_line CUR Strings[110] 371 #define parm_left_cursor CUR Strings[111] 372 #define parm_right_cursor CUR Strings[112] 373 #define parm_rindex CUR Strings[113] 374 #define parm_up_cursor CUR Strings[114] 375 #define pkey_key CUR Strings[115] 376 #define pkey_local CUR Strings[116] 377 #define pkey_xmit CUR Strings[117] 378 #define print_screen CUR Strings[118] 379 #define prtr_off CUR Strings[119] 380 #define prtr_on CUR Strings[120] 381 #define repeat_char CUR Strings[121] 382 #define reset_1string CUR Strings[122] 383 #define reset_2string CUR Strings[123] 384 #define reset_3string CUR Strings[124] 385 #define reset_file CUR Strings[125] 386 #define restore_cursor CUR Strings[126] 387 #define row_address CUR Strings[127] 388 #define save_cursor CUR Strings[128] 389 #define scroll_forward CUR Strings[129] 390 #define scroll_reverse CUR Strings[130] 391 #define set_attributes CUR Strings[131] 392 #define set_tab CUR Strings[132] 393 #define set_window CUR Strings[133] 394 #define tab CUR Strings[134] 395 #define to_status_line CUR Strings[135] 396 #define underline_char CUR Strings[136] 397 #define up_half_line CUR Strings[137] 398 #define init_prog CUR Strings[138] 399 #define key_a1 CUR Strings[139] 400 #define key_a3 CUR Strings[140] 401 #define key_b2 CUR Strings[141] 402 #define key_c1 CUR Strings[142] 403 #define key_c3 CUR Strings[143] 404 #define prtr_non CUR Strings[144] 405 #define char_padding CUR Strings[145] 406 #define acs_chars CUR Strings[146] 407 #define plab_norm CUR Strings[147] 408 #define key_btab CUR Strings[148] 409 #define enter_xon_mode CUR Strings[149] 410 #define exit_xon_mode CUR Strings[150] 411 #define enter_am_mode CUR Strings[151] 412 #define exit_am_mode CUR Strings[152] 413 #define xon_character CUR Strings[153] 414 #define xoff_character CUR Strings[154] 415 #define ena_acs CUR Strings[155] 416 #define label_on CUR Strings[156] 417 #define label_off CUR Strings[157] 418 #define key_beg CUR Strings[158] 419 #define key_cancel CUR Strings[159] 420 #define key_close CUR Strings[160] 421 #define key_command CUR Strings[161] 422 #define key_copy CUR Strings[162] 423 #define key_create CUR Strings[163] 424 #define key_end CUR Strings[164] 425 #define key_enter CUR Strings[165] 426 #define key_exit CUR Strings[166] 427 #define key_find CUR Strings[167] 428 #define key_help CUR Strings[168] 429 #define key_mark CUR Strings[169] 430 #define key_message CUR Strings[170] 431 #define key_move CUR Strings[171] 432 #define key_next CUR Strings[172] 433 #define key_open CUR Strings[173] 434 #define key_options CUR Strings[174] 435 #define key_previous CUR Strings[175] 436 #define key_print CUR Strings[176] 437 #define key_redo CUR Strings[177] 438 #define key_reference CUR Strings[178] 439 #define key_refresh CUR Strings[179] 440 #define key_replace CUR Strings[180] 441 #define key_restart CUR Strings[181] 442 #define key_resume CUR Strings[182] 443 #define key_save CUR Strings[183] 444 #define key_suspend CUR Strings[184] 445 #define key_undo CUR Strings[185] 446 #define key_sbeg CUR Strings[186] 447 #define key_scancel CUR Strings[187] 448 #define key_scommand CUR Strings[188] 449 #define key_scopy CUR Strings[189] 450 #define key_screate CUR Strings[190] 451 #define key_sdc CUR Strings[191] 452 #define key_sdl CUR Strings[192] 453 #define key_select CUR Strings[193] 454 #define key_send CUR Strings[194] 455 #define key_seol CUR Strings[195] 456 #define key_sexit CUR Strings[196] 457 #define key_sfind CUR Strings[197] 458 #define key_shelp CUR Strings[198] 459 #define key_shome CUR Strings[199] 460 #define key_sic CUR Strings[200] 461 #define key_sleft CUR Strings[201] 462 #define key_smessage CUR Strings[202] 463 #define key_smove CUR Strings[203] 464 #define key_snext CUR Strings[204] 465 #define key_soptions CUR Strings[205] 466 #define key_sprevious CUR Strings[206] 467 #define key_sprint CUR Strings[207] 468 #define key_sredo CUR Strings[208] 469 #define key_sreplace CUR Strings[209] 470 #define key_sright CUR Strings[210] 471 #define key_srsume CUR Strings[211] 472 #define key_ssave CUR Strings[212] 473 #define key_ssuspend CUR Strings[213] 474 #define key_sundo CUR Strings[214] 475 #define req_for_input CUR Strings[215] 476 #define key_f11 CUR Strings[216] 477 #define key_f12 CUR Strings[217] 478 #define key_f13 CUR Strings[218] 479 #define key_f14 CUR Strings[219] 480 #define key_f15 CUR Strings[220] 481 #define key_f16 CUR Strings[221] 482 #define key_f17 CUR Strings[222] 483 #define key_f18 CUR Strings[223] 484 #define key_f19 CUR Strings[224] 485 #define key_f20 CUR Strings[225] 486 #define key_f21 CUR Strings[226] 487 #define key_f22 CUR Strings[227] 488 #define key_f23 CUR Strings[228] 489 #define key_f24 CUR Strings[229] 490 #define key_f25 CUR Strings[230] 491 #define key_f26 CUR Strings[231] 492 #define key_f27 CUR Strings[232] 493 #define key_f28 CUR Strings[233] 494 #define key_f29 CUR Strings[234] 495 #define key_f30 CUR Strings[235] 496 #define key_f31 CUR Strings[236] 497 #define key_f32 CUR Strings[237] 498 #define key_f33 CUR Strings[238] 499 #define key_f34 CUR Strings[239] 500 #define key_f35 CUR Strings[240] 501 #define key_f36 CUR Strings[241] 502 #define key_f37 CUR Strings[242] 503 #define key_f38 CUR Strings[243] 504 #define key_f39 CUR Strings[244] 505 #define key_f40 CUR Strings[245] 506 #define key_f41 CUR Strings[246] 507 #define key_f42 CUR Strings[247] 508 #define key_f43 CUR Strings[248] 509 #define key_f44 CUR Strings[249] 510 #define key_f45 CUR Strings[250] 511 #define key_f46 CUR Strings[251] 512 #define key_f47 CUR Strings[252] 513 #define key_f48 CUR Strings[253] 514 #define key_f49 CUR Strings[254] 515 #define key_f50 CUR Strings[255] 516 #define key_f51 CUR Strings[256] 517 #define key_f52 CUR Strings[257] 518 #define key_f53 CUR Strings[258] 519 #define key_f54 CUR Strings[259] 520 #define key_f55 CUR Strings[260] 521 #define key_f56 CUR Strings[261] 522 #define key_f57 CUR Strings[262] 523 #define key_f58 CUR Strings[263] 524 #define key_f59 CUR Strings[264] 525 #define key_f60 CUR Strings[265] 526 #define key_f61 CUR Strings[266] 527 #define key_f62 CUR Strings[267] 528 #define key_f63 CUR Strings[268] 529 #define clr_bol CUR Strings[269] 530 #define clear_margins CUR Strings[270] 531 #define set_left_margin CUR Strings[271] 532 #define set_right_margin CUR Strings[272] 533 #define label_format CUR Strings[273] 534 #define set_clock CUR Strings[274] 535 #define display_clock CUR Strings[275] 536 #define remove_clock CUR Strings[276] 537 #define create_window CUR Strings[277] 538 #define goto_window CUR Strings[278] 539 #define hangup CUR Strings[279] 540 #define dial_phone CUR Strings[280] 541 #define quick_dial CUR Strings[281] 542 #define tone CUR Strings[282] 543 #define pulse CUR Strings[283] 544 #define flash_hook CUR Strings[284] 545 #define fixed_pause CUR Strings[285] 546 #define wait_tone CUR Strings[286] 547 #define user0 CUR Strings[287] 548 #define user1 CUR Strings[288] 549 #define user2 CUR Strings[289] 550 #define user3 CUR Strings[290] 551 #define user4 CUR Strings[291] 552 #define user5 CUR Strings[292] 553 #define user6 CUR Strings[293] 554 #define user7 CUR Strings[294] 555 #define user8 CUR Strings[295] 556 #define user9 CUR Strings[296] 557 #define orig_pair CUR Strings[297] 558 #define orig_colors CUR Strings[298] 559 #define initialize_color CUR Strings[299] 560 #define initialize_pair CUR Strings[300] 561 #define set_color_pair CUR Strings[301] 562 #define set_foreground CUR Strings[302] 563 #define set_background CUR Strings[303] 564 #define change_char_pitch CUR Strings[304] 565 #define change_line_pitch CUR Strings[305] 566 #define change_res_horz CUR Strings[306] 567 #define change_res_vert CUR Strings[307] 568 #define define_char CUR Strings[308] 569 #define enter_doublewide_mode CUR Strings[309] 570 #define enter_draft_quality CUR Strings[310] 571 #define enter_italics_mode CUR Strings[311] 572 #define enter_leftward_mode CUR Strings[312] 573 #define enter_micro_mode CUR Strings[313] 574 #define enter_near_letter_quality CUR Strings[314] 575 #define enter_normal_quality CUR Strings[315] 576 #define enter_shadow_mode CUR Strings[316] 577 #define enter_subscript_mode CUR Strings[317] 578 #define enter_superscript_mode CUR Strings[318] 579 #define enter_upward_mode CUR Strings[319] 580 #define exit_doublewide_mode CUR Strings[320] 581 #define exit_italics_mode CUR Strings[321] 582 #define exit_leftward_mode CUR Strings[322] 583 #define exit_micro_mode CUR Strings[323] 584 #define exit_shadow_mode CUR Strings[324] 585 #define exit_subscript_mode CUR Strings[325] 586 #define exit_superscript_mode CUR Strings[326] 587 #define exit_upward_mode CUR Strings[327] 588 #define micro_column_address CUR Strings[328] 589 #define micro_down CUR Strings[329] 590 #define micro_left CUR Strings[330] 591 #define micro_right CUR Strings[331] 592 #define micro_row_address CUR Strings[332] 593 #define micro_up CUR Strings[333] 594 #define order_of_pins CUR Strings[334] 595 #define parm_down_micro CUR Strings[335] 596 #define parm_left_micro CUR Strings[336] 597 #define parm_right_micro CUR Strings[337] 598 #define parm_up_micro CUR Strings[338] 599 #define select_char_set CUR Strings[339] 600 #define set_bottom_margin CUR Strings[340] 601 #define set_bottom_margin_parm CUR Strings[341] 602 #define set_left_margin_parm CUR Strings[342] 603 #define set_right_margin_parm CUR Strings[343] 604 #define set_top_margin CUR Strings[344] 605 #define set_top_margin_parm CUR Strings[345] 606 #define start_bit_image CUR Strings[346] 607 #define start_char_set_def CUR Strings[347] 608 #define stop_bit_image CUR Strings[348] 609 #define stop_char_set_def CUR Strings[349] 610 #define subscript_characters CUR Strings[350] 611 #define superscript_characters CUR Strings[351] 612 #define these_cause_cr CUR Strings[352] 613 #define zero_motion CUR Strings[353] 614 #define char_set_names CUR Strings[354] 615 #define key_mouse CUR Strings[355] 616 #define mouse_info CUR Strings[356] 617 #define req_mouse_pos CUR Strings[357] 618 #define get_mouse CUR Strings[358] 619 #define set_a_foreground CUR Strings[359] 620 #define set_a_background CUR Strings[360] 621 #define pkey_plab CUR Strings[361] 622 #define device_type CUR Strings[362] 623 #define code_set_init CUR Strings[363] 624 #define set0_des_seq CUR Strings[364] 625 #define set1_des_seq CUR Strings[365] 626 #define set2_des_seq CUR Strings[366] 627 #define set3_des_seq CUR Strings[367] 628 #define set_lr_margin CUR Strings[368] 629 #define set_tb_margin CUR Strings[369] 630 #define bit_image_repeat CUR Strings[370] 631 #define bit_image_newline CUR Strings[371] 632 #define bit_image_carriage_return CUR Strings[372] 633 #define color_names CUR Strings[373] 634 #define define_bit_image_region CUR Strings[374] 635 #define end_bit_image_region CUR Strings[375] 636 #define set_color_band CUR Strings[376] 637 #define set_page_length CUR Strings[377] 638 #define display_pc_char CUR Strings[378] 639 #define enter_pc_charset_mode CUR Strings[379] 640 #define exit_pc_charset_mode CUR Strings[380] 641 #define enter_scancode_mode CUR Strings[381] 642 #define exit_scancode_mode CUR Strings[382] 643 #define pc_term_options CUR Strings[383] 644 #define scancode_escape CUR Strings[384] 645 #define alt_scancode_esc CUR Strings[385] 646 #define enter_horizontal_hl_mode CUR Strings[386] 647 #define enter_left_hl_mode CUR Strings[387] 648 #define enter_low_hl_mode CUR Strings[388] 649 #define enter_right_hl_mode CUR Strings[389] 650 #define enter_top_hl_mode CUR Strings[390] 651 #define enter_vertical_hl_mode CUR Strings[391] 652 #define set_a_attributes CUR Strings[392] 653 #define set_pglen_inch CUR Strings[393] 654 655 #define BOOLWRITE 37 656 #define NUMWRITE 33 657 #define STRWRITE 394 658 659 /* older synonyms for some capabilities */ 660 #define beehive_glitch no_esc_ctlc 661 #define teleray_glitch dest_tabs_magic_smso 662 #define micro_char_size micro_col_size 663 664 #ifdef __INTERNAL_CAPS_VISIBLE 665 #define termcap_init2 CUR Strings[394] 666 #define termcap_reset CUR Strings[395] 667 #define magic_cookie_glitch_ul CUR Numbers[33] 668 #define backspaces_with_bs CUR Booleans[37] 669 #define crt_no_scrolling CUR Booleans[38] 670 #define no_correctly_working_cr CUR Booleans[39] 671 #define carriage_return_delay CUR Numbers[34] 672 #define new_line_delay CUR Numbers[35] 673 #define linefeed_if_not_lf CUR Strings[396] 674 #define backspace_if_not_bs CUR Strings[397] 675 #define gnu_has_meta_key CUR Booleans[40] 676 #define linefeed_is_newline CUR Booleans[41] 677 #define backspace_delay CUR Numbers[36] 678 #define horizontal_tab_delay CUR Numbers[37] 679 #define number_of_function_keys CUR Numbers[38] 680 #define other_non_function_keys CUR Strings[398] 681 #define arrow_key_map CUR Strings[399] 682 #define has_hardware_tabs CUR Booleans[42] 683 #define return_does_clr_eol CUR Booleans[43] 684 #define acs_ulcorner CUR Strings[400] 685 #define acs_llcorner CUR Strings[401] 686 #define acs_urcorner CUR Strings[402] 687 #define acs_lrcorner CUR Strings[403] 688 #define acs_ltee CUR Strings[404] 689 #define acs_rtee CUR Strings[405] 690 #define acs_btee CUR Strings[406] 691 #define acs_ttee CUR Strings[407] 692 #define acs_hline CUR Strings[408] 693 #define acs_vline CUR Strings[409] 694 #define acs_plus CUR Strings[410] 695 #define memory_lock CUR Strings[411] 696 #define memory_unlock CUR Strings[412] 697 #define box_chars_1 CUR Strings[413] 698 #endif /* __INTERNAL_CAPS_VISIBLE */ 699 700 701 /* 702 * Predefined terminfo array sizes 703 */ 704 #define BOOLCOUNT 44 705 #define NUMCOUNT 39 706 #define STRCOUNT 414 707 708 /* used by code for comparing entries */ 709 #define acs_chars_index 146 710 711 typedef struct termtype { /* in-core form of terminfo data */ 712 char *term_names; /* str_table offset of term names */ 713 char *str_table; /* pointer to string table */ 714 signed char *Booleans; /* array of boolean values */ 715 short *Numbers; /* array of integer values */ 716 char **Strings; /* array of string offsets */ 717 718 #if NCURSES_XNAMES 719 char *ext_str_table; /* pointer to extended string table */ 720 char **ext_Names; /* corresponding names */ 721 722 unsigned short num_Booleans;/* count total Booleans */ 723 unsigned short num_Numbers; /* count total Numbers */ 724 unsigned short num_Strings; /* count total Strings */ 725 726 unsigned short ext_Booleans;/* count extensions to Booleans */ 727 unsigned short ext_Numbers; /* count extensions to Numbers */ 728 unsigned short ext_Strings; /* count extensions to Strings */ 729 #endif /* NCURSES_XNAMES */ 730 731 } TERMTYPE; 732 733 typedef struct term { /* describe an actual terminal */ 734 TERMTYPE type; /* terminal type description */ 735 short Filedes; /* file description being written to */ 736 TTY Ottyb, /* original state of the terminal */ 737 Nttyb; /* current state of the terminal */ 738 int _baudrate; /* used to compute padding */ 739 } TERMINAL; 740 741 extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term; 742 743 #if BROKEN_LINKER 744 #define boolnames _nc_boolnames() 745 #define boolcodes _nc_boolcodes() 746 #define boolfnames _nc_boolfnames() 747 #define numnames _nc_numnames() 748 #define numcodes _nc_numcodes() 749 #define numfnames _nc_numfnames() 750 #define strnames _nc_strnames() 751 #define strcodes _nc_strcodes() 752 #define strfnames _nc_strfnames() 753 754 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolnames (void); 755 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolcodes (void); 756 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_boolfnames (void); 757 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numnames (void); 758 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numcodes (void); 759 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_numfnames (void); 760 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strnames (void); 761 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strcodes (void); 762 extern NCURSES_EXPORT(NCURSES_CONST char * const *) _nc_strfnames (void); 763 764 #else 765 766 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[]; 767 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[]; 768 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[]; 769 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[]; 770 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[]; 771 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[]; 772 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[]; 773 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[]; 774 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[]; 775 776 #endif 777 778 /* internals */ 779 extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf); 780 extern NCURSES_EXPORT(int) _nc_get_tty_mode (TTY *buf); 781 extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const); 782 extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *); 783 extern NCURSES_EXPORT(char *) _nc_first_name (const char *const); 784 extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const); 785 extern NCURSES_EXPORT(int) _nc_read_termcap_entry (const char *const, TERMTYPE *const); 786 extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *); 787 788 /* entry points */ 789 extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *); 790 extern NCURSES_EXPORT(int) del_curterm (TERMINAL *); 791 792 /* miscellaneous entry points */ 793 extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *); 794 extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *); 795 796 /* terminfo entry points, also declared in curses.h */ 797 #if !defined(__NCURSES_H) 798 extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *); 799 extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...); 800 extern NCURSES_EXPORT_VAR(char) ttytype[]; 801 extern NCURSES_EXPORT(int) putp (const char *); 802 extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *); 803 extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *); 804 #endif /* __NCURSES_H */ 805 806 /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */ 807 #if !defined(_NCU_TERMCAP_H) 808 extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **); 809 extern NCURSES_EXPORT(char *) tgoto (const char *, int, int); 810 extern NCURSES_EXPORT(int) tgetent (char *, const char *); 811 extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *); 812 extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *); 813 extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int)); 814 #endif /* _NCU_TERMCAP_H */ 815 816 #ifdef __cplusplus 817 } 818 #endif 819 820 #endif /* _NCU_TERM_H */ 821