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