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