xref: /openbsd/lib/libcurses/term.h (revision 097a140d)
1 /* $OpenBSD: term.h,v 1.16 2020/12/14 22:05:31 naddy Exp $ */
2 
3 /****************************************************************************
4  * Copyright (c) 1998-2007,2008 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 /*    and: Thomas E. Dickey                        1995-on                  */
35 /****************************************************************************/
36 
37 /* $Id: term.h,v 1.16 2020/12/14 22:05:31 naddy Exp $ */
38 
39 /*
40 **	term.h -- Definition of struct term
41 */
42 
43 #ifndef NCURSES_TERM_H_incl
44 #define NCURSES_TERM_H_incl 1
45 
46 #undef  NCURSES_VERSION
47 #define NCURSES_VERSION "5.7"
48 
49 #if !defined(NCURSES_IMPEXP)
50 #  define NCURSES_IMPEXP /* nothing */
51 #endif
52 #if !defined(NCURSES_API)
53 #  define NCURSES_API /* nothing */
54 #endif
55 #if !defined(NCURSES_EXPORT)
56 #  define NCURSES_EXPORT(type) NCURSES_IMPEXP type NCURSES_API
57 #endif
58 #if !defined(NCURSES_EXPORT_VAR)
59 #  define NCURSES_EXPORT_VAR(type) NCURSES_IMPEXP type
60 #endif
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 /* Make this file self-contained by providing defaults for the HAVE_TERMIO[S]_H
67  * definition (based on the system for which this was configured).
68  */
69 
70 #undef  NCURSES_CONST
71 #define NCURSES_CONST const
72 
73 #undef  NCURSES_SBOOL
74 #define NCURSES_SBOOL signed char
75 
76 #undef  NCURSES_XNAMES
77 #define NCURSES_XNAMES 1
78 
79 /* We will use these symbols to hide differences between
80  * termios/termio/sgttyb interfaces.
81  */
82 #undef  TTY
83 #undef  SET_TTY
84 #undef  GET_TTY
85 
86 /* Assume POSIX termio if we have the header and function */
87 /* #if HAVE_TERMIOS_H && HAVE_TCGETATTR */
88 #if 1 && 1
89 
90 #undef  TERMIOS
91 #define TERMIOS 1
92 
93 #include <termios.h>
94 #define TTY struct termios
95 
96 #else /* !HAVE_TERMIOS_H */
97 
98 /* #if HAVE_TERMIO_H */
99 #if 0
100 
101 #undef  TERMIOS
102 #define TERMIOS 1
103 
104 #include <termio.h>
105 #define TTY struct termio
106 
107 /* Add definitions to make termio look like termios.
108  * But ifdef it, since there are some implementations
109  * that try to do this for us in a fake <termio.h>.
110  */
111 #ifndef TCSANOW
112 #define TCSANOW TCSETA
113 #endif
114 #ifndef TCSADRAIN
115 #define TCSADRAIN TCSETAW
116 #endif
117 #ifndef TCSAFLUSH
118 #define TCSAFLUSH TCSETAF
119 #endif
120 #ifndef tcsetattr
121 #define tcsetattr(fd, cmd, arg) ioctl(fd, cmd, arg)
122 #endif
123 #ifndef tcgetattr
124 #define tcgetattr(fd, arg) ioctl(fd, TCGETA, arg)
125 #endif
126 #ifndef cfgetospeed
127 #define cfgetospeed(t) ((t)->c_cflag & CBAUD)
128 #endif
129 #ifndef TCIFLUSH
130 #define TCIFLUSH 0
131 #endif
132 #ifndef TCOFLUSH
133 #define TCOFLUSH 1
134 #endif
135 #ifndef TCIOFLUSH
136 #define TCIOFLUSH 2
137 #endif
138 #ifndef tcflush
139 #define tcflush(fd, arg) ioctl(fd, TCFLSH, arg)
140 #endif
141 
142 #else /* !HAVE_TERMIO_H */
143 
144 #undef TERMIOS
145 #include <sgtty.h>
146 #include <sys/ioctl.h>
147 #define TTY struct sgttyb
148 
149 #endif /* HAVE_TERMIO_H */
150 
151 #endif /* HAVE_TERMIOS_H */
152 
153 #ifdef TERMIOS
154 #define GET_TTY(fd, buf) tcgetattr(fd, buf)
155 #define SET_TTY(fd, buf) tcsetattr(fd, TCSADRAIN, buf)
156 #else
157 #define GET_TTY(fd, buf) gtty(fd, buf)
158 #define SET_TTY(fd, buf) stty(fd, buf)
159 #endif
160 
161 #define NAMESIZE 256
162 
163 #define CUR cur_term->type.
164 
165 #define auto_left_margin               CUR Booleans[0]
166 #define auto_right_margin              CUR Booleans[1]
167 #define no_esc_ctlc                    CUR Booleans[2]
168 #define ceol_standout_glitch           CUR Booleans[3]
169 #define eat_newline_glitch             CUR Booleans[4]
170 #define erase_overstrike               CUR Booleans[5]
171 #define generic_type                   CUR Booleans[6]
172 #define hard_copy                      CUR Booleans[7]
173 #define has_meta_key                   CUR Booleans[8]
174 #define has_status_line                CUR Booleans[9]
175 #define insert_null_glitch             CUR Booleans[10]
176 #define memory_above                   CUR Booleans[11]
177 #define memory_below                   CUR Booleans[12]
178 #define move_insert_mode               CUR Booleans[13]
179 #define move_standout_mode             CUR Booleans[14]
180 #define over_strike                    CUR Booleans[15]
181 #define status_line_esc_ok             CUR Booleans[16]
182 #define dest_tabs_magic_smso           CUR Booleans[17]
183 #define tilde_glitch                   CUR Booleans[18]
184 #define transparent_underline          CUR Booleans[19]
185 #define xon_xoff                       CUR Booleans[20]
186 #define needs_xon_xoff                 CUR Booleans[21]
187 #define prtr_silent                    CUR Booleans[22]
188 #define hard_cursor                    CUR Booleans[23]
189 #define non_rev_rmcup                  CUR Booleans[24]
190 #define no_pad_char                    CUR Booleans[25]
191 #define non_dest_scroll_region         CUR Booleans[26]
192 #define can_change                     CUR Booleans[27]
193 #define back_color_erase               CUR Booleans[28]
194 #define hue_lightness_saturation       CUR Booleans[29]
195 #define col_addr_glitch                CUR Booleans[30]
196 #define cr_cancels_micro_mode          CUR Booleans[31]
197 #define has_print_wheel                CUR Booleans[32]
198 #define row_addr_glitch                CUR Booleans[33]
199 #define semi_auto_right_margin         CUR Booleans[34]
200 #define cpi_changes_res                CUR Booleans[35]
201 #define lpi_changes_res                CUR Booleans[36]
202 #define columns                        CUR Numbers[0]
203 #define init_tabs                      CUR Numbers[1]
204 #define lines                          CUR Numbers[2]
205 #define lines_of_memory                CUR Numbers[3]
206 #define magic_cookie_glitch            CUR Numbers[4]
207 #define padding_baud_rate              CUR Numbers[5]
208 #define virtual_terminal               CUR Numbers[6]
209 #define width_status_line              CUR Numbers[7]
210 #define num_labels                     CUR Numbers[8]
211 #define label_height                   CUR Numbers[9]
212 #define label_width                    CUR Numbers[10]
213 #define max_attributes                 CUR Numbers[11]
214 #define maximum_windows                CUR Numbers[12]
215 #define max_colors                     CUR Numbers[13]
216 #define max_pairs                      CUR Numbers[14]
217 #define no_color_video                 CUR Numbers[15]
218 #define buffer_capacity                CUR Numbers[16]
219 #define dot_vert_spacing               CUR Numbers[17]
220 #define dot_horz_spacing               CUR Numbers[18]
221 #define max_micro_address              CUR Numbers[19]
222 #define max_micro_jump                 CUR Numbers[20]
223 #define micro_col_size                 CUR Numbers[21]
224 #define micro_line_size                CUR Numbers[22]
225 #define number_of_pins                 CUR Numbers[23]
226 #define output_res_char                CUR Numbers[24]
227 #define output_res_line                CUR Numbers[25]
228 #define output_res_horz_inch           CUR Numbers[26]
229 #define output_res_vert_inch           CUR Numbers[27]
230 #define print_rate                     CUR Numbers[28]
231 #define wide_char_size                 CUR Numbers[29]
232 #define buttons                        CUR Numbers[30]
233 #define bit_image_entwining            CUR Numbers[31]
234 #define bit_image_type                 CUR Numbers[32]
235 #define back_tab                       CUR Strings[0]
236 #define bell                           CUR Strings[1]
237 #define carriage_return                CUR Strings[2]
238 #define change_scroll_region           CUR Strings[3]
239 #define clear_all_tabs                 CUR Strings[4]
240 #define clear_screen                   CUR Strings[5]
241 #define clr_eol                        CUR Strings[6]
242 #define clr_eos                        CUR Strings[7]
243 #define column_address                 CUR Strings[8]
244 #define command_character              CUR Strings[9]
245 #define cursor_address                 CUR Strings[10]
246 #define cursor_down                    CUR Strings[11]
247 #define cursor_home                    CUR Strings[12]
248 #define cursor_invisible               CUR Strings[13]
249 #define cursor_left                    CUR Strings[14]
250 #define cursor_mem_address             CUR Strings[15]
251 #define cursor_normal                  CUR Strings[16]
252 #define cursor_right                   CUR Strings[17]
253 #define cursor_to_ll                   CUR Strings[18]
254 #define cursor_up                      CUR Strings[19]
255 #define cursor_visible                 CUR Strings[20]
256 #define delete_character               CUR Strings[21]
257 #define delete_line                    CUR Strings[22]
258 #define dis_status_line                CUR Strings[23]
259 #define down_half_line                 CUR Strings[24]
260 #define enter_alt_charset_mode         CUR Strings[25]
261 #define enter_blink_mode               CUR Strings[26]
262 #define enter_bold_mode                CUR Strings[27]
263 #define enter_ca_mode                  CUR Strings[28]
264 #define enter_delete_mode              CUR Strings[29]
265 #define enter_dim_mode                 CUR Strings[30]
266 #define enter_insert_mode              CUR Strings[31]
267 #define enter_secure_mode              CUR Strings[32]
268 #define enter_protected_mode           CUR Strings[33]
269 #define enter_reverse_mode             CUR Strings[34]
270 #define enter_standout_mode            CUR Strings[35]
271 #define enter_underline_mode           CUR Strings[36]
272 #define erase_chars                    CUR Strings[37]
273 #define exit_alt_charset_mode          CUR Strings[38]
274 #define exit_attribute_mode            CUR Strings[39]
275 #define exit_ca_mode                   CUR Strings[40]
276 #define exit_delete_mode               CUR Strings[41]
277 #define exit_insert_mode               CUR Strings[42]
278 #define exit_standout_mode             CUR Strings[43]
279 #define exit_underline_mode            CUR Strings[44]
280 #define flash_screen                   CUR Strings[45]
281 #define form_feed                      CUR Strings[46]
282 #define from_status_line               CUR Strings[47]
283 #define init_1string                   CUR Strings[48]
284 #define init_2string                   CUR Strings[49]
285 #define init_3string                   CUR Strings[50]
286 #define init_file                      CUR Strings[51]
287 #define insert_character               CUR Strings[52]
288 #define insert_line                    CUR Strings[53]
289 #define insert_padding                 CUR Strings[54]
290 #define key_backspace                  CUR Strings[55]
291 #define key_catab                      CUR Strings[56]
292 #define key_clear                      CUR Strings[57]
293 #define key_ctab                       CUR Strings[58]
294 #define key_dc                         CUR Strings[59]
295 #define key_dl                         CUR Strings[60]
296 #define key_down                       CUR Strings[61]
297 #define key_eic                        CUR Strings[62]
298 #define key_eol                        CUR Strings[63]
299 #define key_eos                        CUR Strings[64]
300 #define key_f0                         CUR Strings[65]
301 #define key_f1                         CUR Strings[66]
302 #define key_f10                        CUR Strings[67]
303 #define key_f2                         CUR Strings[68]
304 #define key_f3                         CUR Strings[69]
305 #define key_f4                         CUR Strings[70]
306 #define key_f5                         CUR Strings[71]
307 #define key_f6                         CUR Strings[72]
308 #define key_f7                         CUR Strings[73]
309 #define key_f8                         CUR Strings[74]
310 #define key_f9                         CUR Strings[75]
311 #define key_home                       CUR Strings[76]
312 #define key_ic                         CUR Strings[77]
313 #define key_il                         CUR Strings[78]
314 #define key_left                       CUR Strings[79]
315 #define key_ll                         CUR Strings[80]
316 #define key_npage                      CUR Strings[81]
317 #define key_ppage                      CUR Strings[82]
318 #define key_right                      CUR Strings[83]
319 #define key_sf                         CUR Strings[84]
320 #define key_sr                         CUR Strings[85]
321 #define key_stab                       CUR Strings[86]
322 #define key_up                         CUR Strings[87]
323 #define keypad_local                   CUR Strings[88]
324 #define keypad_xmit                    CUR Strings[89]
325 #define lab_f0                         CUR Strings[90]
326 #define lab_f1                         CUR Strings[91]
327 #define lab_f10                        CUR Strings[92]
328 #define lab_f2                         CUR Strings[93]
329 #define lab_f3                         CUR Strings[94]
330 #define lab_f4                         CUR Strings[95]
331 #define lab_f5                         CUR Strings[96]
332 #define lab_f6                         CUR Strings[97]
333 #define lab_f7                         CUR Strings[98]
334 #define lab_f8                         CUR Strings[99]
335 #define lab_f9                         CUR Strings[100]
336 #define meta_off                       CUR Strings[101]
337 #define meta_on                        CUR Strings[102]
338 #define newline                        CUR Strings[103]
339 #define pad_char                       CUR Strings[104]
340 #define parm_dch                       CUR Strings[105]
341 #define parm_delete_line               CUR Strings[106]
342 #define parm_down_cursor               CUR Strings[107]
343 #define parm_ich                       CUR Strings[108]
344 #define parm_index                     CUR Strings[109]
345 #define parm_insert_line               CUR Strings[110]
346 #define parm_left_cursor               CUR Strings[111]
347 #define parm_right_cursor              CUR Strings[112]
348 #define parm_rindex                    CUR Strings[113]
349 #define parm_up_cursor                 CUR Strings[114]
350 #define pkey_key                       CUR Strings[115]
351 #define pkey_local                     CUR Strings[116]
352 #define pkey_xmit                      CUR Strings[117]
353 #define print_screen                   CUR Strings[118]
354 #define prtr_off                       CUR Strings[119]
355 #define prtr_on                        CUR Strings[120]
356 #define repeat_char                    CUR Strings[121]
357 #define reset_1string                  CUR Strings[122]
358 #define reset_2string                  CUR Strings[123]
359 #define reset_3string                  CUR Strings[124]
360 #define reset_file                     CUR Strings[125]
361 #define restore_cursor                 CUR Strings[126]
362 #define row_address                    CUR Strings[127]
363 #define save_cursor                    CUR Strings[128]
364 #define scroll_forward                 CUR Strings[129]
365 #define scroll_reverse                 CUR Strings[130]
366 #define set_attributes                 CUR Strings[131]
367 #define set_tab                        CUR Strings[132]
368 #define set_window                     CUR Strings[133]
369 #define tab                            CUR Strings[134]
370 #define to_status_line                 CUR Strings[135]
371 #define underline_char                 CUR Strings[136]
372 #define up_half_line                   CUR Strings[137]
373 #define init_prog                      CUR Strings[138]
374 #define key_a1                         CUR Strings[139]
375 #define key_a3                         CUR Strings[140]
376 #define key_b2                         CUR Strings[141]
377 #define key_c1                         CUR Strings[142]
378 #define key_c3                         CUR Strings[143]
379 #define prtr_non                       CUR Strings[144]
380 #define char_padding                   CUR Strings[145]
381 #define acs_chars                      CUR Strings[146]
382 #define plab_norm                      CUR Strings[147]
383 #define key_btab                       CUR Strings[148]
384 #define enter_xon_mode                 CUR Strings[149]
385 #define exit_xon_mode                  CUR Strings[150]
386 #define enter_am_mode                  CUR Strings[151]
387 #define exit_am_mode                   CUR Strings[152]
388 #define xon_character                  CUR Strings[153]
389 #define xoff_character                 CUR Strings[154]
390 #define ena_acs                        CUR Strings[155]
391 #define label_on                       CUR Strings[156]
392 #define label_off                      CUR Strings[157]
393 #define key_beg                        CUR Strings[158]
394 #define key_cancel                     CUR Strings[159]
395 #define key_close                      CUR Strings[160]
396 #define key_command                    CUR Strings[161]
397 #define key_copy                       CUR Strings[162]
398 #define key_create                     CUR Strings[163]
399 #define key_end                        CUR Strings[164]
400 #define key_enter                      CUR Strings[165]
401 #define key_exit                       CUR Strings[166]
402 #define key_find                       CUR Strings[167]
403 #define key_help                       CUR Strings[168]
404 #define key_mark                       CUR Strings[169]
405 #define key_message                    CUR Strings[170]
406 #define key_move                       CUR Strings[171]
407 #define key_next                       CUR Strings[172]
408 #define key_open                       CUR Strings[173]
409 #define key_options                    CUR Strings[174]
410 #define key_previous                   CUR Strings[175]
411 #define key_print                      CUR Strings[176]
412 #define key_redo                       CUR Strings[177]
413 #define key_reference                  CUR Strings[178]
414 #define key_refresh                    CUR Strings[179]
415 #define key_replace                    CUR Strings[180]
416 #define key_restart                    CUR Strings[181]
417 #define key_resume                     CUR Strings[182]
418 #define key_save                       CUR Strings[183]
419 #define key_suspend                    CUR Strings[184]
420 #define key_undo                       CUR Strings[185]
421 #define key_sbeg                       CUR Strings[186]
422 #define key_scancel                    CUR Strings[187]
423 #define key_scommand                   CUR Strings[188]
424 #define key_scopy                      CUR Strings[189]
425 #define key_screate                    CUR Strings[190]
426 #define key_sdc                        CUR Strings[191]
427 #define key_sdl                        CUR Strings[192]
428 #define key_select                     CUR Strings[193]
429 #define key_send                       CUR Strings[194]
430 #define key_seol                       CUR Strings[195]
431 #define key_sexit                      CUR Strings[196]
432 #define key_sfind                      CUR Strings[197]
433 #define key_shelp                      CUR Strings[198]
434 #define key_shome                      CUR Strings[199]
435 #define key_sic                        CUR Strings[200]
436 #define key_sleft                      CUR Strings[201]
437 #define key_smessage                   CUR Strings[202]
438 #define key_smove                      CUR Strings[203]
439 #define key_snext                      CUR Strings[204]
440 #define key_soptions                   CUR Strings[205]
441 #define key_sprevious                  CUR Strings[206]
442 #define key_sprint                     CUR Strings[207]
443 #define key_sredo                      CUR Strings[208]
444 #define key_sreplace                   CUR Strings[209]
445 #define key_sright                     CUR Strings[210]
446 #define key_srsume                     CUR Strings[211]
447 #define key_ssave                      CUR Strings[212]
448 #define key_ssuspend                   CUR Strings[213]
449 #define key_sundo                      CUR Strings[214]
450 #define req_for_input                  CUR Strings[215]
451 #define key_f11                        CUR Strings[216]
452 #define key_f12                        CUR Strings[217]
453 #define key_f13                        CUR Strings[218]
454 #define key_f14                        CUR Strings[219]
455 #define key_f15                        CUR Strings[220]
456 #define key_f16                        CUR Strings[221]
457 #define key_f17                        CUR Strings[222]
458 #define key_f18                        CUR Strings[223]
459 #define key_f19                        CUR Strings[224]
460 #define key_f20                        CUR Strings[225]
461 #define key_f21                        CUR Strings[226]
462 #define key_f22                        CUR Strings[227]
463 #define key_f23                        CUR Strings[228]
464 #define key_f24                        CUR Strings[229]
465 #define key_f25                        CUR Strings[230]
466 #define key_f26                        CUR Strings[231]
467 #define key_f27                        CUR Strings[232]
468 #define key_f28                        CUR Strings[233]
469 #define key_f29                        CUR Strings[234]
470 #define key_f30                        CUR Strings[235]
471 #define key_f31                        CUR Strings[236]
472 #define key_f32                        CUR Strings[237]
473 #define key_f33                        CUR Strings[238]
474 #define key_f34                        CUR Strings[239]
475 #define key_f35                        CUR Strings[240]
476 #define key_f36                        CUR Strings[241]
477 #define key_f37                        CUR Strings[242]
478 #define key_f38                        CUR Strings[243]
479 #define key_f39                        CUR Strings[244]
480 #define key_f40                        CUR Strings[245]
481 #define key_f41                        CUR Strings[246]
482 #define key_f42                        CUR Strings[247]
483 #define key_f43                        CUR Strings[248]
484 #define key_f44                        CUR Strings[249]
485 #define key_f45                        CUR Strings[250]
486 #define key_f46                        CUR Strings[251]
487 #define key_f47                        CUR Strings[252]
488 #define key_f48                        CUR Strings[253]
489 #define key_f49                        CUR Strings[254]
490 #define key_f50                        CUR Strings[255]
491 #define key_f51                        CUR Strings[256]
492 #define key_f52                        CUR Strings[257]
493 #define key_f53                        CUR Strings[258]
494 #define key_f54                        CUR Strings[259]
495 #define key_f55                        CUR Strings[260]
496 #define key_f56                        CUR Strings[261]
497 #define key_f57                        CUR Strings[262]
498 #define key_f58                        CUR Strings[263]
499 #define key_f59                        CUR Strings[264]
500 #define key_f60                        CUR Strings[265]
501 #define key_f61                        CUR Strings[266]
502 #define key_f62                        CUR Strings[267]
503 #define key_f63                        CUR Strings[268]
504 #define clr_bol                        CUR Strings[269]
505 #define clear_margins                  CUR Strings[270]
506 #define set_left_margin                CUR Strings[271]
507 #define set_right_margin               CUR Strings[272]
508 #define label_format                   CUR Strings[273]
509 #define set_clock                      CUR Strings[274]
510 #define display_clock                  CUR Strings[275]
511 #define remove_clock                   CUR Strings[276]
512 #define create_window                  CUR Strings[277]
513 #define goto_window                    CUR Strings[278]
514 #define hangup                         CUR Strings[279]
515 #define dial_phone                     CUR Strings[280]
516 #define quick_dial                     CUR Strings[281]
517 #define tone                           CUR Strings[282]
518 #define pulse                          CUR Strings[283]
519 #define flash_hook                     CUR Strings[284]
520 #define fixed_pause                    CUR Strings[285]
521 #define wait_tone                      CUR Strings[286]
522 #define user0                          CUR Strings[287]
523 #define user1                          CUR Strings[288]
524 #define user2                          CUR Strings[289]
525 #define user3                          CUR Strings[290]
526 #define user4                          CUR Strings[291]
527 #define user5                          CUR Strings[292]
528 #define user6                          CUR Strings[293]
529 #define user7                          CUR Strings[294]
530 #define user8                          CUR Strings[295]
531 #define user9                          CUR Strings[296]
532 #define orig_pair                      CUR Strings[297]
533 #define orig_colors                    CUR Strings[298]
534 #define initialize_color               CUR Strings[299]
535 #define initialize_pair                CUR Strings[300]
536 #define set_color_pair                 CUR Strings[301]
537 #define set_foreground                 CUR Strings[302]
538 #define set_background                 CUR Strings[303]
539 #define change_char_pitch              CUR Strings[304]
540 #define change_line_pitch              CUR Strings[305]
541 #define change_res_horz                CUR Strings[306]
542 #define change_res_vert                CUR Strings[307]
543 #define define_char                    CUR Strings[308]
544 #define enter_doublewide_mode          CUR Strings[309]
545 #define enter_draft_quality            CUR Strings[310]
546 #define enter_italics_mode             CUR Strings[311]
547 #define enter_leftward_mode            CUR Strings[312]
548 #define enter_micro_mode               CUR Strings[313]
549 #define enter_near_letter_quality      CUR Strings[314]
550 #define enter_normal_quality           CUR Strings[315]
551 #define enter_shadow_mode              CUR Strings[316]
552 #define enter_subscript_mode           CUR Strings[317]
553 #define enter_superscript_mode         CUR Strings[318]
554 #define enter_upward_mode              CUR Strings[319]
555 #define exit_doublewide_mode           CUR Strings[320]
556 #define exit_italics_mode              CUR Strings[321]
557 #define exit_leftward_mode             CUR Strings[322]
558 #define exit_micro_mode                CUR Strings[323]
559 #define exit_shadow_mode               CUR Strings[324]
560 #define exit_subscript_mode            CUR Strings[325]
561 #define exit_superscript_mode          CUR Strings[326]
562 #define exit_upward_mode               CUR Strings[327]
563 #define micro_column_address           CUR Strings[328]
564 #define micro_down                     CUR Strings[329]
565 #define micro_left                     CUR Strings[330]
566 #define micro_right                    CUR Strings[331]
567 #define micro_row_address              CUR Strings[332]
568 #define micro_up                       CUR Strings[333]
569 #define order_of_pins                  CUR Strings[334]
570 #define parm_down_micro                CUR Strings[335]
571 #define parm_left_micro                CUR Strings[336]
572 #define parm_right_micro               CUR Strings[337]
573 #define parm_up_micro                  CUR Strings[338]
574 #define select_char_set                CUR Strings[339]
575 #define set_bottom_margin              CUR Strings[340]
576 #define set_bottom_margin_parm         CUR Strings[341]
577 #define set_left_margin_parm           CUR Strings[342]
578 #define set_right_margin_parm          CUR Strings[343]
579 #define set_top_margin                 CUR Strings[344]
580 #define set_top_margin_parm            CUR Strings[345]
581 #define start_bit_image                CUR Strings[346]
582 #define start_char_set_def             CUR Strings[347]
583 #define stop_bit_image                 CUR Strings[348]
584 #define stop_char_set_def              CUR Strings[349]
585 #define subscript_characters           CUR Strings[350]
586 #define superscript_characters         CUR Strings[351]
587 #define these_cause_cr                 CUR Strings[352]
588 #define zero_motion                    CUR Strings[353]
589 #define char_set_names                 CUR Strings[354]
590 #define key_mouse                      CUR Strings[355]
591 #define mouse_info                     CUR Strings[356]
592 #define req_mouse_pos                  CUR Strings[357]
593 #define get_mouse                      CUR Strings[358]
594 #define set_a_foreground               CUR Strings[359]
595 #define set_a_background               CUR Strings[360]
596 #define pkey_plab                      CUR Strings[361]
597 #define device_type                    CUR Strings[362]
598 #define code_set_init                  CUR Strings[363]
599 #define set0_des_seq                   CUR Strings[364]
600 #define set1_des_seq                   CUR Strings[365]
601 #define set2_des_seq                   CUR Strings[366]
602 #define set3_des_seq                   CUR Strings[367]
603 #define set_lr_margin                  CUR Strings[368]
604 #define set_tb_margin                  CUR Strings[369]
605 #define bit_image_repeat               CUR Strings[370]
606 #define bit_image_newline              CUR Strings[371]
607 #define bit_image_carriage_return      CUR Strings[372]
608 #define color_names                    CUR Strings[373]
609 #define define_bit_image_region        CUR Strings[374]
610 #define end_bit_image_region           CUR Strings[375]
611 #define set_color_band                 CUR Strings[376]
612 #define set_page_length                CUR Strings[377]
613 #define display_pc_char                CUR Strings[378]
614 #define enter_pc_charset_mode          CUR Strings[379]
615 #define exit_pc_charset_mode           CUR Strings[380]
616 #define enter_scancode_mode            CUR Strings[381]
617 #define exit_scancode_mode             CUR Strings[382]
618 #define pc_term_options                CUR Strings[383]
619 #define scancode_escape                CUR Strings[384]
620 #define alt_scancode_esc               CUR Strings[385]
621 #define enter_horizontal_hl_mode       CUR Strings[386]
622 #define enter_left_hl_mode             CUR Strings[387]
623 #define enter_low_hl_mode              CUR Strings[388]
624 #define enter_right_hl_mode            CUR Strings[389]
625 #define enter_top_hl_mode              CUR Strings[390]
626 #define enter_vertical_hl_mode         CUR Strings[391]
627 #define set_a_attributes               CUR Strings[392]
628 #define set_pglen_inch                 CUR Strings[393]
629 
630 #define BOOLWRITE 37
631 #define NUMWRITE  33
632 #define STRWRITE  394
633 
634 /* older synonyms for some capabilities */
635 #define beehive_glitch	no_esc_ctlc
636 #define teleray_glitch	dest_tabs_magic_smso
637 #define micro_char_size micro_col_size
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 
686 typedef 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 typedef struct term {		/* describe an actual terminal */
709     TERMTYPE	type;		/* terminal type description */
710     short	Filedes;	/* file description being written to */
711     TTY		Ottyb,		/* original state of the terminal */
712 		Nttyb;		/* current state of the terminal */
713     int		_baudrate;	/* used to compute padding */
714     char *      _termname;      /* used for termname() */
715 } TERMINAL;
716 
717 #if 0 || 0
718 NCURSES_WRAPPED_VAR(TERMINAL *, cur_term);
719 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolnames);
720 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolcodes);
721 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, boolfnames);
722 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numnames);
723 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numcodes);
724 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, numfnames);
725 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strnames);
726 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strcodes);
727 NCURSES_WRAPPED_VAR(NCURSES_CONST char * const *, strfnames);
728 
729 #define cur_term   NCURSES_PUBLIC_VAR(cur_term())
730 #define boolnames  NCURSES_PUBLIC_VAR(boolnames())
731 #define boolcodes  NCURSES_PUBLIC_VAR(boolcodes())
732 #define boolfnames NCURSES_PUBLIC_VAR(boolfnames())
733 #define numnames   NCURSES_PUBLIC_VAR(numnames())
734 #define numcodes   NCURSES_PUBLIC_VAR(numcodes())
735 #define numfnames  NCURSES_PUBLIC_VAR(numfnames())
736 #define strnames   NCURSES_PUBLIC_VAR(strnames())
737 #define strcodes   NCURSES_PUBLIC_VAR(strcodes())
738 #define strfnames  NCURSES_PUBLIC_VAR(strfnames())
739 
740 #else
741 
742 extern NCURSES_EXPORT_VAR(TERMINAL *) cur_term;
743 
744 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolnames[];
745 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolcodes[];
746 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) boolfnames[];
747 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numnames[];
748 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numcodes[];
749 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) numfnames[];
750 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strnames[];
751 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strcodes[];
752 extern NCURSES_EXPORT_VAR(NCURSES_CONST char * const ) strfnames[];
753 
754 #endif
755 
756 /* internals */
757 extern NCURSES_EXPORT(int) _nc_set_tty_mode (TTY *buf);
758 extern NCURSES_EXPORT(int) _nc_get_tty_mode (TTY *buf);
759 extern NCURSES_EXPORT(int) _nc_read_entry (const char * const, char * const, TERMTYPE *const);
760 extern NCURSES_EXPORT(int) _nc_read_file_entry (const char *const, TERMTYPE *);
761 extern NCURSES_EXPORT(int) _nc_read_termtype (TERMTYPE *, char *, int);
762 extern NCURSES_EXPORT(char *) _nc_first_name (const char *const);
763 extern NCURSES_EXPORT(int) _nc_name_match (const char *const, const char *const, const char *const);
764 extern NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *);
765 
766 /* entry points */
767 extern NCURSES_EXPORT(TERMINAL *) set_curterm (TERMINAL *);
768 extern NCURSES_EXPORT(int) del_curterm (TERMINAL *);
769 
770 /* miscellaneous entry points */
771 extern NCURSES_EXPORT(int) restartterm (NCURSES_CONST char *, int, int *);
772 extern NCURSES_EXPORT(int) setupterm (NCURSES_CONST char *,int,int *);
773 
774 /* terminfo entry points, also declared in curses.h */
775 #if !defined(__NCURSES_H)
776 extern NCURSES_EXPORT(char *) tigetstr (NCURSES_CONST char *);
777 extern NCURSES_EXPORT_VAR(char) ttytype[];
778 extern NCURSES_EXPORT(int) putp (const char *);
779 extern NCURSES_EXPORT(int) tigetflag (NCURSES_CONST char *);
780 extern NCURSES_EXPORT(int) tigetnum (NCURSES_CONST char *);
781 
782 #if 1 /* NCURSES_TPARM_VARARGS */
783 extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, ...);	/* special */
784 #else
785 extern NCURSES_EXPORT(char *) tparm (NCURSES_CONST char *, long,long,long,long,long,long,long,long,long);	/* special */
786 extern NCURSES_EXPORT(char *) tparm_varargs (NCURSES_CONST char *, ...);	/* special */
787 #endif
788 
789 #endif /* __NCURSES_H */
790 
791 /* termcap database emulation (XPG4 uses const only for 2nd param of tgetent) */
792 #if !defined(NCURSES_TERMCAP_H_incl)
793 extern NCURSES_EXPORT(char *) tgetstr (NCURSES_CONST char *, char **);
794 extern NCURSES_EXPORT(char *) tgoto (const char *, int, int);
795 extern NCURSES_EXPORT(int) tgetent (char *, const char *);
796 extern NCURSES_EXPORT(int) tgetflag (NCURSES_CONST char *);
797 extern NCURSES_EXPORT(int) tgetnum (NCURSES_CONST char *);
798 extern NCURSES_EXPORT(int) tputs (const char *, int, int (*)(int));
799 #endif /* NCURSES_TERMCAP_H_incl */
800 
801 #ifdef __cplusplus
802 }
803 #endif
804 
805 #endif /* NCURSES_TERM_H_incl */
806