2
$Id: terminfo.pas,v 1.1.2.1 2000/10/25 12:23:20 marco Exp $
4
An interface unit for the terminfo database
6
Copyright (c) 1997 Balazs Scheidler (bazsi@balabit.hu)
8
This library is free software; you can redistribute it and/or
9
modify it under the terms of the GNU Library General Public
10
License as published by the Free Software Foundation; either
11
version 2 of the License, or (at your option) any later version.
14
This library is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
Library General Public License for more details.
19
You should have received a copy of the GNU Library General Public
20
License along with this library; if not, write to the Free
21
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
****************************************************************************}
36
auto_right_margin = 1;
38
ceol_standout_glitch = 3;
39
eat_newline_glitch = 4;
45
insert_null_glitch = 10;
48
move_insert_mode = 13;
49
move_standout_mode = 14;
51
status_line_esc_ok = 16;
52
dest_tabs_magic_smso = 17;
54
transparent_underline = 19;
61
non_dest_scroll_region = 26;
63
back_color_erase = 28;
64
hue_lightness_saturation = 29;
66
cr_cancels_micro_mode = 31;
69
semi_auto_right_margin = 34;
78
magic_cookie_glitch = 4;
79
padding_baud_rate = 5;
81
width_status_line = 7;
91
dot_vert_spacing = 17;
92
dot_horz_spacing = 18;
93
max_micro_address = 19;
100
output_res_horz_inch = 26;
101
output_res_vert_inch = 27;
105
bit_image_entwining = 31;
112
change_scroll_region = 3;
118
command_character = 9;
122
cursor_invisible = 13;
124
cursor_mem_address = 15;
130
delete_character = 21;
132
dis_status_line = 23;
134
enter_alt_charset_mode = 25;
135
enter_blink_mode = 26;
136
enter_bold_mode = 27;
138
enter_delete_mode = 29;
140
enter_insert_mode = 31;
141
enter_secure_mode = 32;
142
enter_protected_mode = 33;
143
enter_reverse_mode = 34;
144
enter_standout_mode = 35;
145
enter_underline_mode = 36;
147
exit_alt_charset_mode = 38;
148
exit_attribute_mode = 39;
150
exit_delete_mode = 41;
151
exit_insert_mode = 42;
152
exit_standout_mode = 43;
153
exit_underline_mode = 44;
156
from_status_line = 47;
161
insert_character = 52;
215
parm_delete_line = 106;
216
parm_down_cursor = 107;
219
parm_insert_line = 110;
220
parm_left_cursor = 111;
221
parm_right_cursor = 112;
223
parm_up_cursor = 114;
235
restore_cursor = 126;
238
scroll_forward = 129;
239
scroll_reverse = 130;
240
set_attributes = 131;
244
to_status_line = 135;
245
underline_char = 136;
258
enter_xon_mode = 149;
263
xoff_character = 154;
380
set_left_margin = 271;
381
set_right_margin = 272;
408
initialize_color = 299;
409
initialize_pair = 300;
410
set_color_pair = 301;
411
set_foreground = 302;
412
set_background = 303;
413
change_char_pitch = 304;
414
change_line_pitch = 305;
415
change_res_horz = 306;
416
change_res_vert = 307;
418
enter_doublewide_mode = 309;
419
enter_draft_quality = 310;
420
enter_italics_mode = 311;
421
enter_leftward_mode = 312;
422
enter_micro_mode = 313;
423
enter_near_letter_quality = 314;
424
enter_normal_quality = 315;
425
enter_shadow_mode = 316;
426
enter_subscript_mode = 317;
427
enter_superscript_mode = 318;
428
enter_upward_mode = 319;
429
exit_doublewide_mode = 320;
430
exit_italics_mode = 321;
431
exit_leftward_mode = 322;
432
exit_micro_mode = 323;
433
exit_shadow_mode = 324;
434
exit_subscript_mode = 325;
435
exit_superscript_mode = 326;
436
exit_upward_mode = 327;
437
micro_column_address = 328;
441
micro_row_address = 332;
444
parm_down_micro = 335;
445
parm_left_micro = 336;
446
parm_right_micro = 337;
448
select_char_set = 339;
449
set_bottom_margin = 340;
450
set_bottom_margin_parm = 341;
451
set_left_margin_parm = 342;
452
set_right_margin_parm = 343;
453
set_top_margin = 344;
454
set_top_margin_parm = 345;
455
start_bit_image = 346;
456
start_char_set_def = 347;
457
stop_bit_image = 348;
458
stop_char_set_def = 349;
459
subscript_characters = 350;
460
superscript_characters = 351;
461
these_cause_cr = 352;
463
char_set_names = 354;
468
set_a_foreground = 359;
469
set_a_background = 360;
479
bit_image_repeat = 370;
480
bit_image_newline = 371;
481
bit_image_carriage_return = 372;
483
define_bit_image_region = 374;
484
end_bit_image_region = 375;
485
set_color_band = 376;
486
set_page_length = 377;
487
display_pc_char = 378;
488
enter_pc_charset_mode = 379;
489
exit_pc_charset_mode = 380;
490
enter_scancode_mode = 381;
491
exit_scancode_mode = 382;
492
pc_term_options = 383;
493
scancode_escape = 384;
494
alt_scancode_esc = 385;
495
enter_horizontal_hl_mode = 386;
496
enter_left_hl_mode = 387;
497
enter_low_hl_mode = 388;
498
enter_right_hl_mode = 389;
499
enter_top_hl_mode = 390;
500
enter_vertical_hl_mode = 391;
502
{ older synonyms for some booleans }
503
beehive_glitch = no_esc_ctlc;
504
teleray_glitch = dest_tabs_magic_smso;
505
micro_col_size = micro_char_size;
509
magic_cookie_glitch_ul = 33;
510
backspaces_with_bs = 37;
511
crt_no_scrolling = 38;
512
no_correctly_working_cr = 39;
513
carriage_return_delay = 34;
515
linefeed_if_not_lf = 394;
516
backspace_if_not_bs = 395;
517
gnu_has_meta_key = 40;
518
linefeed_is_newline = 41;
519
backspace_delay = 36;
520
horizontal_tab_delay = 37;
521
number_of_function_keys = 38;
522
other_non_function_keys = 396;
524
has_hardware_tabs = 42;
525
return_does_clr_eol = 43;
552
c_iflag, c_oflag, c_cflag, c_lflag: TCFlag_t;
554
c_cc: array [0..NCCS-1] of Char;
555
c_ispeed, c_ospeed: Speed_t;
559
TT_BoolArray = array [0..BoolCount - 1] of Boolean;
560
TT_WordArray = array [0..NumCount - 1] of Word;
561
TT_PCharArray = array [0..StrCount - 1] of PChar;
566
Booleans: TT_BoolArray;
567
Numbers: TT_WordArray;
568
Strings: TT_PCharArray;
571
Terminal_ptr4 = ^Terminal4;
575
Ottyb, Nttyb: Termios;
582
Booleans: ^TT_BoolArray;
583
Numbers: ^TT_WordArray;
584
Strings: ^TT_PCharArray;
587
Terminal_ptr5 = ^Terminal5;
591
Ottyb, Nttyb: Termios;
595
TerminalCommon_ptr1 = ^TerminalCommon1;
596
TerminalCommon1 = record
601
TerminalCommon_ptr2 = ^TerminalCommon2;
602
TerminalCommon2 = record
604
Ottyb, Nttyb: Termios;
608
WriterFunc = function (P: PChar): Longint;
611
cur_term : TerminalCommon_ptr1; external name 'cur_term';
612
cur_term_booleans: ^TT_BoolArray;
613
cur_term_numbers: ^TT_WordArray;
614
cur_term_strings: ^TT_PCharArray;
615
cur_term_common: TerminalCommon_ptr2;
618
cur_term_valid : boolean = false;
620
{ Note: the following two procedures expect a pointer to a full terminfo }
621
{ structure, not just to the common parts. However, since this structure }
622
{ differs for different versions of ncurses,it's impossible to give a }
623
{ general declaration here which is correct (JM) }
624
function set_curterm(term: TerminalCommon_ptr1): TerminalCommon_ptr1;cdecl;
625
function del_curterm(term: TerminalCommon_ptr1): Longint;
627
{ sets whether to use environment variables for LINES and COLUMNS }
628
procedure use_env(B: Longint);cdecl;
630
function putp(Ndx: Longint): Longint;
632
{ this function must be called before any terminal properties are accessed }
633
function setupterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint;
636
function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint;cdecl;
638
{function tgetent(P1, P2: PChar): Longint;
639
function tgetflag(P: PChar): Longint;
640
function tgetnum(P: PChar): Longint;
641
function tgoto(P: PChar; L1, L2: Longint): PChar;
642
function tgetstr(P: PChar; var R: PChar): PChar;
643
function tigetflag(P: PChar): Longint;
644
function tigetnum(P: PChar): Longint;
645
function tigetstr(P: PChar): PChar;
646
function tparm(P: PChar, ...): PChar;
647
function tparam(const char *, char *, int, ...): PChar;}
648
function tputs(Ndx: Word; L1: Longint; F: WriterFunc): Longint;
655
function putp(Ndx: Longint): Longint;
659
if not assigned(cur_term) then
661
P := cur_term_strings^[Ndx];
662
putp := fdWrite(cur_term_common^.filedes, P^, StrLen(P));
665
function tputs(Ndx: Word; L1: Longint; F: WriterFunc): Longint;
669
if not assigned(cur_term) then
671
{ L1 := L1; why was this here ?? PM }
672
P := cur_term_strings^[Ndx];
676
function set_curterm(term: TerminalCommon_ptr1): TerminalCommon_ptr1; cdecl; external;
678
procedure use_env(B: Longint); cdecl; external;
680
function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external;
682
function setuptermC(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external name 'setupterm';
684
function setupterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint;
686
versioncheck: longint;
688
setupterm := setuptermC(term,fd,errcode);
689
if not assigned(cur_term) then
691
cur_term_valid := true;
694
if (Terminal_ptr4(cur_term)^.ttype.Booleans[versioncheck] in [false,true]) then
696
else versioncheck := -1;
697
until (versioncheck = BoolCount) or
699
if versioncheck = BoolCount then
702
cur_term_booleans := @Terminal_ptr4(cur_term)^.ttype.Booleans;
703
cur_term_numbers := @Terminal_ptr4(cur_term)^.ttype.Numbers;
704
cur_term_strings := @Terminal_ptr4(cur_term)^.ttype.Strings;
705
cur_term_common := pointer(@Terminal_ptr4(cur_term)^.FileDes);
708
{ assume 5.x or higher }
710
cur_term_booleans := Terminal_ptr5(cur_term)^.ttype.Booleans;
711
cur_term_numbers := Terminal_ptr5(cur_term)^.ttype.Numbers;
712
cur_term_strings := Terminal_ptr5(cur_term)^.ttype.Strings;
713
cur_term_common := pointer(@Terminal_ptr5(cur_term)^.FileDes);
717
function del_curtermC(term: TerminalCommon_ptr1): Longint; cdecl; external name 'del_curterm';
719
function del_curterm(term: TerminalCommon_ptr1): Longint;
721
reset_cur_term : boolean;
723
if term=cur_term then
725
cur_term_booleans := nil;
726
cur_term_numbers := nil;
727
cur_term_strings := nil;
728
cur_term_common := nil;
729
reset_cur_term := true;
732
reset_cur_term := false;
733
del_curterm := del_curtermC(term);
734
if reset_cur_term then
735
cur_term_valid := false;
737
{function tgetent(P1, P2: PChar): Longint; cdecl; external;
738
function tgetflag(P: PChar): Longint; cdecl; external;
739
function tgetnum(P: PChar): Longint; cdecl; external;
740
function tgoto(P: PChar; L1, L2: Longint): PChar; cdecl; external;
741
function tgetstr(P: PChar; var R: PChar): PChar; cdecl; external;
742
function tigetflag(P: PChar): Longint; cdecl; external;
743
function tigetnum(P: PChar): Longint; cdecl; external;
744
function tigetstr(P: PChar): PChar; cdecl; external;
745
function tparm(P: PChar; ...): PChar; cdecl; external;
746
function tparam(const char *, char *, int, ...): PChar; cdecl; external;}
750
$Log: terminfo.pas,v $
751
Revision 1.1.2.1 2000/10/25 12:23:20 marco
754
Revision 1.1.2.3 2000/10/09 16:29:14 pierre
755
* more linux terminal fixes
757
Revision 1.1.2.2 2000/08/02 12:30:36 jonas
758
* improved version check *slightly*
760
Revision 1.1 2000/07/13 06:29:39 michael
763
Revision 1.2 2000/06/30 12:28:57 jonas
764
* fixed termtype structure
766
Revision 1.1 2000/01/06 01:20:31 peter
767
* moved out of packages/ back to topdir
769
Revision 1.1 1999/11/24 23:36:38 peter
770
* moved to packages dir
772
Revision 1.3 1999/04/22 14:48:27 peter
775
Revision 1.2 1998/12/07 12:25:51 peter
776
* link with ncurses which is more available the curses
778
Revision 1.1 1998/12/04 12:48:30 peter
781
Revision 1.1 1998/10/26 11:31:47 peter
782
+ inital include files
784
Revision 1.3 1998/10/26 09:36:26 peter
787
Revision 1.2 1998/07/29 20:17:47 bazsi
788
some updates to Video, it now uses terminfo. Some modifications for FreeVision.
790
Revision 1.1 1998/06/13 12:38:54 bazsi
b'\\ No newline at end of file'