~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to api/unix/terminfo.pas

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2004-08-12 16:29:37 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040812162937-moo8ulvysp1ln771
Tags: 1.9.4-5
fp-compiler: needs ld, adding dependency on binutils.  (Closes: #265265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
2
 
   $Id: terminfo.pas,v 1.1.2.1 2000/10/25 12:23:20 marco Exp $
3
 
 
4
 
   An interface unit for the terminfo database
5
 
 
6
 
   Copyright (c) 1997 Balazs Scheidler (bazsi@balabit.hu)
7
 
 
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.
12
 
 
13
 
 
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.
18
 
 
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.
22
 
 
23
 
 ****************************************************************************}
24
 
 
25
 
unit TermInfo;
26
 
 
27
 
interface
28
 
 
29
 
{$linklib ncurses}
30
 
{$linklib c}
31
 
{$packrecords c}
32
 
 
33
 
const
34
 
  { boolean values }
35
 
  auto_left_margin              = 0;
36
 
  auto_right_margin             = 1;
37
 
  no_esc_ctlc                   = 2;
38
 
  ceol_standout_glitch          = 3;
39
 
  eat_newline_glitch            = 4;
40
 
  erase_overstrike              = 5;
41
 
  generic_type                  = 6;
42
 
  hard_copy                     = 7;
43
 
  has_meta_key                  = 8;
44
 
  has_status_line               = 9;
45
 
  insert_null_glitch            = 10;
46
 
  memory_above                  = 11;
47
 
  memory_below                  = 12;
48
 
  move_insert_mode              = 13;
49
 
  move_standout_mode            = 14;
50
 
  over_strike                   = 15;
51
 
  status_line_esc_ok            = 16;
52
 
  dest_tabs_magic_smso          = 17;
53
 
  tilde_glitch                  = 18;
54
 
  transparent_underline         = 19;
55
 
  xon_xoff                      = 20;
56
 
  needs_xon_xoff                = 21;
57
 
  prtr_silent                   = 22;
58
 
  hard_cursor                   = 23;
59
 
  non_rev_rmcup                 = 24;
60
 
  no_pad_char                   = 25;
61
 
  non_dest_scroll_region        = 26;
62
 
  can_change                    = 27;
63
 
  back_color_erase              = 28;
64
 
  hue_lightness_saturation      = 29;
65
 
  col_addr_glitch               = 30;
66
 
  cr_cancels_micro_mode         = 31;
67
 
  has_print_wheel               = 32;
68
 
  row_addr_glitch               = 33;
69
 
  semi_auto_right_margin        = 34;
70
 
  cpi_changes_res               = 35;
71
 
  lpi_changes_res               = 36;
72
 
 
73
 
  { numbers ... }
74
 
  columns                       = 0;
75
 
  init_tabs                     = 1;
76
 
  lines                         = 2;
77
 
  lines_of_memory               = 3;
78
 
  magic_cookie_glitch           = 4;
79
 
  padding_baud_rate             = 5;
80
 
  virtual_terminal              = 6;
81
 
  width_status_line             = 7;
82
 
  num_labels                    = 8;
83
 
  label_height                  = 9;
84
 
  label_width                   = 10;
85
 
  max_attributes                = 11;
86
 
  maximum_windows               = 12;
87
 
  max_colors                    = 13;
88
 
  max_pairs                     = 14;
89
 
  no_color_video                = 15;
90
 
  buffer_capacity               = 16;
91
 
  dot_vert_spacing              = 17;
92
 
  dot_horz_spacing              = 18;
93
 
  max_micro_address             = 19;
94
 
  max_micro_jump                = 20;
95
 
  micro_char_size               = 21;
96
 
  micro_line_size               = 22;
97
 
  number_of_pins                = 23;
98
 
  output_res_char               = 24;
99
 
  output_res_line               = 25;
100
 
  output_res_horz_inch          = 26;
101
 
  output_res_vert_inch          = 27;
102
 
  print_rate                    = 28;
103
 
  wide_char_size                = 29;
104
 
  buttons                       = 30;
105
 
  bit_image_entwining           = 31;
106
 
  bit_image_type                = 32;
107
 
 
108
 
  { strings }
109
 
  back_tab                      = 0;
110
 
  bell                          = 1;
111
 
  carriage_return               = 2;
112
 
  change_scroll_region          = 3;
113
 
  clear_all_tabs                = 4;
114
 
  clear_screen                  = 5;
115
 
  clr_eol                       = 6;
116
 
  clr_eos                       = 7;
117
 
  column_address                = 8;
118
 
  command_character             = 9;
119
 
  cursor_address                = 10;
120
 
  cursor_down                   = 11;
121
 
  cursor_home                   = 12;
122
 
  cursor_invisible              = 13;
123
 
  cursor_left                   = 14;
124
 
  cursor_mem_address            = 15;
125
 
  cursor_normal                 = 16;
126
 
  cursor_right                  = 17;
127
 
  cursor_to_ll                  = 18;
128
 
  cursor_up                     = 19;
129
 
  cursor_visible                = 20;
130
 
  delete_character              = 21;
131
 
  delete_line                   = 22;
132
 
  dis_status_line               = 23;
133
 
  down_half_line                = 24;
134
 
  enter_alt_charset_mode        = 25;
135
 
  enter_blink_mode              = 26;
136
 
  enter_bold_mode               = 27;
137
 
  enter_ca_mode                 = 28;
138
 
  enter_delete_mode             = 29;
139
 
  enter_dim_mode                = 30;
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;
146
 
  erase_chars                   = 37;
147
 
  exit_alt_charset_mode         = 38;
148
 
  exit_attribute_mode           = 39;
149
 
  exit_ca_mode                  = 40;
150
 
  exit_delete_mode              = 41;
151
 
  exit_insert_mode              = 42;
152
 
  exit_standout_mode            = 43;
153
 
  exit_underline_mode           = 44;
154
 
  flash_screen                  = 45;
155
 
  form_feed                     = 46;
156
 
  from_status_line              = 47;
157
 
  init_1string                  = 48;
158
 
  init_2string                  = 49;
159
 
  init_3string                  = 50;
160
 
  init_file                     = 51;
161
 
  insert_character              = 52;
162
 
  insert_line                   = 53;
163
 
  insert_padding                = 54;
164
 
  key_backspace                 = 55;
165
 
  key_catab                     = 56;
166
 
  key_clear                     = 57;
167
 
  key_ctab                      = 58;
168
 
  key_dc                        = 59;
169
 
  key_dl                        = 60;
170
 
  key_down                      = 61;
171
 
  key_eic                       = 62;
172
 
  key_eol                       = 63;
173
 
  key_eos                       = 64;
174
 
  key_f0                        = 65;
175
 
  key_f1                        = 66;
176
 
  key_f10                       = 67;
177
 
  key_f2                        = 68;
178
 
  key_f3                        = 69;
179
 
  key_f4                        = 70;
180
 
  key_f5                        = 71;
181
 
  key_f6                        = 72;
182
 
  key_f7                        = 73;
183
 
  key_f8                        = 74;
184
 
  key_f9                        = 75;
185
 
  key_home                      = 76;
186
 
  key_ic                        = 77;
187
 
  key_il                        = 78;
188
 
  key_left                      = 79;
189
 
  key_ll                        = 80;
190
 
  key_npage                     = 81;
191
 
  key_ppage                     = 82;
192
 
  key_right                     = 83;
193
 
  key_sf                        = 84;
194
 
  key_sr                        = 85;
195
 
  key_stab                      = 86;
196
 
  key_up                        = 87;
197
 
  keypad_local                  = 88;
198
 
  keypad_xmit                   = 89;
199
 
  lab_f0                        = 90;
200
 
  lab_f1                        = 91;
201
 
  lab_f10                       = 92;
202
 
  lab_f2                        = 93;
203
 
  lab_f3                        = 94;
204
 
  lab_f4                        = 95;
205
 
  lab_f5                        = 96;
206
 
  lab_f6                        = 97;
207
 
  lab_f7                        = 98;
208
 
  lab_f8                        = 99;
209
 
  lab_f9                        = 100;
210
 
  meta_off                      = 101;
211
 
  meta_on                       = 102;
212
 
  newline                       = 103;
213
 
  pad_char                      = 104;
214
 
  parm_dch                      = 105;
215
 
  parm_delete_line              = 106;
216
 
  parm_down_cursor              = 107;
217
 
  parm_ich                      = 108;
218
 
  parm_index                    = 109;
219
 
  parm_insert_line              = 110;
220
 
  parm_left_cursor              = 111;
221
 
  parm_right_cursor             = 112;
222
 
  parm_rindex                   = 113;
223
 
  parm_up_cursor                = 114;
224
 
  pkey_key                      = 115;
225
 
  pkey_local                    = 116;
226
 
  pkey_xmit                     = 117;
227
 
  print_screen                  = 118;
228
 
  prtr_off                      = 119;
229
 
  prtr_on                       = 120;
230
 
  repeat_char                   = 121;
231
 
  reset_1string                 = 122;
232
 
  reset_2string                 = 123;
233
 
  reset_3string                 = 124;
234
 
  reset_file                    = 125;
235
 
  restore_cursor                = 126;
236
 
  row_address                   = 127;
237
 
  save_cursor                   = 128;
238
 
  scroll_forward                = 129;
239
 
  scroll_reverse                = 130;
240
 
  set_attributes                = 131;
241
 
  set_tab                       = 132;
242
 
  set_window                    = 133;
243
 
  tab                           = 134;
244
 
  to_status_line                = 135;
245
 
  underline_char                = 136;
246
 
  up_half_line                  = 137;
247
 
  init_prog                     = 138;
248
 
  key_a1                        = 139;
249
 
  key_a3                        = 140;
250
 
  key_b2                        = 141;
251
 
  key_c1                        = 142;
252
 
  key_c3                        = 143;
253
 
  prtr_non                      = 144;
254
 
  char_padding                  = 145;
255
 
  acs_chars                     = 146;
256
 
  plab_norm                     = 147;
257
 
  key_btab                      = 148;
258
 
  enter_xon_mode                = 149;
259
 
  exit_xon_mode                 = 150;
260
 
  enter_am_mode                 = 151;
261
 
  exit_am_mode                  = 152;
262
 
  xon_character                 = 153;
263
 
  xoff_character                = 154;
264
 
  ena_acs                       = 155;
265
 
  label_on                      = 156;
266
 
  label_off                     = 157;
267
 
  key_beg                       = 158;
268
 
  key_cancel                    = 159;
269
 
  key_close                     = 160;
270
 
  key_command                   = 161;
271
 
  key_copy                      = 162;
272
 
  key_create                    = 163;
273
 
  key_end                       = 164;
274
 
  key_enter                     = 165;
275
 
  key_exit                      = 166;
276
 
  key_find                      = 167;
277
 
  key_help                      = 168;
278
 
  key_mark                      = 169;
279
 
  key_message                   = 170;
280
 
  key_move                      = 171;
281
 
  key_next                      = 172;
282
 
  key_open                      = 173;
283
 
  key_options                   = 174;
284
 
  key_previous                  = 175;
285
 
  key_print                     = 176;
286
 
  key_redo                      = 177;
287
 
  key_reference                 = 178;
288
 
  key_refresh                   = 179;
289
 
  key_replace                   = 180;
290
 
  key_restart                   = 181;
291
 
  key_resume                    = 182;
292
 
  key_save                      = 183;
293
 
  key_suspend                   = 184;
294
 
  key_undo                      = 185;
295
 
  key_sbeg                      = 186;
296
 
  key_scancel                   = 187;
297
 
  key_scommand                  = 188;
298
 
  key_scopy                     = 189;
299
 
  key_screate                   = 190;
300
 
  key_sdc                       = 191;
301
 
  key_sdl                       = 192;
302
 
  key_select                    = 193;
303
 
  key_send                      = 194;
304
 
  key_seol                      = 195;
305
 
  key_sexit                     = 196;
306
 
  key_sfind                     = 197;
307
 
  key_shelp                     = 198;
308
 
  key_shome                     = 199;
309
 
  key_sic                       = 200;
310
 
  key_sleft                     = 201;
311
 
  key_smessage                  = 202;
312
 
  key_smove                     = 203;
313
 
  key_snext                     = 204;
314
 
  key_soptions                  = 205;
315
 
  key_sprevious                 = 206;
316
 
  key_sprint                    = 207;
317
 
  key_sredo                     = 208;
318
 
  key_sreplace                  = 209;
319
 
  key_sright                    = 210;
320
 
  key_srsume                    = 211;
321
 
  key_ssave                     = 212;
322
 
  key_ssuspend                  = 213;
323
 
  key_sundo                     = 214;
324
 
  req_for_input                 = 215;
325
 
  key_f11                       = 216;
326
 
  key_f12                       = 217;
327
 
  key_f13                       = 218;
328
 
  key_f14                       = 219;
329
 
  key_f15                       = 220;
330
 
  key_f16                       = 221;
331
 
  key_f17                       = 222;
332
 
  key_f18                       = 223;
333
 
  key_f19                       = 224;
334
 
  key_f20                       = 225;
335
 
  key_f21                       = 226;
336
 
  key_f22                       = 227;
337
 
  key_f23                       = 228;
338
 
  key_f24                       = 229;
339
 
  key_f25                       = 230;
340
 
  key_f26                       = 231;
341
 
  key_f27                       = 232;
342
 
  key_f28                       = 233;
343
 
  key_f29                       = 234;
344
 
  key_f30                       = 235;
345
 
  key_f31                       = 236;
346
 
  key_f32                       = 237;
347
 
  key_f33                       = 238;
348
 
  key_f34                       = 239;
349
 
  key_f35                       = 240;
350
 
  key_f36                       = 241;
351
 
  key_f37                       = 242;
352
 
  key_f38                       = 243;
353
 
  key_f39                       = 244;
354
 
  key_f40                       = 245;
355
 
  key_f41                       = 246;
356
 
  key_f42                       = 247;
357
 
  key_f43                       = 248;
358
 
  key_f44                       = 249;
359
 
  key_f45                       = 250;
360
 
  key_f46                       = 251;
361
 
  key_f47                       = 252;
362
 
  key_f48                       = 253;
363
 
  key_f49                       = 254;
364
 
  key_f50                       = 255;
365
 
  key_f51                       = 256;
366
 
  key_f52                       = 257;
367
 
  key_f53                       = 258;
368
 
  key_f54                       = 259;
369
 
  key_f55                       = 260;
370
 
  key_f56                       = 261;
371
 
  key_f57                       = 262;
372
 
  key_f58                       = 263;
373
 
  key_f59                       = 264;
374
 
  key_f60                       = 265;
375
 
  key_f61                       = 266;
376
 
  key_f62                       = 267;
377
 
  key_f63                       = 268;
378
 
  clr_bol                       = 269;
379
 
  clear_margins                 = 270;
380
 
  set_left_margin               = 271;
381
 
  set_right_margin              = 272;
382
 
  label_format                  = 273;
383
 
  set_clock                     = 274;
384
 
  display_clock                 = 275;
385
 
  remove_clock                  = 276;
386
 
  create_window                 = 277;
387
 
  goto_window                   = 278;
388
 
  hangup                        = 279;
389
 
  dial_phone                    = 280;
390
 
  quick_dial                    = 281;
391
 
  tone                          = 282;
392
 
  pulse                         = 283;
393
 
  flash_hook                    = 284;
394
 
  fixed_pause                   = 285;
395
 
  wait_tone                     = 286;
396
 
  user0                         = 287;
397
 
  user1                         = 288;
398
 
  user2                         = 289;
399
 
  user3                         = 290;
400
 
  user4                         = 291;
401
 
  user5                         = 292;
402
 
  user6                         = 293;
403
 
  user7                         = 294;
404
 
  user8                         = 295;
405
 
  user9                         = 296;
406
 
  orig_pair                     = 297;
407
 
  orig_colors                   = 298;
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;
417
 
  define_char                   = 308;
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;
438
 
  micro_down                    = 329;
439
 
  micro_left                    = 330;
440
 
  micro_right                   = 331;
441
 
  micro_row_address             = 332;
442
 
  micro_up                      = 333;
443
 
  order_of_pins                 = 334;
444
 
  parm_down_micro               = 335;
445
 
  parm_left_micro               = 336;
446
 
  parm_right_micro              = 337;
447
 
  parm_up_micro                 = 338;
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;
462
 
  zero_motion                   = 353;
463
 
  char_set_names                = 354;
464
 
  key_mouse                     = 355;
465
 
  mouse_info                    = 356;
466
 
  req_mouse_pos                 = 357;
467
 
  get_mouse                     = 358;
468
 
  set_a_foreground              = 359;
469
 
  set_a_background              = 360;
470
 
  pkey_plab                     = 361;
471
 
  device_type                   = 362;
472
 
  code_set_init                 = 363;
473
 
  set0_des_seq                  = 364;
474
 
  set1_des_seq                  = 365;
475
 
  set2_des_seq                  = 366;
476
 
  set3_des_seq                  = 367;
477
 
  set_lr_margin                 = 368;
478
 
  set_tb_margin                 = 369;
479
 
  bit_image_repeat              = 370;
480
 
  bit_image_newline             = 371;
481
 
  bit_image_carriage_return     = 372;
482
 
  color_names                   = 373;
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;
501
 
 
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;
506
 
  { internal }
507
 
  termcap_init2               = 392;
508
 
  termcap_reset               = 393;
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;
514
 
  new_line_delay              = 35;
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;
523
 
  arrow_key_map               = 397;
524
 
  has_hardware_tabs           = 42;
525
 
  return_does_clr_eol         = 43;
526
 
  acs_ulcorner                = 398;
527
 
  acs_llcorner                = 399;
528
 
  acs_urcorner                = 400;
529
 
  acs_lrcorner                = 401;
530
 
  acs_ltee                    = 402;
531
 
  acs_rtee                    = 403;
532
 
  acs_btee                    = 404;
533
 
  acs_ttee                    = 405;
534
 
  acs_hline                   = 406;
535
 
  acs_vline                   = 407;
536
 
  acs_plus                    = 408;
537
 
  memory_lock                 = 409;
538
 
  memory_unlock               = 410;
539
 
  box_chars_1                 = 411;
540
 
 
541
 
 
542
 
const
543
 
  NCCS = 32;
544
 
  BoolCount = 44;
545
 
  NumCount = 39;
546
 
  StrCount = 412;
547
 
 
548
 
type
549
 
  TCFlag_t = Longint;
550
 
  Speed_t = Longint;
551
 
  TermIOS = record
552
 
    c_iflag, c_oflag, c_cflag, c_lflag: TCFlag_t;
553
 
    c_line: Byte;
554
 
    c_cc: array [0..NCCS-1] of Char;
555
 
    c_ispeed, c_ospeed: Speed_t;
556
 
    Pad: word;
557
 
  end;
558
 
 
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;
562
 
 
563
 
  TermType4 = record
564
 
    Term_Names: PChar;
565
 
    Str_Table: PChar;
566
 
    Booleans: TT_BoolArray;
567
 
    Numbers: TT_WordArray;
568
 
    Strings: TT_PCharArray;
569
 
  end;
570
 
 
571
 
  Terminal_ptr4 = ^Terminal4;
572
 
  Terminal4 = record
573
 
    TType: TermType4;
574
 
    FileDes: Word;
575
 
    Ottyb, Nttyb: Termios;
576
 
    Pad: longint;
577
 
  end;
578
 
 
579
 
  TermType5 = record
580
 
    Term_Names: PChar;
581
 
    Str_Table: PChar;
582
 
    Booleans: ^TT_BoolArray;
583
 
    Numbers: ^TT_WordArray;
584
 
    Strings: ^TT_PCharArray;
585
 
  end;
586
 
 
587
 
  Terminal_ptr5 = ^Terminal5;
588
 
  Terminal5 = record
589
 
    TType: TermType5;
590
 
    FileDes: Word;
591
 
    Ottyb, Nttyb: Termios;
592
 
    Pad: longint;
593
 
  end;
594
 
 
595
 
  TerminalCommon_ptr1 = ^TerminalCommon1;
596
 
  TerminalCommon1 = record
597
 
    Term_Names: PChar;
598
 
    Str_Table: PChar;
599
 
  end;
600
 
 
601
 
  TerminalCommon_ptr2 = ^TerminalCommon2;
602
 
  TerminalCommon2 = record
603
 
    FileDes: Word;
604
 
    Ottyb, Nttyb: Termios;
605
 
    Pad: longint;
606
 
  end;
607
 
 
608
 
  WriterFunc = function (P: PChar): Longint;
609
 
 
610
 
var
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;
616
 
 
617
 
const
618
 
  cur_term_valid : boolean = false;
619
 
 
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;
626
 
 
627
 
{ sets whether to use environment variables for LINES and COLUMNS }
628
 
procedure use_env(B: Longint);cdecl;
629
 
 
630
 
function putp(Ndx: Longint): Longint;
631
 
 
632
 
{ this function must be called before any terminal properties are accessed }
633
 
function setupterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint;
634
 
 
635
 
{ reinitialize lib }
636
 
function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint;cdecl;
637
 
 
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;
649
 
 
650
 
implementation
651
 
 
652
 
uses
653
 
  Linux;
654
 
 
655
 
function putp(Ndx: Longint): Longint;
656
 
var
657
 
  P: PChar;
658
 
begin
659
 
  if not assigned(cur_term) then
660
 
    RunError(219);
661
 
  P := cur_term_strings^[Ndx];
662
 
  putp := fdWrite(cur_term_common^.filedes, P^, StrLen(P));
663
 
end;
664
 
 
665
 
function tputs(Ndx: Word; L1: Longint; F: WriterFunc): Longint;
666
 
var
667
 
  P: PChar;
668
 
begin
669
 
  if not assigned(cur_term) then
670
 
    RunError(219);
671
 
  { L1 := L1; why was this here ?? PM }
672
 
  P := cur_term_strings^[Ndx];
673
 
  tputs := F(P);
674
 
end;
675
 
 
676
 
function set_curterm(term: TerminalCommon_ptr1): TerminalCommon_ptr1; cdecl; external;
677
 
 
678
 
procedure use_env(B: Longint); cdecl; external;
679
 
 
680
 
function restartterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external;
681
 
 
682
 
function setuptermC(Term: PChar; fd: Longint; var ErrCode: Longint): Longint; cdecl; external name 'setupterm';
683
 
 
684
 
function setupterm(Term: PChar; fd: Longint; var ErrCode: Longint): Longint;
685
 
var
686
 
  versioncheck: longint;
687
 
begin
688
 
  setupterm := setuptermC(term,fd,errcode);
689
 
  if not assigned(cur_term) then
690
 
    exit;
691
 
  cur_term_valid := true;
692
 
  versioncheck := 0;
693
 
  repeat
694
 
    if (Terminal_ptr4(cur_term)^.ttype.Booleans[versioncheck] in [false,true]) then
695
 
      inc(versioncheck)
696
 
    else versioncheck := -1;
697
 
  until (versioncheck = BoolCount) or
698
 
        (versioncheck = -1);
699
 
  if versioncheck = BoolCount then
700
 
    { version 4.x }
701
 
    begin
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);
706
 
    end
707
 
  else
708
 
    { assume 5.x or higher }
709
 
    begin
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);
714
 
    end;
715
 
end;
716
 
 
717
 
function del_curtermC(term: TerminalCommon_ptr1): Longint; cdecl; external name 'del_curterm';
718
 
 
719
 
function del_curterm(term: TerminalCommon_ptr1): Longint;
720
 
var
721
 
  reset_cur_term : boolean;
722
 
begin
723
 
  if term=cur_term then
724
 
    begin
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;
730
 
    end
731
 
  else
732
 
    reset_cur_term := false;
733
 
  del_curterm := del_curtermC(term);
734
 
  if reset_cur_term then
735
 
    cur_term_valid := false;
736
 
end;
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;}
747
 
 
748
 
end.
749
 
{
750
 
  $Log: terminfo.pas,v $
751
 
  Revision 1.1.2.1  2000/10/25 12:23:20  marco
752
 
   * Linux dir split up
753
 
 
754
 
  Revision 1.1.2.3  2000/10/09 16:29:14  pierre
755
 
   * more linux terminal fixes
756
 
 
757
 
  Revision 1.1.2.2  2000/08/02 12:30:36  jonas
758
 
    * improved version check *slightly*
759
 
 
760
 
  Revision 1.1  2000/07/13 06:29:39  michael
761
 
  + Initial import
762
 
 
763
 
  Revision 1.2  2000/06/30 12:28:57  jonas
764
 
    * fixed termtype structure
765
 
 
766
 
  Revision 1.1  2000/01/06 01:20:31  peter
767
 
    * moved out of packages/ back to topdir
768
 
 
769
 
  Revision 1.1  1999/11/24 23:36:38  peter
770
 
    * moved to packages dir
771
 
 
772
 
  Revision 1.3  1999/04/22 14:48:27  peter
773
 
    * remove asm
774
 
 
775
 
  Revision 1.2  1998/12/07 12:25:51  peter
776
 
    * link with ncurses which is more available the curses
777
 
 
778
 
  Revision 1.1  1998/12/04 12:48:30  peter
779
 
    * moved some dirs
780
 
 
781
 
  Revision 1.1  1998/10/26 11:31:47  peter
782
 
    + inital include files
783
 
 
784
 
  Revision 1.3  1998/10/26 09:36:26  peter
785
 
    * fixed cdecl
786
 
 
787
 
  Revision 1.2  1998/07/29 20:17:47  bazsi
788
 
  some updates to Video, it now uses terminfo. Some modifications for FreeVision.
789
 
 
790
 
  Revision 1.1  1998/06/13 12:38:54  bazsi
791
 
}
 
 
b'\\ No newline at end of file'