home *** CD-ROM | disk | FTP | other *** search
/ Programmer's ROM - The Computer Language Library / programmersrom.iso / ada / virterm / vt2spec.doc < prev    next >
Encoding:
Text File  |  1988-05-03  |  323.1 KB  |  7,981 lines

  1.  
  2.  
  3.  
  4.                                            |||||||||||||||||||||||||
  5.         THIS IS NOT A DELIVERABLE          |||||||||||||||||||||||||
  6.         THIS IS NOT A DELIVERABLE          |||||||||||||||||||||||||
  7.         THIS IS NOT A DELIVERABLE          |||||||||||||||||||||||||
  8.                                            |||||||||||||||||||||||||
  9.  
  10.                                                 Program Design 
  11.                                               Specification for an
  12.                                               ANSI X3.64 Compatible
  13.                                                 Virtual Terminal
  14.                                                      in Ada
  15.  
  16.         Prepared for:                      |||||||||||||||||||||||||
  17.                                            |||||||||||||||||||||||||
  18.         Advanced Computer Systems Lab      |||||||||||||||||||||||||
  19.         Texas Instruments                  |||||||||||||||||||||||||
  20.                                            |||||||||||||||||||||||||
  21.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  22.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  23.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  24.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  25.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  26.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  27.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  28.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  29.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  30.         THIS IS NOT A DELIVERABLE          |||||||||||||||||||||||||
  31.         THIS IS NOT A DELIVERABLE          |||||||||||||||||||||||||
  32.         THIS IS NOT A DELIVERABLE          |||||||||||||||||||||||||
  33.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  34.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  35.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  36.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  37.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  38.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  39.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  40.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  41.         PRELIMINARY   PRELIMINARY   PRELIMINARY   PRELIMINARY|||||||
  42.                                            |||||||||||||||||||||||||
  43.           Equipment Group - ACSL           |||||||||||||||||||||||||
  44.           P.O. Box 801, M.S. 8007          |||||||||||||||||||||||||
  45.           McKinney, Texas  75069           |||||||||||||||||||||||||
  46.           19-Oct-1984                      |||||||||||||||||||||||||
  47.                                            |||||||||||||||||||||||||
  48.  
  49.                                                TEXAS INSTRUMENTS
  50.                                                   INCORPORATED
  51.  
  52.                                            |||||||||||||||||||||||||
  53.                                            |||||||||||||||||||||||||
  54.                                            |||||||||||||||||||||||||
  55.                                            |||||||||||||||||||||||||
  56.                                            |||||||||||||||||||||||||
  57.  
  58.  
  59. CHAPTER 1       INTRODUCTION
  60.  
  61.         1.1     PURPOSE  . . . . . . . . . . . . . . . . . . . . . 1-1
  62.         1.2     SCOPE  . . . . . . . . . . . . . . . . . . . . . . 1-1
  63.         1.2.1     Summary  . . . . . . . . . . . . . . . . . . . . 1-2
  64.         1.2.1.1     Problem Statement  . . . . . . . . . . . . . . 1-2
  65.         1.2.1.2     Objective  . . . . . . . . . . . . . . . . . . 1-3
  66.         1.2.1.3     Scope  . . . . . . . . . . . . . . . . . . . . 1-3
  67.  
  68.  
  69. CHAPTER 2       APPLICABLE DOCUMENTS
  70.  
  71.         2.1     GOVERNMENT STANDARDS . . . . . . . . . . . . . . . 2-1
  72.         2.2     GOVERNMENT SPECIFICATIONS  . . . . . . . . . . . . 2-1
  73.         2.3     OTHER GOVERNMENT DOCUMENTS . . . . . . . . . . . . 2-3
  74.         2.4     OTHER PUBLICATIONS . . . . . . . . . . . . . . . . 2-3
  75.  
  76.  
  77. CHAPTER 3       REQUIREMENTS
  78.  
  79.         3.1     FUNCTION ALLOCATION  . . . . . . . . . . . . . . . 3-1
  80.         3.1.1     Requirement  . . . . . . . . . . . . . . . . . . 3-1
  81.         3.1.2     Packages Overview  . . . . . . . . . . . . . . . 3-4
  82.         3.2     FUNCTION DESCRIPTION . . . . . . . . . . . . . . . 3-6
  83.         3.2.1     The Virtual Terminal Package . . . . . . . . . . 3-6
  84.         3.2.1.1     Introduction . . . . . . . . . . . . . . . . . 3-6
  85.         3.2.1.2     The Object Name  . . . . . . . . . . . . . . . 3-6
  86.         3.2.1.3     Abstract . . . . . . . . . . . . . . . . . . . 3-6
  87.         3.2.1.4     Parameters . . . . . . . . . . . . . . . . . . 3-6
  88.         3.2.1.5     Local Constants, Types, And Variables  . . . . 3-6
  89.         3.2.1.6     Errors . . . . . . . . . . . . . . . . . . . . 3-6
  90.         3.2.1.7     Exceptions . . . . . . . . . . . . . . . . . . 3-6
  91.         3.2.1.8     The Ada Source . . . . . . . . . . . . . . . . 3-6
  92.         3.2.2     The Scroll Terminal Package  . . . . . . . . .  3-11
  93.         3.2.2.1     Introduction . . . . . . . . . . . . . . . .  3-11
  94.         3.2.2.2     The Object Name  . . . . . . . . . . . . . .  3-11
  95.         3.2.2.3     Abstract . . . . . . . . . . . . . . . . . .  3-11
  96.         3.2.2.4     Parameters . . . . . . . . . . . . . . . . .  3-11
  97.         3.2.2.5     Local Constants, Types, And Variables  . . .  3-11
  98.         3.2.2.6     Selectors (Functions)  . . . . . . . . . . .  3-12
  99.         3.2.2.6.1     Determining The Current Position . . . . .  3-12
  100.         3.2.2.6.2     Determining The Terminal Size  . . . . . .  3-13
  101.         3.2.2.6.3     Determining The Validity Of A Character  .  3-14
  102.         3.2.2.6.4     Getting The Number Of Typed Function/Arrow 
  103.                       Keys . . . . . . . . . . . . . . . . . . .  3-15
  104.         3.2.2.7     Actors (Procedures)  . . . . . . . . . . . .  3-16
  105.         3.2.2.7.1     Opening A Scroll Terminal  . . . . . . . .  3-16
  106.         3.2.2.7.2     Closing A Scroll Terminal  . . . . . . . .  3-18
  107.         3.2.2.7.3     Positioning The Cursor . . . . . . . . . .  3-19
  108.         3.2.2.7.4     Setting A Horizontal Tab Stop  . . . . . .  3-20
  109.         3.2.2.7.5     Clearing A Horizontal Tab Stop . . . . . .  3-21
  110.         3.2.2.7.6     Horizontal Tab . . . . . . . . . . . . . .  3-22
  111.         3.2.2.7.7     Moving To A New Line . . . . . . . . . . .  3-23
  112.         3.2.2.7.8     Moving To A New Page . . . . . . . . . . .  3-24
  113.         3.2.2.7.9     Writing Data To A Terminal . . . . . . . .  3-25
  114.                                                                 Page 2
  115.  
  116.  
  117.         3.2.2.7.10    Updating The Terminal Display Line . . . .  3-26
  118.         3.2.2.7.11    Determining The Validity Of A Character  .  3-27
  119.         3.2.2.7.12    Getting Data From The Keyboard . . . . . .  3-28
  120.         3.2.2.7.13    Getting The Specified Function/Arrow Key 
  121.                       From The List  . . . . . . . . . . . . . .  3-30
  122.         3.2.2.7.14    Getting The Name Of A Function Key . . . .  3-32
  123.         3.2.2.7.15    Ringing The Terminal Bell  . . . . . . . .  3-33
  124.         3.2.2.8     Errors . . . . . . . . . . . . . . . . . . .  3-33
  125.         3.2.2.9     Exceptions . . . . . . . . . . . . . . . . .  3-33
  126.         3.2.2.10    The Ada Source . . . . . . . . . . . . . . .  3-33
  127.         3.2.3     The Page Terminal Package  . . . . . . . . . .  3-35
  128.         3.2.3.1     Introduction . . . . . . . . . . . . . . . .  3-35
  129.         3.2.3.2     The Object Name  . . . . . . . . . . . . . .  3-35
  130.         3.2.3.3     Abstract . . . . . . . . . . . . . . . . . .  3-35
  131.         3.2.3.4     Parameters . . . . . . . . . . . . . . . . .  3-35
  132.         3.2.3.5     Local Constants, Types, And Variables  . . .  3-35
  133.         3.2.3.6     Selectors (Functions)  . . . . . . . . . . .  3-36
  134.         3.2.3.6.1     Determining The Active Position  . . . . .  3-37
  135.         3.2.3.6.2     Determining The Size Of The Display  . . .  3-38
  136.         3.2.3.6.3     Determining The Validity Of A Character  .  3-39
  137.         3.2.3.6.4     Getting The Number Of Typed Function/Arrow 
  138.                       Keys . . . . . . . . . . . . . . . . . . .  3-40
  139.         3.2.3.7     Actors (Procedures)  . . . . . . . . . . . .  3-41
  140.         3.2.3.7.1     Opening A Page Terminal  . . . . . . . . .  3-41
  141.         3.2.3.7.2     Closing A Page Terminal  . . . . . . . . .  3-43
  142.         3.2.3.7.3     Setting The Current Position . . . . . . .  3-44
  143.         3.2.3.7.4     Deleting A Character . . . . . . . . . . .  3-45
  144.         3.2.3.7.5     Deleting A Line  . . . . . . . . . . . . .  3-46
  145.         3.2.3.7.6     Erasing Areas In The Display . . . . . . .  3-47
  146.         3.2.3.7.7     Erasing Areas In Lines . . . . . . . . . .  3-48
  147.         3.2.3.7.8     Entering Insert Character Mode . . . . . .  3-49
  148.         3.2.3.7.9     Exiting Insert Character Mode  . . . . . .  3-50
  149.         3.2.3.7.10    Inserting A Line . . . . . . . . . . . . .  3-51
  150.         3.2.3.7.11    Selecting The Graphic Rendition  . . . . .  3-52
  151.         3.2.3.7.12    Setting A Horizontal Tab . . . . . . . . .  3-53
  152.         3.2.3.7.13    Clearing A Horizontal Tab  . . . . . . . .  3-54
  153.         3.2.3.7.14    Performing A Horizontal Tab  . . . . . . .  3-55
  154.         3.2.3.7.15    Writing Data To The Terminal . . . . . . .  3-56
  155.         3.2.3.7.16    Updating The Screen With Insert/Delete Line 3-57
  156.         3.2.3.7.17    Updating The Screen Without Insert/Delete 
  157.                       Line . . . . . . . . . . . . . . . . . . .  3-58
  158.         3.2.3.7.18    Redrawing The Screen Complete  . . . . . .  3-59
  159.         3.2.3.7.19    Updating A Line  . . . . . . . . . . . . .  3-60
  160.         3.2.3.7.20    Getting Data From The Keyboard . . . . . .  3-61
  161.         3.2.3.7.21    Getting The Specified Function/Arrow Key 
  162.                       From The List  . . . . . . . . . . . . . .  3-63
  163.         3.2.3.7.22    Getting The Name Of A Function Key . . . .  3-65
  164.         3.2.3.7.23    Ringing The Terminal Bell  . . . . . . . .  3-66
  165.         3.2.3.8     Errors . . . . . . . . . . . . . . . . . . .  3-66
  166.         3.2.3.9     Exceptions . . . . . . . . . . . . . . . . .  3-66
  167.         3.2.3.10    The Ada Source . . . . . . . . . . . . . . .  3-66
  168.         3.2.4     The Form Terminal Package  . . . . . . . . . .  3-69
  169.         3.2.4.1     Introduction . . . . . . . . . . . . . . . .  3-69
  170.         3.2.4.2     The Object Name  . . . . . . . . . . . . . .  3-69
  171.         3.2.4.3     Abstract . . . . . . . . . . . . . . . . . .  3-69
  172.                                                                 Page 3
  173.  
  174.  
  175.         3.2.4.4     Parameters . . . . . . . . . . . . . . . . .  3-69
  176.         3.2.4.5     Local Constants, Types, And Variables  . . .  3-69
  177.         3.2.4.6     Selectors (Functions)  . . . . . . . . . . .  3-70
  178.         3.2.4.6.1     Retrieving The Current Position  . . . . .  3-70
  179.         3.2.4.6.2     Determining The Size Of The Display  . . .  3-71
  180.         3.2.4.6.3     Determining The Form Status  . . . . . . .  3-72
  181.         3.2.4.6.4     Determining The Termination Key  . . . . .  3-73
  182.         3.2.4.7     Actors (Procedures)  . . . . . . . . . . . .  3-74
  183.         3.2.4.7.1     Opening A Form Terminal  . . . . . . . . .  3-74
  184.         3.2.4.7.2     Closing A Form Terminal  . . . . . . . . .  3-76
  185.         3.2.4.7.3     Setting The Current Position . . . . . . .  3-77
  186.         3.2.4.7.4     Defining Qualified Areas . . . . . . . . .  3-78
  187.         3.2.4.7.5     Clearing A Qualified Area  . . . . . . . .  3-79
  188.         3.2.4.7.6     Tabbing To The Next Qualified Area . . . .  3-80
  189.         3.2.4.7.7     Writing Data To The Terminal . . . . . . .  3-81
  190.         3.2.4.7.8     Reading Data From Qualified Areas  . . . .  3-82
  191.         3.2.4.7.9     Erasing A Qualified Area . . . . . . . . .  3-83
  192.         3.2.4.7.10    Erasing The Display Screen . . . . . . . .  3-84
  193.         3.2.4.7.11    Activating A Form For Input  . . . . . . .  3-85
  194.         3.2.4.8     Errors . . . . . . . . . . . . . . . . . . .  3-85
  195.         3.2.4.9     Exceptions . . . . . . . . . . . . . . . . .  3-85
  196.         3.2.4.10    The Ada Source . . . . . . . . . . . . . . .  3-85
  197.         3.2.5     The Virtual Terminal Content Package . . . . .  3-87
  198.         3.2.5.1     Introduction . . . . . . . . . . . . . . . .  3-87
  199.         3.2.5.2     The Object Name  . . . . . . . . . . . . . .  3-87
  200.         3.2.5.3     Abstract . . . . . . . . . . . . . . . . . .  3-87
  201.         3.2.5.4     Parameters . . . . . . . . . . . . . . . . .  3-87
  202.         3.2.5.5     Local Constants, Types, And Variables  . . .  3-87
  203.         3.2.5.6     Selectors (Functions)  . . . . . . . . . . .  3-88
  204.         3.2.5.7     Actors (Procedures)  . . . . . . . . . . . .  3-89
  205.         3.2.5.8     Errors . . . . . . . . . . . . . . . . . . .  3-89
  206.         3.2.5.9     Exceptions . . . . . . . . . . . . . . . . .  3-89
  207.         3.2.5.10    The Ada Source . . . . . . . . . . . . . . .  3-89
  208.         3.2.6     The Virtual Terminal Keyboard Input Package  .  3-91
  209.         3.2.6.1     Introduction . . . . . . . . . . . . . . . .  3-91
  210.         3.2.6.2     The Object Name  . . . . . . . . . . . . . .  3-91
  211.         3.2.6.3     Abstract . . . . . . . . . . . . . . . . . .  3-91
  212.         3.2.6.4     Parameters . . . . . . . . . . . . . . . . .  3-91
  213.         3.2.6.5     Local Constants, Types, And Variables  . . .  3-91
  214.         3.2.6.6     Selectors (Functions)  . . . . . . . . . . .  3-92
  215.         3.2.6.6.1     Getting The Number Of Typed Function/Arrow 
  216.                       Keys . . . . . . . . . . . . . . . . . . .  3-92
  217.         3.2.6.7     Actors (Procedures)  . . . . . . . . . . . .  3-93
  218.         3.2.6.7.1     Getting Data From The Keyboard . . . . . .  3-93
  219.         3.2.6.7.2     Getting The Specified Function/Arrow Key 
  220.                       From The List  . . . . . . . . . . . . . .  3-95
  221.         3.2.6.7.3     Getting The Name Of A Function Key . . . .  3-97
  222.         3.2.6.8     Errors . . . . . . . . . . . . . . . . . . .  3-97
  223.         3.2.6.9     Exceptions . . . . . . . . . . . . . . . . .  3-97
  224.         3.2.6.10    The Ada Source . . . . . . . . . . . . . . .  3-98
  225.         3.2.7     The Redisplay Package  . . . . . . . . . . . .  3-99
  226.         3.2.7.1     Introduction . . . . . . . . . . . . . . . .  3-99
  227.         3.2.7.2     The Object Name  . . . . . . . . . . . . . .  3-99
  228.         3.2.7.3     Abstract . . . . . . . . . . . . . . . . . .  3-99
  229.         3.2.7.4     Parameters . . . . . . . . . . . . . . . . .  3-99
  230.                                                                 Page 4
  231.  
  232.  
  233.         3.2.7.5     Local Constants, Types, And Variables  . . .  3-99
  234.         3.2.7.6     Selectors (Functions)  . . . . . . . . . . .  3-99
  235.         3.2.7.7     Actors (Procedures)  . . . . . . . . . . . . 3-100
  236.         3.2.7.7.1     Redisplay_screen_with_movement . . . . . . 3-100
  237.         3.2.7.7.2     Redisplay_screen_with_redraw . . . . . . . 3-101
  238.         3.2.7.7.3     Redisplay_line_with_movement . . . . . . . 3-102
  239.         3.2.7.7.4     Redisplay_line_with_redraw . . . . . . . . 3-103
  240.         3.2.7.7.5     Redraw_screen  . . . . . . . . . . . . . . 3-104
  241.         3.2.7.8     Errors . . . . . . . . . . . . . . . . . . . 3-105
  242.         3.2.7.9     Exceptions . . . . . . . . . . . . . . . . . 3-105
  243.         3.2.7.10    The Ada Source . . . . . . . . . . . . . . . 3-105
  244.         3.2.8     The Driver Package Specification . . . . . . . 3-106
  245.         3.2.8.1     Introduction . . . . . . . . . . . . . . . . 3-106
  246.         3.2.8.2     The Object Name  . . . . . . . . . . . . . . 3-106
  247.         3.2.8.3     Abstract . . . . . . . . . . . . . . . . . . 3-106
  248.         3.2.8.4     Parameters . . . . . . . . . . . . . . . . . 3-106
  249.         3.2.8.5     Local Constants, Types, And Variables  . . . 3-106
  250.         3.2.8.6     Selectors (Functions)  . . . . . . . . . . . 3-106
  251.         3.2.8.7     Actors (Procedures)  . . . . . . . . . . . . 3-107
  252.         3.2.8.7.1     Initializeing The Virtual Terminal . . . . 3-107
  253.         3.2.8.7.2     Closing The Virtual Terminal . . . . . . . 3-109
  254.         3.2.8.7.3     Interpreting ANSI Character Sequences  . . 3-110
  255.         3.2.8.8     Errors . . . . . . . . . . . . . . . . . . . 3-112
  256.         3.2.8.9     Exceptions . . . . . . . . . . . . . . . . . 3-112
  257.         3.2.8.10    The Ada Source . . . . . . . . . . . . . . . 3-112
  258.         3.2.9     The Driver Package Body  . . . . . . . . . . . 3-113
  259.         3.2.9.1     Introduction . . . . . . . . . . . . . . . . 3-113
  260.         3.2.9.2     The Object Name  . . . . . . . . . . . . . . 3-113
  261.         3.2.9.3     Abstract . . . . . . . . . . . . . . . . . . 3-113
  262.         3.2.9.4     Parameters . . . . . . . . . . . . . . . . . 3-113
  263.         3.2.9.5     Local Constants, Types, And Variables  . . . 3-113
  264.         3.2.9.6     Actors (Procedures)  . . . . . . . . . . . . 3-114
  265.         3.2.9.6.1     Erasing To The End Of The Screen . . . . . 3-114
  266.         3.2.9.6.2     Erasing To The End Of A Line . . . . . . . 3-115
  267.         3.2.9.6.3     Moving The Cursor  . . . . . . . . . . . . 3-116
  268.         3.2.9.6.4     Inserting A Line . . . . . . . . . . . . . 3-117
  269.         3.2.9.6.5     Deleting A Line  . . . . . . . . . . . . . 3-118
  270.         3.2.9.6.6     Deleting A Character . . . . . . . . . . . 3-119
  271.         3.2.9.6.7     Procedure Beep . . . . . . . . . . . . . . 3-120
  272.         3.2.9.6.8     Writing Data To The Actual Terminal  . . . 3-121
  273.         3.2.9.6.9     Moving The Cursor To A New Line  . . . . . 3-122
  274.         3.2.9.6.10    Turning On Highlighting  . . . . . . . . . 3-123
  275.         3.2.9.6.11    Turning Off Highlighting . . . . . . . . . 3-124
  276.         3.2.9.6.12    Entering Character Insert Mode . . . . . . 3-125
  277.         3.2.9.6.13    Exiting Character Insert Mode  . . . . . . 3-126
  278.         3.2.9.6.14    Scrolling The Actual Display Up  . . . . . 3-127
  279.         3.2.9.6.15    Scrolling The Actual Display Down  . . . . 3-128
  280.         3.2.9.7     Errors . . . . . . . . . . . . . . . . . . . 3-128
  281.         3.2.9.8     Exceptions . . . . . . . . . . . . . . . . . 3-128
  282.         3.2.9.9     The Ada Source . . . . . . . . . . . . . . . 3-128
  283.         3.2.10    The TCF Package  . . . . . . . . . . . . . . . 3-130
  284.         3.2.10.1    Introduction . . . . . . . . . . . . . . . . 3-130
  285.         3.2.10.2    Abstract . . . . . . . . . . . . . . . . . . 3-130
  286.         3.2.10.3    Parameters . . . . . . . . . . . . . . . . . 3-130
  287.         3.2.10.4    Local Constants, Types, And Variables  . . . 3-130
  288.                                                                 Page 5
  289.  
  290.  
  291.         3.2.10.5    Selectors (Functions)  . . . . . . . . . . . 3-131
  292.         3.2.10.6    Actors (Procedures)  . . . . . . . . . . . . 3-131
  293.         3.2.10.6.1    Initialize The Terminal Capabilities File  3-132
  294.         3.2.10.7    Errors . . . . . . . . . . . . . . . . . . . 3-133
  295.         3.2.10.8    Exceptions . . . . . . . . . . . . . . . . . 3-133
  296.         3.2.10.9    The Ada Source . . . . . . . . . . . . . . . 3-133
  297.         3.2.11    The System Dependent Package SYSDEP  . . . . . 3-136
  298.         3.2.11.1    Introduction . . . . . . . . . . . . . . . . 3-136
  299.         3.2.11.2    The Object Name  . . . . . . . . . . . . . . 3-136
  300.         3.2.11.3    Abstract . . . . . . . . . . . . . . . . . . 3-136
  301.         3.2.11.4    Selectors (Functions)  . . . . . . . . . . . 3-137
  302.         3.2.11.4.1    Determining The Validity Of A Character  . 3-137
  303.         3.2.11.5    Actors (Procedures)  . . . . . . . . . . . . 3-138
  304.         3.2.11.5.1    Opening The Physical Terminal  . . . . . . 3-138
  305.         3.2.11.5.2    Closing The Physical Terminal  . . . . . . 3-139
  306.         3.2.11.5.3    Writing Data To The Physical Terminal  . . 3-140
  307.         3.2.11.5.4    Reading Data From The Terminal Keyboard  . 3-141
  308.         3.2.11.5.5    Retrieving The TCF Name  . . . . . . . . . 3-142
  309.         3.2.11.5.6    Retrieving The Terminal's Name . . . . . . 3-143
  310.         3.2.11.6    Errors . . . . . . . . . . . . . . . . . . . 3-143
  311.         3.2.11.7    Exceptions . . . . . . . . . . . . . . . . . 3-143
  312.         3.2.11.8    The Ada Source . . . . . . . . . . . . . . . 3-143
  313.         3.3     STORAGE AND PROCESSING ALLOCATION  . . . . . . . 3-145
  314.         3.4     PROGRAM FUNCTIONAL FLOW CONTROL  . . . . . . . . 3-145
  315.         3.4.1     General  . . . . . . . . . . . . . . . . . . . 3-145
  316.         3.4.2     Keyboard Data  . . . . . . . . . . . . . . . . 3-145
  317.         3.4.3     User Program Generated Data  . . . . . . . . . 3-146
  318.         3.4.4     Program Interrupt Control  . . . . . . . . . . 3-148
  319.         3.4.5     Subprogram Reference Control . . . . . . . . . 3-148
  320.         3.4.6     Special Control Features . . . . . . . . . . . 3-148
  321.         3.5     PROGRAMMING GUIDELINES . . . . . . . . . . . . . 3-149
  322.         3.5.1     Development Environment  . . . . . . . . . . . 3-149
  323.         3.5.2     Ada Programming Standards  . . . . . . . . . . 3-149
  324.         3.5.2.1     Introduction . . . . . . . . . . . . . . . . 3-149
  325.         3.5.2.2     Prologue Documentation . . . . . . . . . . . 3-149
  326.         3.5.2.3     Naming Conventions . . . . . . . . . . . . . 3-151
  327.         3.5.2.4     Declarations Usage . . . . . . . . . . . . . 3-152
  328.         3.5.2.4.1     Commenting Declarations  . . . . . . . . . 3-152
  329.         3.5.2.4.2     Declaration Formatting . . . . . . . . . . 3-152
  330.         3.5.2.4.3     Use Of Constants . . . . . . . . . . . . . 3-154
  331.         3.5.2.4.4     Strong Typing  . . . . . . . . . . . . . . 3-155
  332.         3.5.2.5     Coding Conventions . . . . . . . . . . . . . 3-156
  333.         3.5.2.5.1     Attributes . . . . . . . . . . . . . . . . 3-156
  334.         3.5.2.5.2     Upper/Lower Case Usage . . . . . . . . . . 3-156
  335.         3.5.2.5.3     Statement Formatting For Readability . . . 3-156
  336.         3.5.2.5.4     Subprogram Usage And Formatting  . . . . . 3-159
  337.         3.5.2.5.5     Packages, Tasks And Generics . . . . . . . 3-161
  338.         3.5.2.5.6     Complex Expressions  . . . . . . . . . . . 3-162
  339.         3.5.2.5.7     Labels And GOTOs . . . . . . . . . . . . . 3-162
  340.         3.5.2.5.8     Task Termination . . . . . . . . . . . . . 3-162
  341.         3.5.2.5.9     Exceptions . . . . . . . . . . . . . . . . 3-162
  342.         3.5.3     Program Version Identification And CM  . . . . 3-164
  343.                                                                 Page 6
  344.  
  345.  
  346. CHAPTER 4       QUALITY ASSURANCE
  347.  
  348.  
  349. CHAPTER 5       NOTES
  350.  
  351.  
  352. APPENDIX A      THE TERMINAL CAPABILITIES FILE (TCF)
  353.  
  354.         A.1     INTRODUCTION . . . . . . . . . . . . . . . . . . . A-1
  355.         A.2     CAPABILITIES . . . . . . . . . . . . . . . . . . . A-1
  356.         A.2.1     Basic Capabilities . . . . . . . . . . . . . . . A-4
  357.         A.2.2     Cursor Addressing  . . . . . . . . . . . . . . . A-4
  358.         A.2.3     Area Clears  . . . . . . . . . . . . . . . . . . A-5
  359.         A.2.4     Insert/Delete Line . . . . . . . . . . . . . . . A-5
  360.         A.2.5     Insert/Delete Character  . . . . . . . . . . . . A-5
  361.         A.2.6     Highlighting, Underlining, And Visible Bells . . A-6
  362.         A.2.7     Function Keys  . . . . . . . . . . . . . . . . . A-6
  363.         A.2.8     Initialization . . . . . . . . . . . . . . . . . A-6
  364.  
  365.  
  366. APPENDIX B      THE RECOGNIZED ANSI X3.64 SEQUENCES
  367.  
  368.  
  369. APPENDIX C      APSE DEPENDENCIES
  370.  
  371.         C.1     INTEROPERABILITY AND TRANSPORTABILITY  . . . . . . C-1
  372.         C.1.1     Terminal Communications  . . . . . . . . . . . . C-1
  373.  
  374.  
  375. APPENDIX D      GLOSSARY
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.                                  CHAPTER 1
  389.  
  390.                                 INTRODUCTION
  391.  
  392.  
  393.  
  394.       1.1  PURPOSE
  395.  
  396.       This program design specification presents the detailed design of  the
  397.       ANSI compatible Virtual Terminal.  It also establishes the programming
  398.       guidelines and quality assurance provisions.
  399.  
  400.       1.2  SCOPE
  401.  
  402.       This document presents the complete design specification for the  ANSI
  403.       compatible Virtual Terminal.  The design specification consists of:
  404.  
  405.       1.  a cross reference of the  requirements  as  defined  in  the  ANSI
  406.           compatible   Virtual   Terminal   proposal  with  the  appropriate
  407.           paragraph and sub-paragraph within this document,
  408.  
  409.       2.  a complete functional description of each program unit within  the
  410.           ANSI  compatible  Virtual  Terminal.   For  each  program unit the
  411.           following information is supplied (where applicable):
  412.  
  413.           a.  an introduction,
  414.  
  415.           b.  the name,
  416.  
  417.           c.  an abstract,
  418.  
  419.           d.  the input and output parameters,
  420.  
  421.           e.  the local variables, types, and constants,
  422.  
  423.           f.  the selector functions,
  424.  
  425.           g.  the actor procedures,
  426.  
  427.           h.  a complete description  of  the  possible  errors  that  could
  428.               occur,  (including  a  semantic  description of the conditions
  429.               which raise any exceptions),
  430.  
  431.           i.  the exceptions raised and handled, and  the  semantic  actions
  432.               associated with them, (exceptions are not used exclusively for
  433.               error handling;  the semantics associated with those that have
  434. INTRODUCTION                                                        Page 1-2
  435. SCOPE                                                              16 Nov 84
  436.  
  437.  
  438.               other functionality are described here),
  439.  
  440.           j.  the Ada source code specification for the module.
  441.  
  442.           The local variables  and  types,  selector  functions,  and  actor
  443.           procedures  are only included in the package specifications.  They
  444.           are not applicable for the procedures, tasks and functions in  the
  445.           packages, as these are implementation details.
  446.  
  447.       3.  the syntax and semantics of all the  user  interfaces  within  the
  448.           ANSI compatible Virtual Terminal,
  449.  
  450.       4.  a complete definition of all the data and file structures that the
  451.           ANSI   compatible   Virtual  Terminal  creates  and  uses  in  its
  452.           functioning,
  453.  
  454.       5.  programming guidelines,
  455.  
  456.       6.  quality assurance.
  457.  
  458.  
  459.  
  460.       1.2.1  Summary
  461.  
  462.       1.2.1.1  Problem Statement -
  463.  
  464.       The character-imaging  computer  terminal,  consisting  of  a  display
  465.       device  and  keyboard,  is the most widely used means of communicating
  466.       with computer systems.   Even  now,  with  relatively  well  developed
  467.       techniques  for  device independence, programs tend to be targeted for
  468.       either specific character-imaging computer terminals or a  very  small
  469.       subset   of   character-imaging   computer   terminals.    A  complete
  470.       intermediate-level  virtualization  of  a  character-imaging  computer
  471.       terminal  will  promote  program transportability, high level terminal
  472.       abstractions, and maximum flexibility for  a  tool  writer.   If  this
  473.       intermediate-level virtualization conforms to an existing standard for
  474.       the device characteristics of the character-imaging computer  terminal
  475.       (ANSI  X3.64-1979),  there  will  be  many  advantageous  side-effects
  476.       [FRE83 ]:
  477.  
  478.       1.  The   virtualization   will   closely   match    the    functional
  479.           characteristics  of  the  conforming  character  imaging  computer
  480.           terminals,
  481.  
  482.       2.  the virtualization will be more widely accepted,
  483.  
  484.       3.  device independence can be promoted,
  485.  
  486.       4.  upward-compatibility  of  the  virtualization  will  more  closely
  487.           follow the upward-compatibility of the standard.
  488.  
  489. INTRODUCTION                                                        Page 1-3
  490. Objective                                                          16 Nov 84
  491.  
  492.  
  493.       1.2.1.2  Objective -
  494.  
  495.       The objectives  in  implementing  an  ANSI  X3.64  compatible  virtual
  496.       terminal in Ada are:
  497.  
  498.       1.  provide an interface to the terminal that is device independent,
  499.  
  500.       2.  enhance transportability of  application  programs  that  use  the
  501.           virtual terminal,
  502.  
  503.       3.  promote upward compatibility with the acknowledged standard as  it
  504.           is extended to cover advances in terminal hardware,
  505.  
  506.       4.  provide the tool- and application-writer with an extensive set  of
  507.           terminal  control  functions  that  closely  match  the functional
  508.           characteristics of most computers terminals on the market,
  509.  
  510.       5.  provide a level of interface to support the  interception  of  the
  511.           flow of characters to and from the computer terminal
  512.  
  513.       6.  provide valuable feedback concerning the CAIS V1.1 Section 7.1.
  514.  
  515.  
  516.       1.2.1.3  Scope -
  517.  
  518.       This virtual terminal will use  the  CAIS  V1.1  Section  7.1  as  the
  519.       framework for the design.
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.                                  CHAPTER 2
  532.  
  533.                             APPLICABLE DOCUMENTS
  534.  
  535.  
  536.  
  537.       2.1  GOVERNMENT STANDARDS
  538.  
  539.       The following documents of the exact issue shown form a part  of  this
  540.       specification  to  the  extent  specified  herein.   In  the  event of
  541.       conflict between the documents referenced herein and the  contents  of
  542.       this  specification,  the  contents  of  this  specification  shall be
  543.       considered a superceding requirement.
  544.  
  545.           [DOD83 ]  United States Department of Defense,  "Reference  Manual
  546.                     for   the   Ada   Programming  Language  Draft,  Revised
  547.                     MIL-STD-1815A," February 1983.
  548.  
  549.           [NAVY78]  Navy,  "Weapon   System   Software   Development,   Navy
  550.                     MIL-STD-1679," December 1978.
  551.  
  552.           [NAVY80]  Navy,   "Data   Item   Description,    Program    Design
  553.                     Specification, Navy DI-E-2138," November 1978.
  554.  
  555.           [USAF76]  Data  Item  Description  DI-E-30112   (USAF),   Computer
  556.                     Program Listings, 10 March 1976.
  557.  
  558.  
  559.       2.2  GOVERNMENT SPECIFICATIONS
  560.  
  561.       The following documents of the exact issue shown form a part  of  this
  562.       specification  to  the  extent  specified  herein.   In  the  event of
  563.       conflict between the document referenced herein and  the  contents  of
  564.       this  specification,  the  contents  of  this  specification  shall be
  565.       considered a superceding requirement.
  566.  
  567.           [INT81A]  Intermetrics   Inc.,   "Draft    IR-676    Ada    System
  568.                     Specification  for  Ada  Integrated Environment Type A,"
  569.                     Wakefield, MA, March 1981.
  570.  
  571.           [INT81B]  Intermetrics  Inc.,  "Draft  IR-677   Computer   Program
  572.                     Development    Specification    for    Ada    Integrated
  573.                     Environment:  Ada Compiler Phases Type  B5,"  Wakefield,
  574.                     MA, March 1981.
  575. APPLICABLE DOCUMENTS                                                Page 2-2
  576. GOVERNMENT SPECIFICATIONS                                          16 Nov 84
  577.  
  578.  
  579.           [INT81C]  Intermetrics  Inc.,  "Draft  IR-678   Computer   Program
  580.                     Development    Specification    for    Ada    Integrated
  581.                     Environment:  KAPSE/Database Type  B5,"  Wakefield,  MA,
  582.                     March 1981.
  583.  
  584.           [INT81D]  Intermetrics  Inc.,  "Draft  IR-679   Computer   Program
  585.                     Development    Specification    for    Ada    Integrated
  586.                     Environment:   MAPSE   Command   Processor   Type   B5,"
  587.                     Wakefield, MA, March 1981.
  588.  
  589.           [INT81E]  Intermetrics  Inc.,  "Draft  IR-680   Computer   Program
  590.                     Development    Specification    for    Ada    Integrated
  591.                     Environment:  MAPSE Generation  and  Support  Type  B5,"
  592.                     Wakefield, MA, March 1981.
  593.  
  594.           [INT81F]  Intermetrics  Inc.,  "Draft  IR-681   Computer   Program
  595.                     Development    Specification    for    Ada    Integrated
  596.                     Environment:  Program Integration Facilities  Type  B5,"
  597.                     Wakefield, MA, March 1981.
  598.  
  599.           [INT81G]  Intermetrics  Inc.,  "Draft  IR-682   Computer   Program
  600.                     Development    Specification    for    Ada    Integrated
  601.                     Environment:   MAPSE  Debugging  Facilities  Type   B5,"
  602.                     Wakefield, MA, March 1981.
  603.  
  604.           [INT81H]  Intermetrics  Inc,  "Draft   IR-683   Computer   Program
  605.                     Development    Specification    for    Ada    Integrated
  606.                     Environment:  MAPSE Text Editor Type B5," Wakefield, MA,
  607.                     March 1981.
  608.  
  609.           [INT81J]  Intermetrics Inc., "IR-684  Ada  Integrated  Environment
  610.                     (AIE)  Design  Rational:   Technical  Report (Interim),"
  611.                     Wakefield, MA, March 1981.
  612.  
  613.           [INT82 ]  Intermetrics   Inc.,    "IR-678-1    Computer    Program
  614.                     Development    Specification    for    Ada    Integrated
  615.                     Environment:  KAPSE/Database Type  B5,"  Wakefield,  MA,
  616.                     June 1982.
  617.  
  618.           [SOF81A]  SofTech Inc., "Draft Ada Language System Specification,"
  619.                     Waltham, MA, June 1981.
  620.  
  621.           [SOF81B]  SofTech Inc.,  "Draft  Ada  Language  System  VAX-11/780
  622.                     VAX/VMS   Runtime  Support  Library  B5  Specification,"
  623.                     Waltham, MA, July 1981.
  624.  
  625.           [SOF81C]  SofTech Inc., "Preliminary  Draft  Ada  Language  System
  626.                     KAPSE B5 Specification," Waltham, MA, August 1981.
  627.  
  628.           [SOF82 ]  SofTech Inc., "Draft Ada Language System Specification,"
  629.                     Waltham, MA, August 1982.
  630.  
  631. APPLICABLE DOCUMENTS                                                Page 2-3
  632. OTHER GOVERNMENT DOCUMENTS                                         16 Nov 84
  633.  
  634.  
  635.       2.3  OTHER GOVERNMENT DOCUMENTS
  636.  
  637.       The following documents of the latest issue per date of this PDS  form
  638.       a  part  of  this specification.  In the event of conflict between the
  639.       document referenced herein and the contents of this specification, the
  640.       contents  of  this  specification  shall  be  considered a superceding
  641.       requirement.
  642.  
  643.           [TI82  ]  Texas Instruments,  "Proposal  for  Development  of  Ada
  644.                     Software Tools and Interface Standards," Lewisville, TX,
  645.                     February 1982.
  646.  
  647.           [TI83A ]  Texas    Instruments,    "AIM    Program     Performance
  648.                     Specification," Lewisville, TX, 18 May 1983.
  649.  
  650.           [TI83B ]  Texas Instruments, "APSE  Interactive  Monitor - Interim
  651.                     Report  on  Interface  Analysis and Software Engineering
  652.                     Techniques," Lewisville, TX, 16 May 1983.
  653.  
  654.           [TI83C ]  Texas       Instruments,        "APSE        Interactive
  655.                     Monitor  (AIM) Acceptance     Test    Plan",    Contract
  656.                     N66001-82-C-0440, July 1983.
  657.  
  658.           [TI83D ]  Texas       Instruments,        "APSE        Interactive
  659.                     Monitor  (AIM) Computer   Program  Test  Specification",
  660.                     Contract N66001-82-C-0440, July 1983.
  661.  
  662.           [TI83E ]  Texas       Instruments,        "APSE        Interactive
  663.                     Monitor  (AIM) Acceptance   Test  Procedures",  Contract
  664.                     N66001-82-C-0440, July 1983.
  665.  
  666.           [TI83F ]  Texas Instruments, "Software Quality Assurance Plan  for
  667.                     APSE Interactive Monitor Program", 28 March 1983.
  668.  
  669.           [TI83G ]  Texas       Instruments,        "APSE        Interactive
  670.                     Monitor  (AIM) Configuration  Management Plan", 28 March
  671.                     1983.
  672.  
  673.  
  674.       2.4  OTHER PUBLICATIONS
  675.  
  676.           [ABB82 ]  Abbott, Russ, "Ada Style Guide (draft)," January 1982.
  677.  
  678.           [AKIN81]  Akin, T. Allen, "Virtual  Terminal  Handler  Preliminary
  679.                     Quick  Reference,"  School  of  Information and Computer
  680.                     Science, Georgia Institute of Technology, April 1981.
  681.  
  682.           [AND82 ]  Anderson, Peter J., "A Design Language  Based  On  Ada,"
  683.                     School  of  Computer  Science  and Technology, Rochester
  684.                     Institute of Technology, September 1982.
  685. APPLICABLE DOCUMENTS                                                Page 2-4
  686. OTHER PUBLICATIONS                                                 16 Nov 84
  687.  
  688.  
  689.           [ANSI73]  American   National   Standards   Institute,   "American
  690.                     National  Standard Graphic Representation of the Control
  691.                     Characters  of  American  National  Standard  Code   for
  692.                     Information  Interchange  (ANSI  Standard  X3.32-1973),"
  693.                     July 1973.
  694.  
  695.           [ANSI74]  American   National   Standards   Institute,   "American
  696.                     National Standard Code Extension Techniques for Use with
  697.                     the 7-Bit  Coded  Character  Set  of  American  National
  698.                     Standard Code for Information Interchange (ANSI Standard
  699.                     X3.41-1974)," May 1974.
  700.  
  701.           [ANSI77]  American National Standards Institute, American National
  702.                     Standard Code for Information Interchange (ANSI Standard
  703.                     X3.4-1977)," June 1977.
  704.  
  705.           [ANSI79]  American   National   Standards   Institute,   "American
  706.                     National  Standard  Additional  Controls  for  Use  with
  707.                     American  National   Standard   Code   for   Information
  708.                     Interchange (ANSI Standard X3.64-1979)," July 1979.
  709.  
  710.           [APSE82]  "Working Paper:   Ada  Programming  Support  Environment
  711.                     (APSE)    Requirements    for    Interoperability    and
  712.                     Transportability  and  Design  Criteria   for   Standard
  713.                     Interface Specifications," Not Approved, October 1982.
  714.  
  715.           [ARPA1 ]  ARPANET communication between  John  Foreman  and  Grady
  716.                     Booch,  Subject:   Review  of Ada programming standards,
  717.                     May 10, 1983.
  718.  
  719.           [ARPA2 ]  ARPANET communication between  John  Foreman  and  Grady
  720.                     Booch,  Subject:   Discussion  of  using  attributes and
  721.                     constants, May 11, 1983.
  722.  
  723.           [ARPA3 ]  ARPANET communication between  John  Foreman  and  Grady
  724.                     Booch,  Subject:   Discussion  of  using  attributes and
  725.                     constants, May 11, 1983.
  726.  
  727.           [ARPA4 ]  ARPANET communication  between  John  Foreman  and  John
  728.                     Bailey,  Subject:   Review of Ada programming standards,
  729.                     May 13, 1983.
  730.  
  731.           [ARPA5 ]  ARPANET communication between  John  Foreman  and  Grady
  732.                     Booch,  Subject:   Discussion of return statement usage,
  733.                     May 16, 1983.
  734.  
  735.           [ARPA6 ]  ARPANET communication between  John  Foreman  and  Grady
  736.                     Booch, Subject:  Error in text, page 270, May 10, 1983.
  737.  
  738.           [BALL81]  Ball, J. Eugene, "Canvass:  The Spice Graphics  Package"
  739.                     (Spice   Document  s108),  Carnegie  Mellon  University,
  740.                     Department of Computer Science, August 1981.
  741. APPLICABLE DOCUMENTS                                                Page 2-5
  742. OTHER PUBLICATIONS                                                 16 Nov 84
  743.  
  744.  
  745.           [BOO83 ]  Booch,   Grady,   Software   Engineering    With    Ada,
  746.                     Benjamin/Cummings  Publishing  Co, Inc.  Menlo Park, Ca,
  747.                     1983.
  748.  
  749.           [CSC82A]  Computer Sciences Corporation, "Configuration Management
  750.                     System   Program   Performance  Specification  ,"  Falls
  751.                     Church, VA, 8 December 1982.  Prepared for  Naval  Ocean
  752.                     Systems Center under contract  N00123-80-D-0364.
  753.  
  754.           [CSC82B]  Computer Sciences Corporation, "Configuration Management
  755.                     System  Interim  Report  on  Interface  Analysis," Falls
  756.                     Church, VA,  August  1982.   Prepared  for  Naval  Ocean
  757.                     Systems Center under contract  N00123-80-D-0364.
  758.  
  759.           [DEC82 ]  Digital   Equipment   Corporation,   "VAX-11   Utilities
  760.                     Reference  Manual  -  Help  Libraries", Maynard, MA, May
  761.                     1982.
  762.  
  763.           [FORE83]  Foreman, John, "COBOL Programming Standards", University
  764.                     of Dallas Graduate School of Management, Feb 1983.
  765.  
  766.           [FRA   ]  Franck, R., "Design  and  Implementation  of  a  Virtual
  767.                     Terminal for a Real-time Application System"
  768.  
  769.           [FRE83 ]  Freedman, Roy S., "Of Mice  and  CLP's",  KITIA  Working
  770.                     Group 1 Working Paper, April 1983
  771.  
  772.           [GAR83 ]  Gargaro,  Anthony,  "Program  Invocation  and  Control",
  773.                     KITIA  Working  Group  1  Interim  Technical Note, April
  774.                     1983.
  775.  
  776.           [GREN80]  Greninger, Lars and Roberts, Roger, "Considerations  for
  777.                     a  Local  Virtual Terminal Interface," Presented at IEEE
  778.                     Conference, September 1980.
  779.  
  780.           [HON82A]  Honeywell Information Systems Inc., Multics Programmers'
  781.                     Manual -- Communications Input/Output, July 1982.
  782.  
  783.           [HON82B]  Honeywell  Information  Systems   Inc.,   Multics   Menu
  784.                     Creation Facilities, February 1983.
  785.  
  786.           [HON83 ]  Honeywell    Information    Systems    Inc.,     Multics
  787.                     Administrators' Manual -- Communications, February 1983.
  788.  
  789.           [INT83 ]  Ada Style Manual, Intellimac, Inc, January 1983.
  790.  
  791.           [INTR82]  Intermetrics  IR-696-2,  pp.82-86,  Intermetrics,   Inc,
  792.                     Cambridge, Mass, November 12, 1982.
  793.  
  794.           [ISO642]  International Standards Organization,  Standard  number:
  795.                     ISO DP 6429, "Additional Control Functions for Character
  796.                     Imaging Devices (Draft)," Not approved, April 1982.
  797. APPLICABLE DOCUMENTS                                                Page 2-6
  798. OTHER PUBLICATIONS                                                 16 Nov 84
  799.  
  800.  
  801.           [JOY81 ]  Joy, W.  and Horton, M.,  "TERMCAP,"  UNIX  Programmer's                                                          ____  ____________
  802.                     Manual, Seventh Edition, Berkley release 4.1, June 1981.                    ______
  803.  
  804.           [KARL81]  Winterstein, Persch,  Drossopoulou,  and  Dausmann,  Ada
  805.                     Documentation  and Programming Guidelines, University of
  806.                     Karlsruhe, Federal Republic of Germany, Sept 1981.
  807.  
  808.           [KRA81 ]  Krasner,  Glenn,  "The  Smalltalk-80  Virtual  Machine,"
  809.                     Byte, August 1981.                    ____
  810.  
  811.           [LAN79 ]  Lantz, Keith  and  Rashid,  Richard,  "Virtual  Terminal
  812.                     Management   in   a   Multiple   Process   Environment,"
  813.                     Proceedings  of  the  Seventh  Symposium  on   Operating
  814.                     Systems (ACM), December 1979.
  815.  
  816.           [LDI81 ]  London Department of Industry, "Report on the  Study  of
  817.                     an  Ada  Based  System Development Methodology," London,
  818.                     1981.
  819.  
  820.           [MAG79 ]  Magnee, F., Endrizzi, A.,  and  Day,  J,  "A  Survey  of
  821.                     Terminal   Protocols,"   Computer   Networks,  1979,  pp                                             ________   ________
  822.                     299-314.
  823.  
  824.           [MEY81 ]  Meyrowitz, Norman  and  Moser,  Margaret,  "Bruwin:   An
  825.                     Adaptable  Design  Strategy  for  Window Manager/Virtual
  826.                     Terminal Systems," Department of Computer Science, Brown
  827.                     University, December 1981.
  828.  
  829.           [NOT   ]  Notkin,   David S.,   Habermann,   A. Nico,    "Software
  830.                     Development  Environment  Issues  as  Related  to  Ada,"
  831.                     Department   of   Computer   Science,    Carnegie-Mellon
  832.                     University.
  833.  
  834.           [SCH78 ]  Schicker, P.  and  Duenki,  A.,  "The  Virtual  Terminal
  835.                     Definition," Computer Networks, 1978, pp 429-441.                                 ________ ________
  836.  
  837.           [STA82 ]  Standish, Thomas A., "A Philosophy for a Tool  Extension
  838.                     Paradigm   (Preliminary   Position  Paper)"  Programming
  839.                     Environment  Project,   Computer   Science   Department,
  840.                     University of California, Irvine, CA
  841.  
  842.           [STE81 ]  Stenning,  Vic,  Et  Al.,  "The  Ada   Environment:    A
  843.                     Perspective,"  Computer, Volume 14, number 6, June 1981,                                   ________
  844.                     pp 26-34, 36.
  845.  
  846.           [SUK81 ]  Sukamar, Srinivas  and  Wiese,  John  D,  "Hardware  and
  847.                     Firmware  Support  for  Four  Virtual  Terminals  in One
  848.                     Display Station," Hewlett-Packard Journal, March 1981.                                      _______________ _______
  849.  
  850.           [TAF82 ]  Taft, S. Tucker, "Portability and Extensibility  in  the
  851.                     Kernel   and   Database   of   a   Programming   Support
  852.                     Environment," Intermetrics, March 1982.
  853. APPLICABLE DOCUMENTS                                                Page 2-7
  854. OTHER PUBLICATIONS                                                 16 Nov 84
  855.  
  856.  
  857.           [TAN81 ]  Tanenbaum,  A.S.,  "Computer  Networks,"   Prentice-Hall
  858.                     Inc., Englewood Cliffs, New Jersey, 1981, pp 427- 429.
  859.  
  860.           [TAJ79 ]  Tajima, Takashi and  Katsuyama,  Yoshiki,  "Layered  and
  861.                     Parametric   Approach   to   Terminal   Virtualization,"
  862.                     Presented at International Conference on Communications,
  863.                     Boston, MA, June 1979.
  864.  
  865.           [TI81A ]  Texas   Instruments,   "Ada   Integrated   Environment,"
  866.                     Lewisville,  TX,  March  1981.   Prepared  for  Rome Air
  867.                     Development   Center   (RADC)   under    DoD    Contract
  868.                     F30602-80-C-0293.
  869.  
  870.           [TI81B]   Equipment  Group  Programming  Standards  for   Computer
  871.                     Programs,  Advanced  Computer  Systems Laboratory, Texas
  872.                     Instruments, July 1981.
  873.  
  874.           [THA82 ]  Thall, Richard, "The KAPSE for the Ada Language System,"
  875.                     SofTech  Inc,  Proceedings  of  the Adatec conference on
  876.                     Ada, October 1982.
  877.  
  878.           [WOL81 ]  Wolfe, Martin I., et al.,  "The  Ada  Language  System,"
  879.                     Computer, Volume 14, number 6, June 1981, pp 37-45.                    ________
  880.  
  881.  
  882.  
  883.  
  884.  
  885.  
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.                                  CHAPTER 3
  893.  
  894.                                 REQUIREMENTS
  895.  
  896.  
  897.  
  898.       3.1  FUNCTION ALLOCATION
  899.  
  900.       3.1.1  Requirement
  901.  
  902.       The requirements as specified in the NOSC  Virtual  Terminal  proposal
  903.       are  itemized  here.   Included  is  the  proposal  page  number,  the
  904.       requirement in textual form, and the PDS page  number  that  addresses
  905.       that requirement.
  906.                                 REQUIREMENTS
  907.  
  908.        *  Page:  2-5
  909.  
  910.           Each of the three terminal types will have a set of procedures and
  911.           functions  that  may  be  used  by  the  application programmer or
  912.           software tool writer.
  913.  
  914.        *  Page:  2-5
  915.  
  916.           The scroll-mode virtual terminal provides such functionality as:
  917.  
  918.           1.  setting tab stops,
  919.  
  920.           2.  clearing tab stops,
  921.  
  922.           3.  moving to a tab stop,
  923.  
  924.           4.  moving to a new line,
  925.  
  926.           5.  moving to a new page,
  927.  
  928.           6.  writing characters and strings to the display,
  929.  
  930.           7.  reading characters and strings from the keyboard,
  931.  
  932.           8.  setting and resetting the echo on the terminal,
  933.  
  934.           9.  ringing the terminals bell.
  935.  
  936.  
  937. REQUIREMENTS                                                        Page 3-2
  938. Requirement                                                        16 Nov 84
  939.  
  940.  
  941.        *  Page:  2-6
  942.  
  943.           The page-mode virtual terminal provides  all  of  the  scroll-mode
  944.           terminal's functionality plus those such as:
  945.  
  946.           1.  deleting characters from the display,
  947.  
  948.           2.  deleting lines from the display,
  949.  
  950.           3.  erasing characters from the display,
  951.  
  952.           4.  erasing between specific positions on the display,
  953.  
  954.           5.  inserting characters onto the display,
  955.  
  956.           6.  inserting lines onto the display,
  957.  
  958.           7.  setting the graphic rendition on the display.
  959.  
  960.  
  961.  
  962.        *  Page:  2-6
  963.  
  964.           The form-mode virtual terminal provides functionality such as:
  965.  
  966.           1.  defining qualified areas on the display,
  967.  
  968.           2.  clearing qualified areas on the display,
  969.  
  970.           3.  moving by tab stops on the display
  971.  
  972.           4.  erasing between specified positions on the display,
  973.  
  974.           5.  activating a form for user fill in,
  975.  
  976.           6.  reading characters and strings from the display buffer,
  977.  
  978.           7.  writing characters and strings to the display buffer,
  979.  
  980.           8.  retrieving the function key which signaled a full form.
  981.  
  982.  
  983.        *  Page:  2-7
  984.  
  985.           The virtual terminal will have a four-layer structure.
  986.  
  987.        *  Page:  2-7
  988.  
  989.           The user layer contains the interface that the tool  writer  sees.
  990.           This  includes  all the functions, procedures, abstract types, and
  991.           exceptions.
  992. REQUIREMENTS                                                        Page 3-3
  993. Requirement                                                        16 Nov 84
  994.  
  995.  
  996.        *  Page:  2-7
  997.  
  998.           The simulation layer supplies the software  simulation  to  create
  999.           those functions that the physical terminal does not support out of
  1000.           those functions that the physical terminal does support.
  1001.  
  1002.        *  Page:  2-7
  1003.  
  1004.           The simulation layer is written in  Ada  to  support  changes  and
  1005.           additions as required.
  1006.  
  1007.        *  Page:  2-7
  1008.  
  1009.           The translator/driver  layer  provides  the  mapping  from  device
  1010.           independent generic character codes into device specific character
  1011.           codes.
  1012.  
  1013.        *  Page:  2-7
  1014.  
  1015.           This  layer  incorporates  a  variation  of  the   UNIX   terminal
  1016.           capabilities database which is used to define the mapping.
  1017.  
  1018.        *  Page:  2-7
  1019.  
  1020.           The physical terminal layer contains the actual physical terminal.
  1021.  
  1022.        *  Page:  2-7
  1023.  
  1024.           Only the translator/driver layer has any knowledge  of  the  exact
  1025.           type of terminal that exists.
  1026.  
  1027.        *  Page:  2-7
  1028.  
  1029.           The simulation layer only knows that specific  functions  are  not
  1030.           available and must be simulated using other generic functions.
  1031.  
  1032.        *  Page:  2-7
  1033.  
  1034.           The user layer only knows that the terminal  is  of  a  particular
  1035.           class and level.
  1036.  
  1037.        *  Page:  2-7
  1038.  
  1039.           The  generic  character  codes  that  are  produced  out  of   the
  1040.           simulation layer conform to ANSI standard X3.64 [ANS79].
  1041.  
  1042. REQUIREMENTS                                                        Page 3-4
  1043. Packages Overview                                                  16 Nov 84
  1044.  
  1045.  
  1046.       3.1.2  Packages Overview
  1047.  
  1048.       There are ten major packages in the virtual terminal.  These are:
  1049.  
  1050.        *  virtual_terminal - This is  the  package  that  the  user  of  the
  1051.           virtual  terminal  sees  and  interfaces  with.   It  contains the
  1052.           following packages:
  1053.  
  1054.            -  scroll_terminal - provides  a  device-independent  scroll-mode
  1055.               terminal interface.
  1056.  
  1057.            -  page_terminal  -  provides  a   device-independent   page_mode
  1058.               terminal interface.
  1059.  
  1060.            -  form_terminal  -  provides  a   device-independent   form-mode
  1061.               terminal interface.
  1062.  
  1063.  
  1064.        *  vt_contents - provides the  constants,  types,and  variables  that
  1065.           describe  a virtual terminal display screen.  This is the internal
  1066.           representation that all scroll, page, and form  terminal  packages
  1067.           use as the display screen virtualization.
  1068.  
  1069.        *  redisplay - a set of redisplay algorithms  that  the  program  can
  1070.           choose to use.  Includes:
  1071.  
  1072.            .  redisplay screen with movement
  1073.  
  1074.            .  redisplay screen with redraw
  1075.  
  1076.            .  redisplay line with movement
  1077.  
  1078.            .  redisplay line with redraw
  1079.  
  1080.  
  1081.        *  driver - accepts a subset of  the  ANSI  X3.64  format  codes  and
  1082.           converts  (as  required) into the format for the particular actual
  1083.           terminal type.
  1084.  
  1085.        *  vt_input - reads characters and strings directly from the terminal
  1086.           keyboard.   A  task awaits the output from the terminal and stores
  1087.           it into an internal buffer.
  1088.  
  1089.        *  TCF - Terminal Capabilities File handler opens the TCF then  reads
  1090.           the  data  about  the  particular  terminal  into its visible data
  1091.           structures, then closes the TCF.
  1092.  
  1093.        *  SYSDEP - centralizes all actual reads and writes to  the  physical
  1094.           terminal.   This  package  also  isolates all SYStem DEPendencies.
  1095.           Only this package need be  changed  when  rehosting  this  virtual
  1096.           terminal.
  1097.  
  1098.       Figure 1 gives the package structure.
  1099. REQUIREMENTS                                                        Page 3-5
  1100. Packages Overview                                                  16 Nov 84
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131.  
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148.  
  1149.  
  1150.                               NOSC Virtual Terminal Structure
  1151.  
  1152.  
  1153. REQUIREMENTS                                                        Page 3-6
  1154. FUNCTION DESCRIPTION                                               16 Nov 84
  1155.  
  1156.  
  1157.       3.2  FUNCTION DESCRIPTION
  1158.  
  1159.       3.2.1  The Virtual Terminal Package
  1160.  
  1161.       3.2.1.1  Introduction - This  package   defines   the   user   program
  1162.       interface that can be used to interact with a computer terminal.
  1163.  
  1164.       3.2.1.2  The Object Name - virtual_terminal
  1165.  
  1166.       3.2.1.3  Abstract - Three packages are  defined  within  this  package
  1167.       scroll_terminal,  page_terminal,  and  form_terminal.   Each  of these
  1168.       packages  contain  a  set  of  object  definitions,  procedures,   and
  1169.       functions  that  the  user program can make use of to communicate with
  1170.       the terminal.  The detailed design of each of these internal  packages
  1171.       follows in 3 separate sections of this design document.
  1172.  
  1173.       3.2.1.4  Parameters - None.
  1174.  
  1175.       3.2.1.5  Local Constants, Types, And Variables - None.
  1176.  
  1177.       3.2.1.6  Errors - See the individual packages.
  1178.  
  1179.       3.2.1.7  Exceptions - See the individual packages.
  1180.  
  1181.       3.2.1.8  The   Ada   Source - The   Ada   source   for   the    entire
  1182.       virtual_terminal package appears here.  The actual description of each
  1183.       of these packages will follow in seperate sections of the document.
  1184.  
  1185.       PACKAGE virtual_terminal IS
  1186.           
  1187.  
  1188.         PACKAGE scroll_terminal IS
  1189.  
  1190.           TYPE function_key_enum IS
  1191.             ( up_arrow,       down_arrow,     left_arrow,     right_arrow,
  1192.               f1,     f2,     f3,     f4,     f5,     f6,     f7,     f8,
  1193.               f9,     f10,    f11,    f12,    f13,    f14,    f15,    f16,
  1194.               f17,    f18,    f19,    f20,    f21,    f22,    f23,    f24,
  1195.               f25,    f26,    f27,    f28,    f29,    f30,    f31,    f32 );
  1196.  
  1197.           TYPE function_key_descriptor IS LIMITED PRIVATE;
  1198.  
  1199.           PROCEDURE open (name     : IN OUT string );
  1200.  
  1201.           PROCEDURE close;
  1202.  
  1203.           PROCEDURE set_position (position : IN     positive);
  1204.  
  1205.           FUNCTION  position RETURN positive;
  1206.  
  1207.           FUNCTION  size RETURN positive;
  1208.  
  1209.           PROCEDURE set_tab;
  1210.           PROCEDURE clear_tab;
  1211. REQUIREMENTS                                                        Page 3-7
  1212. The Ada Source                                                     16 Nov 84
  1213.  
  1214.  
  1215.  
  1216.           PROCEDURE tab       (count    : IN     positive := 1);
  1217.  
  1218.           PROCEDURE new_line  (count    : IN     positive := 1);
  1219.  
  1220.           PROCEDURE new_page  (count    : IN     positive := 1);
  1221.  
  1222.           PROCEDURE put (item     : IN     character);
  1223.           PROCEDURE put (item     : IN     string);
  1224.  
  1225.           PROCEDURE update_line;
  1226.  
  1227.           FUNCTION valid_character( item : IN character ) RETURN boolean;
  1228.  
  1229.           PROCEDURE get( data : OUT string;  
  1230.                          last : OUT natural;
  1231.                          keys : OUT function_key_descriptor;
  1232.                 timeout : IN  duration := duration'last );
  1233.  
  1234.           FUNCTION function_count(keys : IN function_key_descriptor)
  1235.               RETURN natural;
  1236.  
  1237.           PROCEDURE function_key(keys           : IN     function_key_descriptor;
  1238.                                  index          : IN     positive;
  1239.                                  key_identifier :    OUT positive;
  1240.                               previous_position :    OUT natural);
  1241.  
  1242.           PROCEDURE function_key_name
  1243.               key_identifier : IN     positive;
  1244.               key_name       :    OUT string;
  1245.               last           :    OUT natural);
  1246.  
  1247.           PROCEDURE bell;
  1248.  
  1249.  
  1250.           uninitialized        : EXCEPTION;
  1251.           name_error           : EXCEPTION;
  1252.           tcf_error            : EXCEPTION;
  1253.           unsupported_terminal : EXCEPTION;
  1254.           invalid_function_key : EXCEPTION;
  1255.  
  1256.           PRIVATE
  1257.  
  1258.               TYPE funtion_key_descriptor IS positive;
  1259.               
  1260.  
  1261.         END scroll_terminal;
  1262.  
  1263.        
  1264.         PACKAGE page_terminal IS
  1265.  
  1266.           TYPE function_key_enum IS
  1267.             ( up_arrow,       down_arrow,     left_arrow,     right_arrow,
  1268.               f1,     f2,     f3,     f4,     f5,     f6,     f7,     f8,
  1269. REQUIREMENTS                                                        Page 3-8
  1270. The Ada Source                                                     16 Nov 84
  1271.  
  1272.  
  1273.               f9,     f10,    f11,    f12,    f13,    f14,    f15,    f16,
  1274.               f17,    f18,    f19,    f20,    f21,    f22,    f23,    f24,
  1275.               f25,    f26,    f27,    f28,    f29,    f30,    f31,    f32 );
  1276.  
  1277.           TYPE function_key_descriptor IS LIMITED PRIVATE;
  1278.  
  1279.           TYPE xy_position IS 
  1280.           RECORD
  1281.               line    : positive;
  1282.               column  : positive;
  1283.           END RECORD;
  1284.  
  1285.           TYPE select_enumeration IS (from_xy_position_to_end,
  1286.                                       from_start_to_xy_position,
  1287.                                       all_positions);
  1288.  
  1289.           TYPE graphic_rendition_enumeration IS
  1290.                                      (primary_rendition,
  1291.                                       reverse_image);
  1292.  
  1293.           PROCEDURE open (name     : IN OUT string );
  1294.  
  1295.           PROCEDURE close;
  1296.  
  1297.           PROCEDURE set_position (position : IN     xy_position);
  1298.  
  1299.           FUNCTION  position RETURN xy_position;
  1300.  
  1301.           FUNCTION  size RETURN xy_position;
  1302.  
  1303.           PROCEDURE delete_character (count    : IN     positive := 1);
  1304.           PROCEDURE delete_line      (count    : IN     positive := 1);
  1305.  
  1306.           PROCEDURE erase_in_display (selection : select_enumeration);
  1307.           PROCEDURE erase_in_line    (selection : select_enumeration);
  1308.  
  1309.           PROCEDURE enter_insert_mode;
  1310.           PROCEDURE exit_insert_mode;
  1311.  
  1312.           PROCEDURE insert_line      (count     : IN     positive := 1);
  1313.  
  1314.           PROCEDURE select_graphic_rendition
  1315.                            (selection : IN     graphic_rendition_enumeration);
  1316.  
  1317.           PROCEDURE set_tab;
  1318.           PROCEDURE clear_tab;
  1319.  
  1320.           PROCEDURE tab       (count    : IN     positive := 1);
  1321.  
  1322.           PROCEDURE put (item     : IN     character);
  1323.           PROCEDURE put (item     : IN     string);
  1324.  
  1325.           PROCEDURE update_screen_with_movement;
  1326.           PROCEDURE update_screen_with_redraw;
  1327. REQUIREMENTS                                                        Page 3-9
  1328. The Ada Source                                                     16 Nov 84
  1329.  
  1330.  
  1331.           PROCEDURE update_line;
  1332.           PROCEDURE redraw_screen;
  1333.  
  1334.           FUNCTION valid_character( item : IN character ) RETURN boolean;
  1335.  
  1336.           PROCEDURE get( data : OUT string;  
  1337.                          last : OUT natural;
  1338.                          keys : OUT function_key_descriptor;
  1339.                 timeout : IN  duration := duration'last );
  1340.  
  1341.           FUNCTION function_count(keys : IN function_key_descriptor)
  1342.               RETURN natural;
  1343.  
  1344.           PROCEDURE function_key(keys           : IN     function_key_descriptor;
  1345.                                  index          : IN     positive;
  1346.                                  key_identifier :    OUT positive;
  1347.                               previous_position :    OUT natural);
  1348.  
  1349.           PROCEDURE function_key_name
  1350.               key_identifier : IN     positive;
  1351.               key_name       :    OUT string;
  1352.               last           :    OUT natural);
  1353.  
  1354.           PROCEDURE bell;
  1355.  
  1356.           uninitialized        : EXCEPTION;
  1357.           name_error           : EXCEPTION;
  1358.           tcf_error            : EXCEPTION;
  1359.           unsupported_terminal : EXCEPTION;
  1360.           invalid_function_key : EXCEPTION;
  1361.  
  1362.           PRIVATE
  1363.  
  1364.               TYPE funtion_key_descriptor IS positive;
  1365.  
  1366.         END page_terminal;
  1367.  
  1368.  
  1369.         PACKAGE form_terminal IS
  1370.  
  1371.           TYPE termination_key_range IS RANGE 1..32;
  1372.  
  1373.           TYPE area_intensity  IS (none, normal, high);
  1374.           TYPE area_protection IS (unprotected, protected);
  1375.           TYPE area_input      IS (graphic_characters, numerics, alphabetics);
  1376.           TYPE area_value      IS (no_fill, fill_with_zeroes, fill_with_spaces);
  1377.  
  1378.           PROCEDURE open (name     : IN     string);
  1379.  
  1380.           PROCEDURE close;
  1381.  
  1382.           PROCEDURE set_position (position : IN     xy_position);
  1383.  
  1384.           FUNCTION  position RETURN xy_position;
  1385. REQUIREMENTS                                                       Page 3-10
  1386. The Ada Source                                                     16 Nov 84
  1387.  
  1388.  
  1389.  
  1390.           FUNCTION  size RETURN xy_position;
  1391.  
  1392.           PROCEDURE define_qualified_area
  1393.                            (intensity  : IN     area_intensity  := normal;
  1394.                             protection : IN     area_protection := protected;
  1395.                             input      : IN     area_input
  1396.                                                      := graphic_characters;
  1397.                             value      : IN     area_value      := no_fill);
  1398.  
  1399.           PROCEDURE clear_qualified_area;
  1400.  
  1401.           PROCEDURE tab;
  1402.           PROCEDURE put (item     : IN     character);
  1403.           PROCEDURE put (item     : IN     string);
  1404.  
  1405.           PROCEDURE get (item     :    OUT character);
  1406.           PROCEDURE get (item     :    OUT string);
  1407.  
  1408.           PROCEDURE erase_area;
  1409.           PROCEDURE erase_display;
  1410.           PROCEDURE activate_form;
  1411.  
  1412.           FUNCTION  is_form_updated RETURN boolean;
  1413.           FUNCTION  area_qualifier_requires_space RETURN boolean;
  1414.           FUNCTION  termination_key RETURN termination_key_range;
  1415.  
  1416.           -- exceptions
  1417.  
  1418.         END form_terminal;
  1419.  
  1420.       END virtual_terminal;
  1421.  
  1422. REQUIREMENTS                                                       Page 3-11
  1423. The Scroll Terminal Package                                        16 Nov 84
  1424.  
  1425.  
  1426.       3.2.2  The Scroll Terminal Package
  1427.  
  1428.       3.2.2.1  Introduction - This  package  provides  a  device-independent
  1429.       scroll-terminal interface to a user's program.
  1430.  
  1431.       3.2.2.2  The Object Name - scroll_terminal
  1432.  
  1433.       3.2.2.3  Abstract - A user's program can WITH this package to  provide
  1434.       a   device-independent   terminal   interface   that  is  functionally
  1435.       equivalent to  a  scroll-terminal.   This  is  the  simplest  form  of
  1436.       terminal  that this virtual terminal supports.  This package should be
  1437.       chosen for any of the following reasons:
  1438.  
  1439.       1.  The user's terminal is primitive.  Either it could be a  CRT  with
  1440.           little functionality, or a printing terminal.
  1441.  
  1442.       2.  The user wants maximum transportability.
  1443.  
  1444.       3.  The user does not need advanced capabilities for the application.
  1445.  
  1446.       4.  The user's appication may run over low speed communication  lines,
  1447.           making the page and form mode unacceptable.
  1448.  
  1449.  
  1450.       3.2.2.4  Parameters - None.
  1451.  
  1452.       3.2.2.5  Local Constants, Types, And Variables - The enumeration  type
  1453.       function_key_enum is defined here.  This enumerated type defines the 4
  1454.       arrow keys and 32 function keys.
  1455.  
  1456.       The private limited  type  function_key_descriptor  is  defined  here.
  1457.       This type is used to traverse the function key list whose reference is
  1458.       returned from a call to scroll_terminal.get  (see  below).   The  user
  1459.       must define a variable of this type (or more than one) in order to use
  1460.       the function key procedures and functions.
  1461.  
  1462.       The enumerated type function_key_enum  identifies  the  function/arrow
  1463.       keys  that  are used in the function/arrow key handling procedures and
  1464.       functions.
  1465. REQUIREMENTS                                                       Page 3-12
  1466. Selectors (Functions)                                              16 Nov 84
  1467.  
  1468.  
  1469.       3.2.2.6  Selectors (Functions) -
  1470.  
  1471.       3.2.2.6.1  Determining The Current Position -
  1472.  
  1473.       3.2.2.6.1.1  Introduction - This function is called to get the current
  1474.       active position on the virtual terminal.
  1475.  
  1476.       3.2.2.6.1.2  The Object Name - position
  1477.  
  1478.       3.2.2.6.1.3  Abstract - Scroll_terminal.position returns  a  value  of
  1479.       type  positive  that  is  the  current  active position on the virtual
  1480.       terminal's line.  This position is the place where further output will
  1481.       be  directed.   It  should  be  noted  that  this does not necessarily
  1482.       correspond to where the actual terminal's  cursor  is  located  unless
  1483.       executed  after  scroll_terminal.update_line  procedure  is called and
  1484.       before scroll_terminal.put or scroll_terminal.tab is called again.
  1485.  
  1486.       3.2.2.6.1.4  Parameters - None.
  1487.  
  1488.       3.2.2.6.1.5  Local Constants, Types, And Variables - TBD.
  1489.  
  1490.       3.2.2.6.1.6  Errors - The scroll terminal may  not  have  been  opened
  1491.       prior to calling this procedure.
  1492.  
  1493.       3.2.2.6.1.7  Exceptions - If the scroll terminal has not  been  opened
  1494.       previously to this then the exception uninitialized will be raised.
  1495.  
  1496.       3.2.2.6.1.8  The Ada Source -
  1497.  
  1498.       FUNCTION  position RETURN positive;
  1499.  
  1500. REQUIREMENTS                                                       Page 3-13
  1501. Determining The Terminal Size                                      16 Nov 84
  1502.  
  1503.  
  1504.       3.2.2.6.2  Determining The Terminal Size -
  1505.  
  1506.       3.2.2.6.2.1  Introduction - This function is called to  determine  the
  1507.       length of the scroll terminals line.
  1508.  
  1509.       3.2.2.6.2.2  The Object Name - size
  1510.  
  1511.       3.2.2.6.2.3  Abstract - Scroll_terminal.size returns a value  of  type
  1512.       positive  which  is  the  length  of the scroll terminal's line.  This
  1513.       value is extracted from the terminal capabilities file and may or  may
  1514.       not reflect the actual terminal's line length.
  1515.  
  1516.       3.2.2.6.2.4  Parameters - None.
  1517.  
  1518.       3.2.2.6.2.5  Local Constants, Types, And Variables - TBD.
  1519.  
  1520.       3.2.2.6.2.6  Errors - The scroll terminal may  not  have  been  opened
  1521.       prior to calling this procedure.
  1522.  
  1523.       3.2.2.6.2.7  Exceptions - If the scroll terminal has not  been  opened
  1524.       previously to this then the exception uninitialized will be raised.
  1525.  
  1526.       3.2.2.6.2.8  The Ada Source -
  1527.  
  1528.       FUNCTION  size RETURN positive;
  1529.  
  1530. REQUIREMENTS                                                       Page 3-14
  1531. Determining The Validity Of A Character                            16 Nov 84
  1532.  
  1533.  
  1534.       3.2.2.6.3  Determining The Validity Of A Character -
  1535.  
  1536.       3.2.2.6.3.1  Introduction - This  procedure  is  called  to  determine
  1537.       whether  a  particular  character  can  be  considered  valid for this
  1538.       environment.
  1539.  
  1540.       3.2.2.6.3.2  The Object Name - valid_character
  1541.  
  1542.       3.2.2.6.3.3  Abstract - Scroll_terminal.valid_character is  called  to
  1543.       check  if  the  character specified in the input parameter is one that
  1544.       can be used (and therefore considered  valid)  for  this  environment.
  1545.       Character that should be considered suspect include:
  1546.  
  1547.        *  XON (CTRL-S)
  1548.  
  1549.        *  XOFF (CTRL-Q)
  1550.  
  1551.        *  (CTRL-Y)
  1552.  
  1553.        *  (CTRL-C)
  1554.  
  1555.       To be safe, a  tool  writer  should  call  this  procedure  for  every
  1556.       character  that  they  want  to use in the application.  Of course, if
  1557.       appropriately designed, the application should only need to call  this
  1558.       procedure  once  for  each offensive character (probably either at the
  1559.       beginning of the program, or just before the character's first use).
  1560.  
  1561.       3.2.2.6.3.4  Parameters - There is one input  parameter,  item,  which
  1562.       identifies  the  character that the user is interested in checking.  A
  1563.       boolean value is returned.  True indicates that the character is valid
  1564.       and can be used, false indicates that the charater should not be used.
  1565.  
  1566.       3.2.2.6.3.5  Local Constants, Types, And Variables - TBD.
  1567.  
  1568.       3.2.2.6.3.6  Errors - The scroll terminal may  not  have  been  opened
  1569.       prior to calling this procedure.
  1570.  
  1571.       3.2.2.6.3.7  Exceptions - If the scroll terminal has not  been  opened
  1572.       previously to this then the exception uninitialized will be raised.
  1573.  
  1574.       3.2.2.6.3.8  The Ada Source -
  1575.  
  1576.       FUNCTION valid_character( item : IN character ) RETURN boolean;
  1577.  
  1578. REQUIREMENTS                                                       Page 3-15
  1579. Getting The Number Of Typed Function/Arrow Keys                    16 Nov 84
  1580.  
  1581.  
  1582.       3.2.2.6.4  Getting The Number Of Typed Function/Arrow Keys -
  1583.  
  1584.       3.2.2.6.4.1  Introduction - This function is called to get the  number
  1585.       of   function/arrow   keys   that   were   returned  from  a  call  on
  1586.       scroll_terminal.get.
  1587.  
  1588.       3.2.2.6.4.2  The Object Name - function_count
  1589.  
  1590.       3.2.2.6.4.3  Abstract - A value  is  returned  of  type  natural  that
  1591.       identifies the number of function/arrow keys that were typed since the
  1592.       last call on scroll_terminal.get.  There is a  20  key  limit  on  the
  1593.       number  of  function/arrow  keys  that can be buffered.  If the number
  1594.       returned is zero then no function/arrow keys were typed since the last
  1595.       call on scroll_terminal.get.
  1596.  
  1597.       3.2.2.6.4.4  Parameters - The  single  input  parameter  keys  is  the
  1598.       limited  private  type  returned from the call on scroll_terminal.get.
  1599.       This identifies the specific list of function/arrow keys that will  be
  1600.       operated on by this function.
  1601.  
  1602.       3.2.2.6.4.5  Local Constants, Types, And Variables - TBD
  1603.  
  1604.       3.2.2.6.4.6  Errors - The virtual terminal may not  have  been  opened
  1605.       prior to calling this procedure.
  1606.  
  1607.       3.2.2.6.4.7  Exceptions - If the virtual terminal has not been  opened
  1608.       previously  to  this  then the exception scroll_terminal.uninitialized
  1609.       will be raised.
  1610.  
  1611.       3.2.2.6.4.8  The Ada Source -
  1612.  
  1613.       FUNCTION function_count(keys : IN function_key_descriptor)
  1614.           RETURN natural;
  1615.  
  1616. REQUIREMENTS                                                       Page 3-16
  1617. Actors (Procedures)                                                16 Nov 84
  1618.  
  1619.  
  1620.       3.2.2.7  Actors (Procedures) -
  1621.  
  1622.       3.2.2.7.1  Opening A Scroll Terminal -
  1623.  
  1624.       3.2.2.7.1.1  Introduction - This  procedure  is  called  to  open  the
  1625.       scroll terminal.
  1626.  
  1627.       3.2.2.7.1.2  The Object Name - open
  1628.  
  1629.       3.2.2.7.1.3  Abstract - Scroll_terminal.open  is  called  to   perform
  1630.       initialization  and  define  a  scroll-mode  virtual  terminal for the
  1631.       user's program to make use of.  This initialization consists of:
  1632.  
  1633.       1.  defining the necessary data structures within the virtual terminal
  1634.           to support a scroll terminal.
  1635.  
  1636.       2.  calling the  driver  package  and  initializing  the  needed  data
  1637.           structures from the terminal capabilities file.
  1638.  
  1639.       3.  raising the necessary exceptions if the scroll terminal could  not
  1640.           be opened.
  1641.  
  1642.  
  1643.       3.2.2.7.1.4  Parameters - The name parameter contains the name of  the
  1644.       actual  terminal  that  the user is interfacing with.  This may change
  1645.       from one invocation of the program to another.  This name  must  match
  1646.       exactly  (string  and  case)  with the terminal name as defined in the
  1647.       terminal capabilities file.
  1648.  
  1649.       If the string parameter is of length zero then  the  virtual  terminal
  1650.       will  attempt  to  find  the  terminal name through a system dependent
  1651.       manner.  This will be performed through a call to a procedure  in  the
  1652.       package  SYSDEP.  If the terminal name can be determined, then it will
  1653.       be returned from this call in the name parameter.
  1654.  
  1655.       The scroll terminal may have been previously opened.  In this case the
  1656.       terminal  is  implicitly closed and reopened.  No implicit update will
  1657.       be performed before the close operation.
  1658.  
  1659.       3.2.2.7.1.5  Local Constants, Types, And Variables - TBD.
  1660.  
  1661.       3.2.2.7.1.6  Errors - Errors include:
  1662.  
  1663.        *  passing  in  a  name  that  does  not  appear  in   the   terminal
  1664.           capabilities file.
  1665.  
  1666.        *  if the terminal capabilities file is not available to read.
  1667.  
  1668.        *  if the terminal does not have the  needed  capabilities  to  be  a
  1669.           scroll terminal.
  1670.  
  1671. REQUIREMENTS                                                       Page 3-17
  1672. Opening A Scroll Terminal                                          16 Nov 84
  1673.  
  1674.  
  1675.       3.2.2.7.1.7  Exceptions - The exceptions raised are (respectively):
  1676.  
  1677.        *  uninitialized
  1678.  
  1679.        *  name_error
  1680.  
  1681.        *  tcf_error
  1682.  
  1683.        *  unsupported_terminal
  1684.  
  1685.  
  1686.       3.2.2.7.1.8  The Ada Source -
  1687.  
  1688.       PROCEDURE open (name     : IN     string);
  1689.  
  1690. REQUIREMENTS                                                       Page 3-18
  1691. Closing A Scroll Terminal                                          16 Nov 84
  1692.  
  1693.  
  1694.       3.2.2.7.2  Closing A Scroll Terminal -
  1695.  
  1696.       3.2.2.7.2.1  Introduction - This procedure  is  called  to  close  the
  1697.       scroll terminal.
  1698.  
  1699.       3.2.2.7.2.2  The Object Name - close
  1700.  
  1701.       3.2.2.7.2.3  Abstract - Scroll_terminal.close   closes   the   virtual
  1702.       terminal.   If  the  virtual  terminal  was  already  closed,  then no
  1703.       operation will occur.
  1704.  
  1705.       3.2.2.7.2.4  Parameters - None.
  1706.  
  1707.       3.2.2.7.2.5  Local Constants, Types, And Variables - TBD.
  1708.  
  1709.       3.2.2.7.2.6  Errors - None.
  1710.  
  1711.       3.2.2.7.2.7  Exceptions - None.
  1712.  
  1713.       3.2.2.7.2.8  The Ada Source -
  1714.  
  1715.       PROCEDURE close;
  1716.  
  1717. REQUIREMENTS                                                       Page 3-19
  1718. Positioning The Cursor                                             16 Nov 84
  1719.  
  1720.  
  1721.       3.2.2.7.3  Positioning The Cursor -
  1722.  
  1723.       3.2.2.7.3.1  Introduction - This procedure is called to set the active
  1724.       position within the line.
  1725.  
  1726.       3.2.2.7.3.2  The Object Name - set_position
  1727.  
  1728.       3.2.2.7.3.3  Abstract - Scroll_terminal.set_position allows the user's
  1729.       program to move the current position randomly about within the current
  1730.       line.   It  does  not  affect  the   actual   terminal's   line.    If
  1731.       scroll_terminal.update_line  is  called  from  the user's program then
  1732.       set_position will not allow the active position to move backward  past
  1733.       the  position that was active at the time that update_line was called.
  1734.       If an attempt is made to move backward past the old  active  position,
  1735.       then  the active position will be moved only to position corresponding
  1736.       to the old active position.  As an example consider the following:
  1737.  
  1738.       ...   -- assume the user has opened the scroll_terminal previously
  1739.       virtual_terminal.scroll_terminal.put( "My_prompt>" );
  1740.       virtual_terminal.scroll_terminal.update_line;
  1741.       virtual_terminal.scroll_terminal.set_position( 1 );
  1742.  
  1743.       The last statement would move the active position to  position  number
  1744.       eleven  (the  character  count  of "My_prompt>" plus 1) in the current
  1745.       line (immediately after the string "My_prompt>").
  1746.  
  1747.       3.2.2.7.3.4  Parameters - The  parameter  position  of  type  positive
  1748.       identifies  the  character  position that the caller wishes the active
  1749.       position to be changed to.
  1750.  
  1751.       3.2.2.7.3.5  Local Constants, Types, And Variables - TBD.
  1752.  
  1753.       3.2.2.7.3.6  Errors - The scroll terminal may  not  have  been  opened
  1754.       prior to calling this procedure.
  1755.  
  1756.       3.2.2.7.3.7  Exceptions - If the scroll terminal has not  been  opened
  1757.       previously to this then the exception uninitialized will be raised.
  1758.  
  1759.       3.2.2.7.3.8  The Ada Source -
  1760.  
  1761.       PROCEDURE set_position (position : IN     positive);
  1762.  
  1763. REQUIREMENTS                                                       Page 3-20
  1764. Setting A Horizontal Tab Stop                                      16 Nov 84
  1765.  
  1766.  
  1767.       3.2.2.7.4  Setting A Horizontal Tab Stop -
  1768.  
  1769.       3.2.2.7.4.1  Introduction - This procedure will set a  horizontal  tab
  1770.       at the current active position.
  1771.  
  1772.       3.2.2.7.4.2  The Object Name - set_tab
  1773.  
  1774.       3.2.2.7.4.3  Abstract - Scroll_terminal.set_tab will set a  horizontal
  1775.       tab  at  the  active position.  This tab will stay in place even after
  1776.       update or new_line have been called.
  1777.  
  1778.       3.2.2.7.4.4  Parameters - None.
  1779.  
  1780.       3.2.2.7.4.5  Local Constants, Types, And Variables - TBD.
  1781.  
  1782.       3.2.2.7.4.6  Errors - The scroll terminal may  not  have  been  opened
  1783.       prior to calling this procedure.
  1784.  
  1785.       3.2.2.7.4.7  Exceptions - If the scroll terminal has not  been  opened
  1786.       previously to this then the exception uninitialized will be raised.
  1787.  
  1788.       3.2.2.7.4.8  The Ada Source -
  1789.  
  1790.       PROCEDURE set_tab;
  1791.  
  1792. REQUIREMENTS                                                       Page 3-21
  1793. Clearing A Horizontal Tab Stop                                     16 Nov 84
  1794.  
  1795.  
  1796.       3.2.2.7.5  Clearing A Horizontal Tab Stop -
  1797.  
  1798.       3.2.2.7.5.1  Introduction - This  procedure  is  called  to  clear   a
  1799.       horizontal tab stop at the active position.
  1800.  
  1801.       3.2.2.7.5.2  The Object Name - clear_tab
  1802.  
  1803.       3.2.2.7.5.3  Abstract - Scroll_terminal.clear_tab will remove the  tab
  1804.       stop  at  the  location  of  the active position.  This clears the tab
  1805.       completely and it will remain gone after an  update  or  new_line  has
  1806.       been called.  If there was no tab stop set at the active position then
  1807.       no operation will be performed.
  1808.  
  1809.       3.2.2.7.5.4  Parameters - None,
  1810.  
  1811.       3.2.2.7.5.5  Local Constants, Types, And Variables - TBD.
  1812.  
  1813.       3.2.2.7.5.6  Errors - The scroll terminal may  not  have  been  opened
  1814.       prior to calling this procedure.
  1815.  
  1816.       3.2.2.7.5.7  Exceptions - If the scroll terminal has not  been  opened
  1817.       previously to this then the exception uninitialized will be raised.
  1818.  
  1819.       3.2.2.7.5.8  The Ada Source -
  1820.  
  1821.       PROCEDURE clear_tab;
  1822.  
  1823. REQUIREMENTS                                                       Page 3-22
  1824. Horizontal Tab                                                     16 Nov 84
  1825.  
  1826.  
  1827.       3.2.2.7.6  Horizontal Tab -
  1828.  
  1829.       3.2.2.7.6.1  Introduction - This procedure is called to  move  to  the
  1830.       specified tab stop.
  1831.  
  1832.       3.2.2.7.6.2  The Object Name - tab
  1833.  
  1834.       3.2.2.7.6.3  Abstract - Scroll_terminal.tab  will  move   the   active
  1835.       position to the specified horizontal tab stop counting upward from the
  1836.       next tab stop.  If there are no further tab stops on the line then  an
  1837.       implicit  call  on  new_line will be performed and the active position
  1838.       moved to the next tab stop on that line.  If there are  no  tab  stops
  1839.       set  on the line, then the implicit new_line will be performed and the
  1840.       active position left at the beginning of the line.
  1841.  
  1842.       3.2.2.7.6.4  Parameters - There  is  one  parameter  count   of   type
  1843.       positive.   Count  specifies  the  number  of  tab stops to move.  The
  1844.       default value for the parameter is one.
  1845.  
  1846.       3.2.2.7.6.5  Local Constants, Types, And Variables - TBD.
  1847.  
  1848.       3.2.2.7.6.6  Errors - The scroll terminal may  not  have  been  opened
  1849.       prior to calling this procedure.
  1850.  
  1851.       3.2.2.7.6.7  Exceptions - If the scroll terminal has not  been  opened
  1852.       previously to this then the exception uninitialized will be raised.
  1853.  
  1854.       3.2.2.7.6.8  The Ada Source -
  1855.  
  1856.       PROCEDURE tab       (count    : IN     positive := 1);
  1857.  
  1858. REQUIREMENTS                                                       Page 3-23
  1859. Moving To A New Line                                               16 Nov 84
  1860.  
  1861.  
  1862.       3.2.2.7.7  Moving To A New Line -
  1863.  
  1864.       3.2.2.7.7.1  Introduction - This  procedure  is  called  to  move  the
  1865.       active position to the beginning of the next line.
  1866.  
  1867.       3.2.2.7.7.2  The Object Name - new_line
  1868.  
  1869.       3.2.2.7.7.3  Abstract - Scroll_terminal.new_line will move the  active
  1870.       position  to the beginning of the next line.  This process performs an
  1871.       implicit call on update and clears the internal buffer.  The tab stops
  1872.       active on the previous line remain in effect.
  1873.  
  1874.       3.2.2.7.7.4  Parameters - The single parameter count of type  positive
  1875.       indicates the number of times the new_line should be performed.
  1876.  
  1877.       3.2.2.7.7.5  Local Constants, Types, And Variables - TBD.
  1878.  
  1879.       3.2.2.7.7.6  Errors - The scroll terminal may  not  have  been  opened
  1880.       prior to calling this procedure.
  1881.  
  1882.       3.2.2.7.7.7  Exceptions - If the scroll terminal has not  been  opened
  1883.       previously to this then the exception uninitialized will be raised.
  1884.  
  1885.       3.2.2.7.7.8  The Ada Source -
  1886.  
  1887.       PROCEDURE new_line  (count    : IN     positive := 1);
  1888.  
  1889. REQUIREMENTS                                                       Page 3-24
  1890. Moving To A New Page                                               16 Nov 84
  1891.  
  1892.  
  1893.       3.2.2.7.8  Moving To A New Page -
  1894.  
  1895.       3.2.2.7.8.1  Introduction - This  procedure  is  called  to  move  the
  1896.       active position to a "new page".
  1897.  
  1898.       3.2.2.7.8.2  The Object Name - new_page
  1899.  
  1900.       3.2.2.7.8.3  Abstract - Scroll_terminal.new_page  causes  a  new  page
  1901.       operation  to  be  performed.  An implicit call to update is performed
  1902.       then the new page operation as defined in  the  terminal  capabilities
  1903.       file is performed.  Typically this new page operation is the output of
  1904.       a form feed but a user can tailor this to be anything that is needed.
  1905.  
  1906.       3.2.2.7.8.4  Parameters - The number of new page operations  that  are
  1907.       to  be  performed  are  passed  into  the procedure through the single
  1908.       parameter count of type positive.  The default for count is one.
  1909.  
  1910.       3.2.2.7.8.5  Local Constants, Types, And Variables - TBD.
  1911.  
  1912.       3.2.2.7.8.6  Errors - The scroll terminal may  not  have  been  opened
  1913.       prior to calling this procedure.
  1914.  
  1915.       3.2.2.7.8.7  Exceptions - If the scroll terminal has not  been  opened
  1916.       previously to this then the exception uninitialized will be raised.
  1917.  
  1918.       3.2.2.7.8.8  The Ada Source -
  1919.  
  1920.       PROCEDURE new_page  (count    : IN     positive := 1);
  1921.  
  1922. REQUIREMENTS                                                       Page 3-25
  1923. Writing Data To A Terminal                                         16 Nov 84
  1924.  
  1925.  
  1926.       3.2.2.7.9  Writing Data To A Terminal -
  1927.  
  1928.       3.2.2.7.9.1  Introduction - This procedure is called to  write  either
  1929.       character data or string data to the scroll terminal.
  1930.  
  1931.       3.2.2.7.9.2  The Object Name - put
  1932.  
  1933.       3.2.2.7.9.3  Abstract - There  are  two  versions  of  the   procedure
  1934.       differing  only  by  their  parameters.   When  scroll_terminal.put is
  1935.       called the data  is  placed  into  the  current  line  at  the  active
  1936.       position.   The active position is advanced past the last character of
  1937.       the data that was placed into the line.   The  data  is  lost  if  the
  1938.       active  position  moves past the length of the line.  Also, the active
  1939.       position is left pointing at the last character on the  line  if  this
  1940.       occurs.
  1941.  
  1942.       3.2.2.7.9.4  Parameters - Each procedure has one parameter called item
  1943.       of  types  character  and  string.   The  string parameter is variable
  1944.       length.
  1945.  
  1946.       3.2.2.7.9.5  Local Constants, Types, And Variables - TBD.
  1947.  
  1948.       3.2.2.7.9.6  Errors - The scroll terminal may  not  have  been  opened
  1949.       prior to calling this procedure.
  1950.  
  1951.       3.2.2.7.9.7  Exceptions - If the scroll terminal has not  been  opened
  1952.       previously to this then the exception uninitialized will be raised.
  1953.  
  1954.       3.2.2.7.9.8  The Ada Source -
  1955.  
  1956.       PROCEDURE put (item     : IN     character);
  1957.       PROCEDURE put (item     : IN     string);
  1958.  
  1959. REQUIREMENTS                                                       Page 3-26
  1960. Updating The Terminal Display Line                                 16 Nov 84
  1961.  
  1962.  
  1963.       3.2.2.7.10  Updating The Terminal Display Line -
  1964.  
  1965.       3.2.2.7.10.1  Introduction - This procedure is  called  to  force  the
  1966.       internal  representation  of  the  line  out  to  the  actual terminal
  1967.       display.
  1968.  
  1969.       3.2.2.7.10.2  The Object Name - update_line
  1970.  
  1971.       3.2.2.7.10.3  Abstract - It  is  important   to   realize   that   the
  1972.       operations:
  1973.  
  1974.        *  set_position
  1975.  
  1976.        *  set_tab
  1977.  
  1978.        *  clear_tab
  1979.  
  1980.        *  tab
  1981.  
  1982.        *  put
  1983.  
  1984.       perform there operations on a virtual representation of  the  terminal
  1985.       and  not directly on the terminal itself.  Scroll_terminal.update_line
  1986.       is called to force the internal representation to the actual  terminal
  1987.       display.   Refer  to  set_position and put for restrictions imposed by
  1988.       update_line.
  1989.  
  1990.       3.2.2.7.10.4  Parameters - None.
  1991.  
  1992.       3.2.2.7.10.5  Local Constants, Types, And Variables - TBD.
  1993.  
  1994.       3.2.2.7.10.6  Errors - The scroll terminal may not  have  been  opened
  1995.       prior to calling this procedure.
  1996.  
  1997.       3.2.2.7.10.7  Exceptions - If the scroll terminal has not been  opened
  1998.       previously to this then the exception uninitialized will be raised.
  1999.  
  2000.       3.2.2.7.10.8  The Ada Source -
  2001.  
  2002.       PROCEDURE update_line;
  2003.  
  2004. REQUIREMENTS                                                       Page 3-27
  2005. Determining The Validity Of A Character                            16 Nov 84
  2006.  
  2007.  
  2008.       3.2.2.7.11  Determining The Validity Of A Character -
  2009.  
  2010.       3.2.2.7.11.1  Introduction - This procedure  is  called  to  determine
  2011.       whether  a  particular  character  can  be  considered  valid for this
  2012.       Environment.
  2013.  
  2014.       3.2.2.7.11.2  The Object Name - valid_character
  2015.  
  2016.       3.2.2.7.11.3  Abstract - Scroll_terminal.valid_character is called  to
  2017.       check  if  the  character specified in the input parameter is one that
  2018.       can be used (and therefore considered  valid)  for  this  environment.
  2019.       Character that should be considered suspect include:
  2020.  
  2021.        *  XON (CTRL-S)
  2022.  
  2023.        *  XOFF (CTRL-Q)
  2024.  
  2025.        *  (CTRL-Y)
  2026.  
  2027.        *  (CTRL-C)
  2028.  
  2029.       To be safe, a  tool  writer  should  call  this  procedure  for  every
  2030.       character  that  they  want  to use in the application.  Of course, if
  2031.       appropriately designed, the application should only need to call  this
  2032.       procedure  once  for  each offensive character (probably either at the
  2033.       beginning of the program, or just before the character's first use).
  2034.  
  2035.       3.2.2.7.11.4  Parameters - There is one input parameter,  item,  which
  2036.       identifies  the  character that the user is interested in checking.  A
  2037.       boolean value is returned.  True indicates that the character is valid
  2038.       and can be used, false indicates that the charater should not be used.
  2039.  
  2040.       3.2.2.7.11.5  Local Constants, Types, And Variables - TBD.
  2041.  
  2042.       3.2.2.7.11.6  Errors - The scroll terminal may not  have  been  opened
  2043.       prior to calling this procedure.
  2044.  
  2045.       3.2.2.7.11.7  Exceptions - If the scroll terminal has not been  opened
  2046.       previously to this then the exception uninitialized will be raised.
  2047.  
  2048.       3.2.2.7.11.8  The Ada Source -
  2049.  
  2050.       FUNCTION valid_character( item : IN character ) RETURN boolean;
  2051.  
  2052. REQUIREMENTS                                                       Page 3-28
  2053. Getting Data From The Keyboard                                     16 Nov 84
  2054.  
  2055.  
  2056.       3.2.2.7.12  Getting Data From The Keyboard -
  2057.  
  2058.       3.2.2.7.12.1  Introduction - This procedure is called to get  all  the
  2059.       data  typed at the keyboard since the last call on scroll_terminal.get
  2060.       or since the virtual terminal was opened.
  2061.  
  2062.       3.2.2.7.12.2  The Object Name - get
  2063.  
  2064.       3.2.2.7.12.3  Abstract - When scroll_terminal.get is called  the  keys
  2065.       that the user struck at the actual terminal keyboard since the virtual
  2066.       terminal was opened, or since the last call to scroll_terminal.get are
  2067.       returned.
  2068.  
  2069.       3.2.2.7.12.4  Parameters - A string parameter named data  returns  the
  2070.       string  that  the user typed.  Function/arrow keys that were typed are
  2071.       not embedded in this string, they are identified seperately.  The last
  2072.       position  of  the  string  is  returned  in the parameter last of type
  2073.       natural.  A timeout can be specified of type  duration.   This  allows
  2074.       the  get  to  eventually  timeout  and  return.   A  default  for this
  2075.       parameter is specified as duration'last which is  a  system  dependent
  2076.       value.   Hopefully  it is large enough to effectively mean infinitely.
  2077.       The function/arrow keys are identified by the paramter keys of private
  2078.       limited type function_key_descriptor.
  2079.  
  2080.       Three cases are important:
  2081.  
  2082.       1.  get returns with the parameter last equal to zero, and there  were
  2083.           no  function/arrow  keys  pressed.   This  means that no keys were
  2084.           typed since the last call on get or since the virtual terminal was
  2085.           called.
  2086.  
  2087.       2.  get returns with the parameter last equal to zero, and there  were
  2088.           function/arrow  keys pressed.  This means that only function/arrow
  2089.           keys were pressed since the last call on get or since the  virtual
  2090.           terminal was initialized.
  2091.  
  2092.       3.  get returns with the parameter last not equal to  zero  and  there
  2093.           were  function/arrow  keys pressed.  Here both function/arrow keys
  2094.           and regular keys were pressed.
  2095.  
  2096.       As an example, consider the  case  where  a  user  opens  the  virtual
  2097.       terminal then presses three keys.  First an (say) "a" is pressed, then
  2098.       a function key (say "F1" on some terminal), and finally a (say) "b" is
  2099.       pressed.   The  string  parameter data would have length 2 and contain
  2100.       the characters "a" and "b" as its values.  The  keys  parameter  could
  2101.       then be used to get the function key that was pressed ("F1") by making
  2102.       a call on function_count to get the number of function keys that  were
  2103.       pressed  (this would return a 1).  Then a call on function_key passing
  2104.       in the keys parameter obtained from the call on get with the index set
  2105.       to  1  (the first key struck) will return a key_identifier which is an
  2106.       enumeration of the function key pressed (in this case an f1)  and  the
  2107.       previous_position in the string that was returned from the call on get
  2108.       (in this case it would return a 2).
  2109. REQUIREMENTS                                                       Page 3-29
  2110. Getting Data From The Keyboard                                     16 Nov 84
  2111.  
  2112.  
  2113.       3.2.2.7.12.5  Local Constants, Types, And Variables - TBD
  2114.  
  2115.       3.2.2.7.12.6  Errors - The virtual terminal may not have  been  opened
  2116.       prior to calling this procedure.
  2117.  
  2118.       3.2.2.7.12.7  Exceptions - If the virtual terminal has not been opened
  2119.       previously  to  this  then the exception scroll_terminal.uninitialized
  2120.       will be raised.
  2121.  
  2122.       3.2.2.7.12.8  The Ada Source -
  2123.  
  2124.       PROCEDURE get( data : OUT string;  
  2125.                      last : OUT natural;
  2126.                      keys : OUT function_key_descriptor;
  2127.                   timeout : IN duration := duration'last );
  2128.  
  2129. REQUIREMENTS                                                       Page 3-30
  2130. Getting The Specified Function/Arrow Key From The List             16 Nov 84
  2131.  
  2132.  
  2133.       3.2.2.7.13  Getting The Specified Function/Arrow Key From The List -
  2134.  
  2135.       3.2.2.7.13.1  Introduction - This  procedure  is  called  to  get  the
  2136.       specified function/arrow key from the list of function/arrow keys that
  2137.       were returned from a call on scroll_terminal.get.
  2138.  
  2139.       3.2.2.7.13.2  The Object Name - function_key
  2140.  
  2141.       3.2.2.7.13.3  Abstract - As     described     in     the     procedure
  2142.       scroll_terminal.get,  this procedure returns a key_identifier that has
  2143.       a value of type function_key_enum identifying the  function/arrow  key
  2144.       that  corresponds  to the index parameter in the list of function keys
  2145.       identified by the keys parameter.  This procedure is called repeatedly
  2146.       to process the function/arrow keys varying index (usually in ascending
  2147.       numerical order).
  2148.  
  2149.       3.2.2.7.13.4  Parameters - The parameters are:
  2150.  
  2151.       1.  keys   -   the    value    of    the    private    limited    type
  2152.           function_key_descriptor   that   was   returned  from  a  call  on
  2153.           scroll_terminal.get.  This is a user variable.  A  user  may  have
  2154.           more  than one of these variables, and consequently, identify more
  2155.           than one list of function/arrow keys.
  2156.  
  2157.       2.  index - the number of  the  function/arrow  key  in  the  list  of
  2158.           function/arrow  keys  identified  by  the parameter keys, that the
  2159.           user is interested in.
  2160.  
  2161.       3.  key_identifier - returns an enumerated type which  identifies  the
  2162.           function/arrow key as described in the terminal capabilities file.
  2163.  
  2164.       4.  previous_position - a position in the  string  that  was  returned
  2165.           from  a  call  on  scroll_terminal.get.   This position is the one
  2166.           immediately before the  function/arrow  key  was  pressed.   Three
  2167.           cases are important:
  2168.  
  2169.           a.  the function/arrow key was pressed before  any  of  the  other
  2170.               keys.  In this case previous_position would return a zero.
  2171.  
  2172.           b.  the functon key was the last key pressed.  In  this  case  the
  2173.               value returned would be the same as last.
  2174.  
  2175.           c.  the function/arrow key  was  pressed  in  the  middle  of  the
  2176.               string.   In  this  case  the  character  position  before the
  2177.               function/arrow key would be returned.
  2178.  
  2179.  
  2180.       An example.  Consider the case where a character "a" was pressed, then
  2181.       function key "F9" (as defined in the terminal capabilities file), then
  2182.       the key "b".  scroll_terminal.get would return
  2183.  
  2184.       data  =  "ab"
  2185.       last  =  2
  2186.       a reference to keys
  2187. REQUIREMENTS                                                       Page 3-31
  2188. Getting The Specified Function/Arrow Key From The List             16 Nov 84
  2189.  
  2190.  
  2191.  
  2192.       When scroll_terminal.function_key is called and passed  the  reference
  2193.       to  keys  and  the  index = 1, then key_identifier would return f9 and
  2194.       previous_position would return 1.
  2195.  
  2196.       3.2.2.7.13.5  Local Constants, Types, And Variables - TBD.
  2197.  
  2198.       3.2.2.7.13.6  Errors - The virtual terminal may not have  been  opened
  2199.       prior   to   calling   this  procedure.   The  index  may  indicate  a
  2200.       function/arrow key that is illegal.
  2201.  
  2202.       3.2.2.7.13.7  Exceptions - If the virtual terminal has not been opened
  2203.       previously  to  this  then the exception scroll_terminal.uninitialized
  2204.       will be raised.  The exception invalid_function_key may be raised from
  2205.       this procedure.
  2206.  
  2207.       3.2.2.7.13.8  The Ada Source -
  2208.  
  2209.       PROCEDURE function_key(keys           : IN     function_key_descriptor;
  2210.                              index          : IN     positive;
  2211.                              key_identifier :    OUT function_key_enum;
  2212.                           previous_position :    OUT natural);
  2213.  
  2214. REQUIREMENTS                                                       Page 3-32
  2215. Getting The Name Of A Function Key                                 16 Nov 84
  2216.  
  2217.  
  2218.       3.2.2.7.14  Getting The Name Of A Function Key -
  2219.  
  2220.       3.2.2.7.14.1  Introduction - The procedure is called to get  the  name
  2221.       of the function key (as it appears on the actual terminal keyboard).
  2222.  
  2223.       3.2.2.7.14.2  The Object Name - function_key_name
  2224.  
  2225.       3.2.2.7.14.3  Abstract - This procedure returns a string that  is  the
  2226.       name  of  the  function  key.   This information is extracted from the
  2227.       terminal capabilities database when the virtual terminal is opened and
  2228.       stored in the tcf package data structures.
  2229.  
  2230.       3.2.2.7.14.4  Parameters - The parameters are:
  2231.  
  2232.       1.  key_identifier - a  value  of  enumerated  type  function_key_enum
  2233.           which identifies the function key of interest.
  2234.  
  2235.       2.  key_name - a string which is the function key name as  it  appears
  2236.           in the terminal capabilities file (exactly).
  2237.  
  2238.       3.  last - a natural number which is the last  character  position  in
  2239.           the key_name.
  2240.  
  2241.       This version of the terminal capabilities file limits  the  number  of
  2242.       function keys to 32 (plus the four arrow keys).
  2243.  
  2244.       3.2.2.7.14.5  Local Constants, Types, And Variables - TBD.
  2245.  
  2246.       3.2.2.7.14.6  Errors - The virtual terminal may not have  been  opened
  2247.       prior to calling this procedure.
  2248.  
  2249.       3.2.2.7.14.7  Exceptions - If the virtual terminal has not been opened
  2250.       previously  to  this  then the exception scroll_terminal.uninitialized
  2251.       will be raised.
  2252.  
  2253.       3.2.2.7.14.8  The Ada Source -
  2254.  
  2255.       PROCEDURE function_key_name
  2256.           key_identifier : IN     positive;
  2257.           key_name       :    OUT string;
  2258.           last           :    OUT natural);
  2259.  
  2260. REQUIREMENTS                                                       Page 3-33
  2261. Ringing The Terminal Bell                                          16 Nov 84
  2262.  
  2263.  
  2264.       3.2.2.7.15  Ringing The Terminal Bell -
  2265.  
  2266.       3.2.2.7.15.1  Introduction - Bell causes the actual terminal's bell to
  2267.       ring.
  2268.  
  2269.       3.2.2.7.15.2  The Object Name - bell
  2270.  
  2271.       3.2.2.7.15.3  Abstract - Scroll_terminal.bell    will    cause     the
  2272.       terminal's bell to ring immediately when called.  There is no implicit
  2273.       update_line performed.  If the user has defined the bell field in  the
  2274.       terminal  capabilities  file, then that sequence will be output to the
  2275.       terminal.
  2276.  
  2277.       3.2.2.7.15.4  Parameters - None.
  2278.  
  2279.       3.2.2.7.15.5  Local Constants, Types, And Variables - TBD.
  2280.  
  2281.       3.2.2.7.15.6  Errors - The scroll terminal may not  have  been  opened
  2282.       prior to calling this procedure.
  2283.  
  2284.       3.2.2.7.15.7  Exceptions - If the scroll terminal has not been  opened
  2285.       previously to this then the exception uninitialized will be raised.
  2286.  
  2287.       3.2.2.7.15.8  The Ada Source -
  2288.  
  2289.       PROCEDURE bell;
  2290.  
  2291.  
  2292.       3.2.2.8  Errors - As above in the individual sections.
  2293.  
  2294.       3.2.2.9  Exceptions - As above in the individual sections.
  2295.  
  2296.       3.2.2.10  The Ada Source -
  2297.  
  2298.       PACKAGE scroll_terminal IS
  2299.  
  2300.           TYPE function_key_enum IS
  2301.             ( up_arrow,       down_arrow,     left_arrow,     right_arrow,
  2302.               f1,     f2,     f3,     f4,     f5,     f6,     f7,     f8,
  2303.               f9,     f10,    f11,    f12,    f13,    f14,    f15,    f16,
  2304.               f17,    f18,    f19,    f20,    f21,    f22,    f23,    f24,
  2305.               f25,    f26,    f27,    f28,    f29,    f30,    f31,    f32 );
  2306.  
  2307.           TYPE function_key_descriptor IS LIMITED PRIVATE;
  2308.  
  2309.           PROCEDURE open (name     : IN OUT string );
  2310.  
  2311.           PROCEDURE close;
  2312.  
  2313.           PROCEDURE set_position (position : IN     positive);
  2314.  
  2315.           FUNCTION  position RETURN positive;
  2316.  
  2317.           FUNCTION  size RETURN positive;
  2318. REQUIREMENTS                                                       Page 3-34
  2319. The Ada Source                                                     16 Nov 84
  2320.  
  2321.  
  2322.  
  2323.           PROCEDURE set_tab;
  2324.           PROCEDURE clear_tab;
  2325.  
  2326.           PROCEDURE tab       (count    : IN     positive := 1);
  2327.  
  2328.           PROCEDURE new_line  (count    : IN     positive := 1);
  2329.  
  2330.           PROCEDURE new_page  (count    : IN     positive := 1);
  2331.  
  2332.           PROCEDURE put (item     : IN     character);
  2333.           PROCEDURE put (item     : IN     string);
  2334.  
  2335.           PROCEDURE update_line;
  2336.  
  2337.           FUNCTION valid_character( item : IN character ) RETURN boolean;
  2338.  
  2339.           PROCEDURE get( data : OUT string;  
  2340.                          last : OUT natural;
  2341.                          keys : OUT function_key_descriptor;
  2342.                       timeout : IN  duration := duration'last );
  2343.  
  2344.           FUNCTION function_count(keys : IN function_key_descriptor)
  2345.               RETURN natural;
  2346.  
  2347.           PROCEDURE function_key(keys           : IN     function_key_descriptor;
  2348.                                  index          : IN     positive;
  2349.                                  key_identifier :    OUT function_key_enum;
  2350.                               previous_position :    OUT natural);
  2351.  
  2352.           PROCEDURE function_key_name
  2353.               key_identifier : IN     function_key_enum;
  2354.               key_name       :    OUT string;
  2355.               last           :    OUT natural);
  2356.  
  2357.           PROCEDURE bell;
  2358.  
  2359.  
  2360.  
  2361.           uninitialized        : EXCEPTION;
  2362.           name_error           : EXCEPTION;
  2363.           tcf_error            : EXCEPTION;
  2364.           unsupported_terminal : EXCEPTION;
  2365.           invalid_function_key : EXCEPTION;
  2366.  
  2367.           PRIVATE
  2368.  
  2369.               TYPE funtion_key_descriptor IS positive;
  2370.               
  2371.  
  2372.       END scroll_terminal;
  2373.  
  2374. REQUIREMENTS                                                       Page 3-35
  2375. The Page Terminal Package                                          16 Nov 84
  2376.  
  2377.  
  2378.       3.2.3  The Page Terminal Package
  2379.  
  2380.       3.2.3.1  Introduction - This  package  provides  a  device-independent
  2381.       page-terminal interface to a user's program.
  2382.  
  2383.       3.2.3.2  The Object Name - page_terminal
  2384.  
  2385.       3.2.3.3  Abstract - A  user's  program  can  "WITH"  this  package  to
  2386.       provide  a  device-independent terminal interface that is functionally
  2387.       equivalent to a page-terminal.  This is  the  most  advanced  form  of
  2388.       terminal  that this virtual terminal supports.  This package should be
  2389.       chosen for any of the following reasons:
  2390.  
  2391.       1.  The user's  terminal  has  advanced  features.   The  terminal  is
  2392.           directly  addressable, with erase to end of line, and erase to end
  2393.           of screen capabilities.
  2394.  
  2395.       2.  The user wants advanced capabilities and is willing  to  sacrifice
  2396.           some transportability.
  2397.  
  2398.  
  2399.       3.2.3.4  Parameters - None.
  2400.  
  2401.       3.2.3.5  Local Constants, Types, And Variables - The  following  types
  2402.       are defined in this package:
  2403.  
  2404.       1.  function_key_enum - an enumerated type defines the  4  arrow  keys
  2405.           and 32 function keys.
  2406.  
  2407.       2.  function_key_descriptor  -  a  limited  private  type   (of   type
  2408.           positive).   This  type  is used to traverse the function key list
  2409.           whose reference is returned from a call to page_terminal.get  (see
  2410.           below).   The  user  must  define a variable of this type (or more
  2411.           than one)  in  order  to  use  the  function  key  procedures  and
  2412.           functions.
  2413.  
  2414.       3.  xy_position -  a  record  with  a  line  component  and  a  column
  2415.           component.   Each  of  these  is  of  type  positive.   This  type
  2416.           identifies a position on the display.
  2417.  
  2418.       4.  select_enumeration - an enumerated type that identifies the  range
  2419.           that a delete operation will affect.
  2420.  
  2421.       5.  graphic_rendition - an enumerated type that identifies  a  graphic
  2422.           rendition  (either  primary,  reverse,  or  none)  that  a  single
  2423.           position in the virtual display will have.
  2424.  
  2425.           The   enumerated    type    function_key_enum    identifies    the
  2426.           function/arrow  keys  that  are  used  in  the  function/arrow key
  2427.           handling procedures and functions.
  2428.  
  2429. REQUIREMENTS                                                       Page 3-36
  2430. Selectors (Functions)                                              16 Nov 84
  2431.  
  2432.  
  2433.       3.2.3.6  Selectors (Functions) -
  2434. REQUIREMENTS                                                       Page 3-37
  2435. Determining The Active Position                                    16 Nov 84
  2436.  
  2437.  
  2438.       3.2.3.6.1  Determining The Active Position -
  2439.  
  2440.       3.2.3.6.1.1  Introduction - This function is called to  get  the  line
  2441.       and column that the active position is on.
  2442.  
  2443.       3.2.3.6.1.2  The Object Name - position
  2444.  
  2445.       3.2.3.6.1.3  Abstract - Page_terminal.position returns  a  line/column
  2446.       pair  of type xy_position that identifies where the active position is
  2447.       located in the virtual terminal.  It should be noted that this is  NOT
  2448.       where the cursor is located on the actual terminal's screen.
  2449.  
  2450.       3.2.3.6.1.4  Parameters - None.
  2451.  
  2452.       3.2.3.6.1.5  Local Constants, Types, And Variables - TBD.
  2453.  
  2454.       3.2.3.6.1.6  Errors - The page terminal may not have been opened prior
  2455.       to calling this function.
  2456.  
  2457.       3.2.3.6.1.7  Exceptions - If the page terminal  has  not  been  opened
  2458.       previously to this then the exception uninitialized will be raised.
  2459.  
  2460.       3.2.3.6.1.8  The Ada Source -
  2461.  
  2462.       FUNCTION  position RETURN xy_position;
  2463.  
  2464. REQUIREMENTS                                                       Page 3-38
  2465. Determining The Size Of The Display                                16 Nov 84
  2466.  
  2467.  
  2468.       3.2.3.6.2  Determining The Size Of The Display -
  2469.  
  2470.       3.2.3.6.2.1  Introduction - This function is called to  determine  the
  2471.       size of the actual display.
  2472.  
  2473.       3.2.3.6.2.2  The Object Name - size
  2474.  
  2475.       3.2.3.6.2.3  Abstract - Page_terminal.size  returns  the   number   of
  2476.       columns  and  number  of  lines contained in the actual display.  This
  2477.       information is located in the terminal capabilities file  and  can  be
  2478.       set and altered by the user.
  2479.  
  2480.       3.2.3.6.2.4  Parameters - None.
  2481.  
  2482.       3.2.3.6.2.5  Local Constants, Types, And Variables - TBD.
  2483.  
  2484.       3.2.3.6.2.6  Errors - The page terminal may not have been opened prior
  2485.       to calling this function.
  2486.  
  2487.       3.2.3.6.2.7  Exceptions - If the page terminal  has  not  been  opened
  2488.       previously to this then the exception uninitialized will be raised.
  2489.  
  2490.       3.2.3.6.2.8  The Ada Source -
  2491.  
  2492.       FUNCTION  size RETURN xy_position;
  2493.  
  2494. REQUIREMENTS                                                       Page 3-39
  2495. Determining The Validity Of A Character                            16 Nov 84
  2496.  
  2497.  
  2498.       3.2.3.6.3  Determining The Validity Of A Character -
  2499.  
  2500.       3.2.3.6.3.1  Introduction - This  procedure  is  called  to  determine
  2501.       whether  a  particular  character  can  be  considered  valid for this
  2502.       environment.
  2503.  
  2504.       3.2.3.6.3.2  The Object Name - valid_character
  2505.  
  2506.       3.2.3.6.3.3  Abstract - Page_terminal.valid_character  is  called   to
  2507.       check  if  the  character specified in the input parameter is one that
  2508.       can be used (and therefore considered  valid)  for  this  environment.
  2509.       Character that should be considered suspect include:
  2510.  
  2511.        *  XON (CTRL-S)
  2512.  
  2513.        *  XOFF (CTRL-Q)
  2514.  
  2515.        *  (CTRL-Y)
  2516.  
  2517.        *  (CTRL-C)
  2518.  
  2519.       To be safe, a  tool  writer  should  call  this  procedure  for  every
  2520.       character  that  they  want  to use in the application.  Of course, if
  2521.       appropriately designed, the application should only need to call  this
  2522.       procedure  once  for  each offensive character (probably either at the
  2523.       beginning of the program, or just before the character's first use).
  2524.  
  2525.       3.2.3.6.3.4  Parameters - There is one input  parameter,  item,  which
  2526.       identifies  the  character that the user is interested in checking.  A
  2527.       boolean value is returned.  True indicates that the character is valid
  2528.       and can be used, false indicates that the charater should not be used.
  2529.  
  2530.       3.2.3.6.3.5  Local Constants, Types, And Variables - TBD.
  2531.  
  2532.       3.2.3.6.3.6  Errors - The page terminal may not have been opened prior
  2533.       to calling this procedure.
  2534.  
  2535.       3.2.3.6.3.7  Exceptions - If the page terminal  has  not  been  opened
  2536.       previously to this then the exception uninitialized will be raised.
  2537.  
  2538.       3.2.3.6.3.8  The Ada Source -
  2539.  
  2540.       FUNCTION valid_character( item : IN character ) RETURN boolean;
  2541.  
  2542. REQUIREMENTS                                                       Page 3-40
  2543. Getting The Number Of Typed Function/Arrow Keys                    16 Nov 84
  2544.  
  2545.  
  2546.       3.2.3.6.4  Getting The Number Of Typed Function/Arrow Keys -
  2547.  
  2548.       3.2.3.6.4.1  Introduction - This function is called to get the  number
  2549.       of   function/arrow   keys   that   were   returned  from  a  call  on
  2550.       page_terminal.get.
  2551.  
  2552.       3.2.3.6.4.2  The Object Name - function_count
  2553.  
  2554.       3.2.3.6.4.3  Abstract - A value  is  returned  of  type  natural  that
  2555.       identifies the number of function/arrow keys that were typed since the
  2556.       last call on page_terminal.get.  There is a 20 key limit on the number
  2557.       of  function/arrow  keys that can be buffered.  If the number returned
  2558.       is zero then no function/arrow keys were typed since the last call  on
  2559.       page_terminal.get.
  2560.  
  2561.       3.2.3.6.4.4  Parameters - The  single  input  parameter  keys  is  the
  2562.       limited  private  type  returned  from  the call on page_terminal.get.
  2563.       This identifies the specific list of function/arrow keys that will  be
  2564.       operated on by this function.
  2565.  
  2566.       3.2.3.6.4.5  Local Constants, Types, And Variables - TBD
  2567.  
  2568.       3.2.3.6.4.6  Errors - The virtual terminal may not  have  been  opened
  2569.       prior to calling this procedure.
  2570.  
  2571.       3.2.3.6.4.7  Exceptions - If the virtual terminal has not been  opened
  2572.       previously to this then the exception page_terminal.uninitialized will
  2573.       be raised.
  2574.  
  2575.       3.2.3.6.4.8  The Ada Source -
  2576.  
  2577.       FUNCTION function_count(keys : IN function_key_descriptor)
  2578.           RETURN natural;
  2579.  
  2580. REQUIREMENTS                                                       Page 3-41
  2581. Actors (Procedures)                                                16 Nov 84
  2582.  
  2583.  
  2584.       3.2.3.7  Actors (Procedures) -
  2585.  
  2586.       3.2.3.7.1  Opening A Page Terminal -
  2587.  
  2588.       3.2.3.7.1.1  Introduction - This procedure is called to open the  page
  2589.       terminal.
  2590.  
  2591.       3.2.3.7.1.2  The Object Name - open
  2592.  
  2593.       3.2.3.7.1.3  Abstract - Page_terminal.open  is   called   to   perform
  2594.       initialization  and define a page-mode virtual terminal for the user's
  2595.       program to make use of.  This initialization consists of:
  2596.  
  2597.       1.  defining the necessary data structures within the virtual terminal
  2598.           to support a page terminal.
  2599.  
  2600.       2.  calling the  driver  package  and  initializing  the  needed  data
  2601.           structures from the terminal capabilities file.
  2602.  
  2603.       3.  raising the necessary exceptions if the page terminal could not be
  2604.           opened.
  2605.  
  2606.  
  2607.       3.2.3.7.1.4  Parameters - The name parameter contains the name of  the
  2608.       actual  terminal  that  the user is interfacing with.  This may change
  2609.       from one invocation of the program to another.  This name  must  match
  2610.       exactly  (string  and  case)  with the terminal name as defined in the
  2611.       terminal capabilities file.
  2612.  
  2613.       If the string parameter is of length zero then  the  virtual  terminal
  2614.       will  attempt  to  find  the  terminal name through a system dependent
  2615.       manner.  This will be performed through a call to a procedure  in  the
  2616.       package  SYSDEP.  If the terminal name can be determined, then it will
  2617.       be returned from this call in the name parameter.
  2618.  
  2619.       The page terminal may have been previously opened.  In this  case  the
  2620.       terminal  is  implicitly closed and reopened.  No implicit update will
  2621.       be performed before the close operation.
  2622.  
  2623.       3.2.3.7.1.5  Local Constants, Types, And Variables - TBD.
  2624.  
  2625.       3.2.3.7.1.6  Errors - Errors include:
  2626.  
  2627.       1.  passing  in  a  name  that  does  not  appear  in   the   terminal
  2628.           capabilities file.
  2629.  
  2630.       2.  if the terminal capabilities file is not available to read.
  2631.  
  2632.       3.  if the terminal does not have the needed capabilities to be a page
  2633.           terminal.
  2634.  
  2635. REQUIREMENTS                                                       Page 3-42
  2636. Opening A Page Terminal                                            16 Nov 84
  2637.  
  2638.  
  2639.       3.2.3.7.1.7  Exceptions - The exceptions raised are (respectively):
  2640.  
  2641.        *  name_error
  2642.  
  2643.        *  tcf_error
  2644.  
  2645.        *  unsupported_terminal
  2646.  
  2647.  
  2648.       3.2.3.7.1.8  The Ada Source -
  2649.  
  2650.       PROCEDURE open (name     : IN OUT string);
  2651.  
  2652. REQUIREMENTS                                                       Page 3-43
  2653. Closing A Page Terminal                                            16 Nov 84
  2654.  
  2655.  
  2656.       3.2.3.7.2  Closing A Page Terminal -
  2657.  
  2658.       3.2.3.7.2.1  Introduction - This procedure is called to close the page
  2659.       terminal.
  2660.  
  2661.       3.2.3.7.2.2  The Object Name - close
  2662.  
  2663.       3.2.3.7.2.3  Abstract - Page_terminal.close   closes    the    virtual
  2664.       terminal.   If  the  virtual  terminal  was  already  closed,  then no
  2665.       operation will occur.
  2666.  
  2667.       3.2.3.7.2.4  Parameters - None.
  2668.  
  2669.       3.2.3.7.2.5  Local Constants, Types, And Variables - TBD.
  2670.  
  2671.       3.2.3.7.2.6  Errors - None.
  2672.  
  2673.       3.2.3.7.2.7  Exceptions - None.
  2674.  
  2675.       3.2.3.7.2.8  The Ada Source -
  2676.  
  2677.       PROCEDURE close;
  2678.  
  2679. REQUIREMENTS                                                       Page 3-44
  2680. Setting The Current Position                                       16 Nov 84
  2681.  
  2682.  
  2683.       3.2.3.7.3  Setting The Current Position -
  2684.  
  2685.       3.2.3.7.3.1  Introduction - This  procedure  is  called  to  set   the
  2686.       current position (line and column) on the virtual terminal display.
  2687.  
  2688.       3.2.3.7.3.2  The Object Name - set_position
  2689.  
  2690.       3.2.3.7.3.3  Abstract - Page_terminal.set_position   will   move   the
  2691.       active position in the virtual terminal display to the new coordinates
  2692.       given in the parameter list.  A call on this procedure does not affect
  2693.       the  actual terminal's display, only the virtual representation of the
  2694.       display.  Wrapping occurs if the parameter contains a  value  that  is
  2695.       outside the actual screen dimensions.
  2696.  
  2697.       3.2.3.7.3.4  Parameters - This procedure has one parameter,  position,
  2698.       which  identifies  the line and column that the active position should
  2699.       be moved to.
  2700.  
  2701.       3.2.3.7.3.5  Local Constants, Types, And Variables - TBD.
  2702.  
  2703.       3.2.3.7.3.6  Errors - The scroll terminal may  not  have  been  opened
  2704.       prior to calling this procedure.
  2705.  
  2706.       3.2.3.7.3.7  Exceptions - If the scroll terminal has not  been  opened
  2707.       previously to this then the exception uninitialized will be raised.
  2708.  
  2709.       3.2.3.7.3.8  The Ada Source -
  2710.  
  2711.       PROCEDURE set_position (position : IN     xy_position);
  2712.  
  2713. REQUIREMENTS                                                       Page 3-45
  2714. Deleting A Character                                               16 Nov 84
  2715.  
  2716.  
  2717.       3.2.3.7.4  Deleting A Character -
  2718.  
  2719.       3.2.3.7.4.1  Introduction - This  procedure  is   called   to   delete
  2720.       characters starting at the active position.
  2721.  
  2722.       3.2.3.7.4.2  The Object Name - delete_character
  2723.  
  2724.       3.2.3.7.4.3  Abstract - Page_terminal.delete_character will delete the
  2725.       number of characters specified in the input parameter from the virtual
  2726.       display.  The characters that are deleted include the  character  that
  2727.       the  active  position  is on and all characters to the right for up to
  2728.       the  parameter  count.   Characters  to  the  right  of  the   deleted
  2729.       characters that are on the same line are moved to the left to fill the
  2730.       space of the deleted characters.  If  more  characters  are  specified
  2731.       than  character positions left on the line, then only those characters
  2732.       left on the line will be deleted.
  2733.  
  2734.       3.2.3.7.4.4  Parameters - The number of characters to  be  deleted  is
  2735.       specified  in  the  input  parameter  count.   Count  defaults  to one
  2736.       character.
  2737.  
  2738.       3.2.3.7.4.5  Local Constants, Types, And Variables - TBD.
  2739.  
  2740.       3.2.3.7.4.6  Errors - The scroll terminal may  not  have  been  opened
  2741.       prior to calling this procedure.
  2742.  
  2743.       3.2.3.7.4.7  Exceptions - If the scroll terminal has not  been  opened
  2744.       previously to this then the exception uninitialized will be raised.
  2745.  
  2746.       3.2.3.7.4.8  The Ada Source -
  2747.  
  2748.       PROCEDURE delete_character (count    : IN     positive := 1);
  2749.  
  2750. REQUIREMENTS                                                       Page 3-46
  2751. Deleting A Line                                                    16 Nov 84
  2752.  
  2753.  
  2754.       3.2.3.7.5  Deleting A Line -
  2755.  
  2756.       3.2.3.7.5.1  Introduction - This procedure is called to  delete  lines
  2757.       from the virtual display.
  2758.  
  2759.       3.2.3.7.5.2  The Object Name - delete_line
  2760.  
  2761.       3.2.3.7.5.3  Abstract - Page_terminal.delete_line  will   delete   the
  2762.       number  of  lines  specified  in  the input parameter from the virtual
  2763.       display starting at the active position  and  proceding  downward.   A
  2764.       call  on  this  procedure will not affect the actual display, only the
  2765.       virtual representation of the  display.   The  lines  below  the  line
  2766.       containing  the  active  position  will  move upward to fill the space
  2767.       deleted.  If the number of lines specified in the input  parameter  is
  2768.       more  than  the  number  of  lines left on the display then only those
  2769.       lines left on the display will be deleted.  If the active position  is
  2770.       located  in  the  middle of the line, then after the delete the active
  2771.       position will be left at the left margin of the virtual display on the
  2772.       line that moved up to replace the deleted lines.
  2773.  
  2774.       3.2.3.7.5.4  Parameters - The  input  parameter  count  contains   the
  2775.       number of lines that will be deleted.  The default is 1.
  2776.  
  2777.       3.2.3.7.5.5  Local Constants, Types, And Variables - TBD.
  2778.  
  2779.       3.2.3.7.5.6  Errors - The scroll terminal may  not  have  been  opened
  2780.       prior to calling this procedure.
  2781.  
  2782.       3.2.3.7.5.7  Exceptions - If the scroll terminal has not  been  opened
  2783.       previously to this then the exception uninitialized will be raised.
  2784.  
  2785.       3.2.3.7.5.8  The Ada Source -
  2786.  
  2787.       PROCEDURE delete_line      (count    : IN     positive := 1);
  2788.  
  2789. REQUIREMENTS                                                       Page 3-47
  2790. Erasing Areas In The Display                                       16 Nov 84
  2791.  
  2792.  
  2793.       3.2.3.7.6  Erasing Areas In The Display -
  2794.  
  2795.       3.2.3.7.6.1  Introduction - This procedure is called to erase areas in
  2796.       the display.
  2797.  
  2798.       3.2.3.7.6.2  The Object Name - erase_in_display
  2799.  
  2800.       3.2.3.7.6.3  Abstract - Page_terminal.erase_in_display  is  called  to
  2801.       erase areas in the virtual display.  The areas that can be erased are:
  2802.  
  2803.       1.  entire display,
  2804.  
  2805.       2.  from current position to end of display,
  2806.  
  2807.       3.  from beginning of display to active position.
  2808.  
  2809.       Again, remeber, this procedure only affects the virtual representation
  2810.       of  the  display not the actual display.  If the active position is at
  2811.       the end of the virtual display and a call is made to erase to  end  of
  2812.       display,  no  operation  will occur.  If the active position is at the
  2813.       beginning of the display and a call is made to erase from beginning of
  2814.       the display to the active position, no operation will occur.
  2815.  
  2816.       3.2.3.7.6.4  Parameters - The single input parameter selection of type
  2817.       select_enum  is  used  to  select  which  of  the three types of erase
  2818.       (listed above) are used.
  2819.  
  2820.       3.2.3.7.6.5  Local Constants, Types, And Variables - TBD.
  2821.  
  2822.       3.2.3.7.6.6  Errors - The page terminal may not have been opened prior
  2823.       to calling this procedure.
  2824.  
  2825.       3.2.3.7.6.7  Exceptions - If the page terminal  has  not  been  opened
  2826.       previously to this then the exception uninitialized will be raised.
  2827.  
  2828.       3.2.3.7.6.8  The Ada Source -
  2829.  
  2830.       PROCEDURE erase_in_display (selection : select_enumeration);
  2831.  
  2832. REQUIREMENTS                                                       Page 3-48
  2833. Erasing Areas In Lines                                             16 Nov 84
  2834.  
  2835.  
  2836.       3.2.3.7.7  Erasing Areas In Lines -
  2837.  
  2838.       3.2.3.7.7.1  Introduction - This procedure is called to erase areas in
  2839.       the virtual display's lines.
  2840.  
  2841.       3.2.3.7.7.2  The Object Name - erase_in_line
  2842.  
  2843.       3.2.3.7.7.3  Abstract - Page_terminal.erase_in_line  causes  areas  in
  2844.       the  line  containing  the  active  position to be erased.  This erase
  2845.       operation can take three forms:
  2846.  
  2847.       1.  erase the entire line,
  2848.  
  2849.       2.  erase from the active position to the end of the line,
  2850.  
  2851.       3.  erase from the beginning of the line to the active position.
  2852.  
  2853.       The erase operation leaves the active position where  it  was  located
  2854.       before  the  erase  operation  was  called.   It  effective causes the
  2855.       correct amount of blanks to be written to the screen to erase the area
  2856.       requested.  If the active position is at the beginning of the line and
  2857.       the area requested was from the beginning of the line  to  the  active
  2858.       position, then no operation will occur.  If the active position was at
  2859.       the end of the line  and  the  area  requested  was  from  the  active
  2860.       position  to  the  end  of  the line then no operation will occur.  If
  2861.       erase entire line is selected the cursor  will  remain  where  it  was
  2862.       before the operation occured and the line will be erased.
  2863.  
  2864.       3.2.3.7.7.4  Parameters - The single input parameter selection of type
  2865.       select_enum  is  used  to  select  which  of  the three types of erase
  2866.       (listed above) are used.
  2867.  
  2868.       3.2.3.7.7.5  Local Constants, Types, And Variables - TBD.
  2869.  
  2870.       3.2.3.7.7.6  Errors - The page terminal may not have been opened prior
  2871.       to calling this procedure.
  2872.  
  2873.       3.2.3.7.7.7  Exceptions - If the page terminal  has  not  been  opened
  2874.       previously to this then the exception uninitialized will be raised.
  2875.  
  2876.       3.2.3.7.7.8  The Ada Source -
  2877.  
  2878.       PROCEDURE erase_in_line    (selection : select_enumeration);
  2879.  
  2880. REQUIREMENTS                                                       Page 3-49
  2881. Entering Insert Character Mode                                     16 Nov 84
  2882.  
  2883.  
  2884.       3.2.3.7.8  Entering Insert Character Mode -
  2885.  
  2886.       3.2.3.7.8.1  Introduction - This procedure  is  called  to  enter  the
  2887.       insert character mode for the line containing the active position.
  2888.  
  2889.       3.2.3.7.8.2  The Object Name - enter_insert_mode
  2890.  
  2891.       3.2.3.7.8.3  Abstract - Page_terminal.enter_insert_mode         causes
  2892.       characters  entered  to  push  the  characters that follow on the line
  2893.       containing the active position to the right.  For example, if  a  line
  2894.       contains:
  2895.  
  2896.            a b c d
  2897.                | active position located here
  2898.  
  2899.       A call  on  page_terminal.enter_insert_mode  followed  by  a  call  on
  2900.       page_terminal.put  (say  the string was "test" would cause the line to
  2901.       look like:
  2902.  
  2903.           a b t e s t c d
  2904.                       | active position now here
  2905.  
  2906.       If the inserting of characters pushes characters off the  end  of  the
  2907.       line,  then  those  characters pushed off the end are lost.  If insert
  2908.       mode was already in effect then no operation will occur.
  2909.  
  2910.       3.2.3.7.8.4  Parameters - None.
  2911.  
  2912.       3.2.3.7.8.5  Local Constants, Types, And Variables - TBD.
  2913.  
  2914.       3.2.3.7.8.6  Errors - The page terminal may not have been opened prior
  2915.       to calling this procedure.
  2916.  
  2917.       3.2.3.7.8.7  Exceptions - If the page terminal  has  not  been  opened
  2918.       previously to this then the exception uninitialized will be raised.
  2919.  
  2920.       3.2.3.7.8.8  The Ada Source -
  2921.  
  2922.       PROCEDURE enter_insert_mode;
  2923.  
  2924. REQUIREMENTS                                                       Page 3-50
  2925. Exiting Insert Character Mode                                      16 Nov 84
  2926.  
  2927.  
  2928.       3.2.3.7.9  Exiting Insert Character Mode -
  2929.  
  2930.       3.2.3.7.9.1  Introduction - This procedure is called  to  exit  insert
  2931.       character mode.
  2932.  
  2933.       3.2.3.7.9.2  The Object Name - exit_insert_mode
  2934.  
  2935.       3.2.3.7.9.3  Abstract - Page_terminal.exit_insert_mode  is  called  to
  2936.       exit  insert  character mode.  Calls to page_terminal.put will replace
  2937.       the existing characters at the active position on the virtual  display
  2938.       after page_terminal.exit_insert_mode is called.  If insert mode is not
  2939.       on (a previous call to page_terminal.enter_insert-mode  was  made)  no
  2940.       operation will occur.
  2941.  
  2942.       3.2.3.7.9.4  Parameters - None.
  2943.  
  2944.       3.2.3.7.9.5  Local Constants, Types, And Variables - TBD.
  2945.  
  2946.       3.2.3.7.9.6  Errors - The page terminal may not have been opened prior
  2947.       to calling this procedure.
  2948.  
  2949.       3.2.3.7.9.7  Exceptions - If the page terminal  has  not  been  opened
  2950.       previously to this then the exception uninitialized will be raised.
  2951.  
  2952.       3.2.3.7.9.8  The Ada Source -
  2953.  
  2954.       PROCEDURE exit_insert_mode;
  2955.  
  2956. REQUIREMENTS                                                       Page 3-51
  2957. Inserting A Line                                                   16 Nov 84
  2958.  
  2959.  
  2960.       3.2.3.7.10  Inserting A Line -
  2961.  
  2962.       3.2.3.7.10.1  Introduction - This procedure is called to insert  blank
  2963.       lines on the virtual display.
  2964.  
  2965.       3.2.3.7.10.2  The Object Name - insert_line
  2966.  
  2967.       3.2.3.7.10.3  Abstract - Page_terminal.insert_line will  insert  blank
  2968.       lines  onto  the  virtual  display.   The  number  of  blank  lines is
  2969.       specified in the input parameter.  The lines below and  including  the
  2970.       line containing the active position are pushed downward in the virtual
  2971.       display.  The active position is moved to the beginning of  the  blank
  2972.       line  corresponding  to the line containing the active position before
  2973.       the call on page_terminal.insert_line was made.  Lines that are pushed
  2974.       off the end of the virtual display are lost.
  2975.  
  2976.       3.2.3.7.10.4  Parameters - One input parameter count, of type positive
  2977.       identifies  the  number  of  blank lines that are to be inserted.  The
  2978.       default is one.
  2979.  
  2980.       3.2.3.7.10.5  Local Constants, Types, And Variables - TBD.
  2981.  
  2982.       3.2.3.7.10.6  Errors - The page terminal  may  not  have  been  opened
  2983.       prior to calling this procedure.
  2984.  
  2985.       3.2.3.7.10.7  Exceptions - If the page terminal has  not  been  opened
  2986.       previously to this then the exception uninitialized will be raised.
  2987.  
  2988.       3.2.3.7.10.8  The Ada Source -
  2989.  
  2990.       PROCEDURE insert_line      (count     : IN     positive := 1);
  2991.  
  2992. REQUIREMENTS                                                       Page 3-52
  2993. Selecting The Graphic Rendition                                    16 Nov 84
  2994.  
  2995.  
  2996.       3.2.3.7.11  Selecting The Graphic Rendition -
  2997.  
  2998.       3.2.3.7.11.1  Introduction - This procedure is called  to  change  the
  2999.       graphic  rendition  of all the characters put onto the virtual display
  3000.       from this point on.
  3001.  
  3002.       3.2.3.7.11.2  The Object Name - select_graphic_rendition
  3003.  
  3004.       3.2.3.7.11.3  Abstract - Page_terminal.select_graphic_rendition   sets
  3005.       the  graphic  rendition to that specified by the input parameter.  The
  3006.       choices are:
  3007.  
  3008.       1.  primary_rendition - display according to the ANSI  standard  ASCII
  3009.           codes,
  3010.  
  3011.       2.  reverse_image  -  This  can  be  configured   via   the   terminal
  3012.           capabilities file to be anything that the terminal can support and
  3013.           the user desires.  Typically it means black  on  white  (when  the
  3014.           default is white on black).
  3015.  
  3016.       3.  no rendition - all following characters  will  be  represented  as
  3017.           blanks (have no visible representation on the screen).
  3018.  
  3019.       If the selected rendition is currently in  effect  no  operation  will
  3020.       ocurr.
  3021.  
  3022.       3.2.3.7.11.4  Parameters - The single  input  parameter  selection  of
  3023.       type  graphic_rendition_enumeration  specified what the rendition will
  3024.       be.
  3025.  
  3026.       3.2.3.7.11.5  Local Constants, Types, And Variables - TBD.
  3027.  
  3028.       3.2.3.7.11.6  Errors - The page terminal  may  not  have  been  opened
  3029.       prior to calling this procedure.
  3030.  
  3031.       3.2.3.7.11.7  Exceptions - If the page terminal has  not  been  opened
  3032.       previously to this then the exception uninitialized will be raised.
  3033.  
  3034.       3.2.3.7.11.8  The Ada Source -
  3035.  
  3036.       PROCEDURE select_graphic_rendition
  3037.                      (selection : IN     graphic_rendition_enumeration);
  3038.  
  3039. REQUIREMENTS                                                       Page 3-53
  3040. Setting A Horizontal Tab                                           16 Nov 84
  3041.  
  3042.  
  3043.       3.2.3.7.12  Setting A Horizontal Tab -
  3044.  
  3045.       3.2.3.7.12.1  Introduction - This procedure will set a horizontal  tab
  3046.       at the current active position.
  3047.  
  3048.       3.2.3.7.12.2  The Object Name - set_tab
  3049.  
  3050.       3.2.3.7.12.3  Abstract - Scroll_terminal.set_tab will set a horizontal
  3051.       tab  at  the  active  position.  This tab will affect all lines on the
  3052.       virtual  display  regardless  of  the  line  position  of  the  active
  3053.       position.   In  other words, only the column of the active position is
  3054.       used and it spans all lines on  the  virtual  display.   If  there  is
  3055.       already  a  tab stop at the active position's column then no operation
  3056.       will occur.
  3057.  
  3058.       3.2.3.7.12.4  Parameters - None.
  3059.  
  3060.       3.2.3.7.12.5  Local Constants, Types, And Variables - TBD.
  3061.  
  3062.       3.2.3.7.12.6  Errors - The page terminal  may  not  have  been  opened
  3063.       prior to calling this procedure.
  3064.  
  3065.       3.2.3.7.12.7  Exceptions - If the page terminal has  not  been  opened
  3066.       previously to this then the exception uninitialized will be raised.
  3067.  
  3068.       3.2.3.7.12.8  The Ada Source -
  3069.  
  3070.       PROCEDURE set_tab;
  3071.  
  3072. REQUIREMENTS                                                       Page 3-54
  3073. Clearing A Horizontal Tab                                          16 Nov 84
  3074.  
  3075.  
  3076.       3.2.3.7.13  Clearing A Horizontal Tab -
  3077.  
  3078.       3.2.3.7.13.1  Introduction - This  procedure  is  called  to  clear  a
  3079.       horizontal tab stop at the active position.
  3080.  
  3081.       3.2.3.7.13.2  The Object Name - clear_tab
  3082.  
  3083.       3.2.3.7.13.3  Abstract - Scroll_terminal.clear_tab   will   clear    a
  3084.       horizontal  tab  at  the  active position.  This clear will affect all
  3085.       lines on the virtual display regardless of the line  position  of  the
  3086.       active  position.   In  other  words,  only  the  column of the active
  3087.       position is used and it spans all lines on the  virtual  display.   If
  3088.       there is no tab stop at the active position's column then no operation
  3089.       will occur.
  3090.  
  3091.       3.2.3.7.13.4  Parameters - None.
  3092.  
  3093.       3.2.3.7.13.5  Local Constants, Types, And Variables - TBD.
  3094.  
  3095.       3.2.3.7.13.6  Errors - The page terminal  may  not  have  been  opened
  3096.       prior to calling this procedure.
  3097.  
  3098.       3.2.3.7.13.7  Exceptions - If the page terminal has  not  been  opened
  3099.       previously to this then the exception uninitialized will be raised.
  3100.  
  3101.       3.2.3.7.13.8  The Ada Source -
  3102.  
  3103.       PROCEDURE clear_tab;
  3104.  
  3105. REQUIREMENTS                                                       Page 3-55
  3106. Performing A Horizontal Tab                                        16 Nov 84
  3107.  
  3108.  
  3109.       3.2.3.7.14  Performing A Horizontal Tab -
  3110.  
  3111.       3.2.3.7.14.1  Introduction - This procedure moves the active  position
  3112.       to the next tab stop.
  3113.  
  3114.       3.2.3.7.14.2  The Object Name - tab
  3115.  
  3116.       3.2.3.7.14.3  Abstract - Page_terminal.tab moves the  active  position
  3117.       to a tab stop based on the input parameter.  Tabs will be counted from
  3118.       the next tab (to the right) on the same line  as  the  active  positon
  3119.       moving  downward  through  the  lines.  If there are no tab stops set,
  3120.       then no operation will occur.  If there are not enough  tab  stops  on
  3121.       the  rest  of the screen to fulfill the requested number to move, then
  3122.       the cursor will be moved to the last tab stop on the virtual display.
  3123.  
  3124.       3.2.3.7.14.4  Parameters - The single input parameter count identifies
  3125.       the number of tab stops to move.  The default is one.
  3126.  
  3127.       3.2.3.7.14.5  Local Constants, Types, And Variables - TBD.
  3128.  
  3129.       3.2.3.7.14.6  Errors - The page terminal  may  not  have  been  opened
  3130.       prior to calling this procedure.
  3131.  
  3132.       3.2.3.7.14.7  Exceptions - If the page terminal has  not  been  opened
  3133.       previously to this then the exception uninitialized will be raised.
  3134.  
  3135.       3.2.3.7.14.8  The Ada Source -
  3136.  
  3137.       PROCEDURE tab    (count    : IN     positive := 1);
  3138.  
  3139. REQUIREMENTS                                                       Page 3-56
  3140. Writing Data To The Terminal                                       16 Nov 84
  3141.  
  3142.  
  3143.       3.2.3.7.15  Writing Data To The Terminal -
  3144.  
  3145.       3.2.3.7.15.1  Introduction - This procedure is called to write data to
  3146.       the virtual display.
  3147.  
  3148.       3.2.3.7.15.2  The Object Name - put
  3149.  
  3150.       3.2.3.7.15.3  Abstract - Two versions of page_terminal.put exist:
  3151.  
  3152.       1.  put a string to the virtual display, and,
  3153.  
  3154.       2.  put a character to the display.
  3155.  
  3156.       These work equivalently.   They  place  characters  into  the  virtual
  3157.       display  at  the  active  position  moving  the active position to the
  3158.       character  following  the  inserted  string  or  character.   If   the
  3159.       characters  placed on the display extend past the end of the line then
  3160.       the characters will be lost.  Page_terminal.put is affected  by  calls
  3161.       on page_terminal.enter_insert_mode and page_terminal.exit_insert_mode.
  3162.  
  3163.       3.2.3.7.15.4  Parameters - The single input  parameter  item  of  type
  3164.       character  or string is the character(s) to be placed onto the virtual
  3165.       display.  These characters should only be printable ASCII  characters.
  3166.       Others will be removed.
  3167.  
  3168.       3.2.3.7.15.5  Local Constants, Types, And Variables - TBD.
  3169.  
  3170.       3.2.3.7.15.6  Errors - The page terminal  may  not  have  been  opened
  3171.       prior to calling this procedure.
  3172.  
  3173.       3.2.3.7.15.7  Exceptions - If the page terminal has  not  been  opened
  3174.       previously to this then the exception uninitialized will be raised.
  3175.  
  3176.       3.2.3.7.15.8  The Ada Source -
  3177.  
  3178.       PROCEDURE put    (item     : IN     character);
  3179.       PROCEDURE put    (item     : IN     string);
  3180.  
  3181. REQUIREMENTS                                                       Page 3-57
  3182. Updating The Screen With Insert/Delete Line                        16 Nov 84
  3183.  
  3184.  
  3185.       3.2.3.7.16  Updating The Screen With Insert/Delete Line -
  3186.  
  3187.       3.2.3.7.16.1  Introduction - This  procedure  will  cause  the  actual
  3188.       display to take on the characteristics of the virtual display.
  3189.  
  3190.       3.2.3.7.16.2  The Object Name - update_screen_with_movement
  3191.  
  3192.       3.2.3.7.16.3  Abstract - Page_terminal.update_screen_with_movement
  3193.       will  cause  the  actual  terminal's  display to look like the virtual
  3194.       display.  Please refer to the procedure update_screen_with_movement in
  3195.       the package redisplay.
  3196.  
  3197.       3.2.3.7.16.4  Parameters - None.
  3198.  
  3199.       3.2.3.7.16.5  Local Constants, Types, And Variables - TBD.
  3200.  
  3201.       3.2.3.7.16.6  Errors - The page terminal  may  not  have  been  opened
  3202.       prior to calling this procedure.
  3203.  
  3204.       3.2.3.7.16.7  Exceptions - If the page terminal has  not  been  opened
  3205.       previously to this then the exception uninitialized will be raised.
  3206.  
  3207.       3.2.3.7.16.8  The Ada Source -
  3208.  
  3209.       PROCEDURE update_screen_with_movement;
  3210.  
  3211. REQUIREMENTS                                                       Page 3-58
  3212. Updating The Screen Without Insert/Delete Line                     16 Nov 84
  3213.  
  3214.  
  3215.       3.2.3.7.17  Updating The Screen Without Insert/Delete Line -
  3216.  
  3217.       3.2.3.7.17.1  Introduction - This  procedure  will  cause  the  actual
  3218.       display to take on the characteristics of the virtual display.
  3219.  
  3220.       3.2.3.7.17.2  The Object Name - update_screen_with_redraw
  3221.  
  3222.       3.2.3.7.17.3  Abstract - Page_terminal.update_screen_with_redraw  will
  3223.       cause  the actual terminal's display to look like the virtual display.
  3224.       Please refer to the procedure update_screen_with_redraw in the package
  3225.       redisplay.
  3226.  
  3227.       3.2.3.7.17.4  Parameters - None.
  3228.  
  3229.       3.2.3.7.17.5  Local Constants, Types, And Variables - TBD.
  3230.  
  3231.       3.2.3.7.17.6  Errors - The page terminal  may  not  have  been  opened
  3232.       prior to calling this procedure.
  3233.  
  3234.       3.2.3.7.17.7  Exceptions - If the page terminal has  not  been  opened
  3235.       previously to this then the exception uninitialized will be raised.
  3236.  
  3237.       3.2.3.7.17.8  The Ada Source -
  3238.  
  3239.       PROCEDURE update_screen_with_redraw;
  3240.  
  3241. REQUIREMENTS                                                       Page 3-59
  3242. Redrawing The Screen Complete                                      16 Nov 84
  3243.  
  3244.  
  3245.       3.2.3.7.18  Redrawing The Screen Complete -
  3246.  
  3247.       3.2.3.7.18.1  Introduction - This  procedure  will  draw  the  virtual
  3248.       screen on the terminal's display.
  3249.  
  3250.       3.2.3.7.18.2  The Object Name - redraw_screen
  3251.  
  3252.       3.2.3.7.18.3  Abstract - Page_terminal.redraw_screen will  redraw  the
  3253.       terminal's  screen  completely.  The terminal's screen will be cleared
  3254.       then the old representation of the terminal's screen will  be  cleared
  3255.       then  redisplay  screen with redraw will be called.  This procedure is
  3256.       supplied to clean up the display when any of the following ocurrs:
  3257.  
  3258.        *  the system sends a message  to  the  screen  and  the  VT  has  no
  3259.           indication that this has occured,
  3260.  
  3261.        *  the  user  inadvertently  changes  the  screen  either  through  a
  3262.           deliberate  changing  of  the  terminal parameters or accidentally
  3263.           doing something (like unplugging it),
  3264.  
  3265.        *  noise ocurrs on the transmission lines,
  3266.  
  3267.        *  some other unforseen thing happens.
  3268.  
  3269.  
  3270.       3.2.3.7.18.4  Parameters - None.
  3271.  
  3272.       3.2.3.7.18.5  Local Constants, Types, And Variables - TBD.
  3273.  
  3274.       3.2.3.7.18.6  Errors - The page terminal  may  not  have  been  opened
  3275.       prior to calling this procedure.
  3276.  
  3277.       3.2.3.7.18.7  Exceptions - If the page terminal has  not  been  opened
  3278.       previously to this then the exception uninitialized will be raised.
  3279.  
  3280.       3.2.3.7.18.8  The Ada Source -
  3281.  
  3282.       PROCEDURE redraw_screen;
  3283.  
  3284. REQUIREMENTS                                                       Page 3-60
  3285. Updating A Line                                                    16 Nov 84
  3286.  
  3287.  
  3288.       3.2.3.7.19  Updating A Line -
  3289.  
  3290.       3.2.3.7.19.1  Introduction - This procedure is  called  to  force  the
  3291.       actual  terminal's line to look like the virtual representation of the
  3292.       line.
  3293.  
  3294.       3.2.3.7.19.2  The Object Name - update_line
  3295.  
  3296.       3.2.3.7.19.3  Abstract - This  procedure   will   cause   the   actual
  3297.       terminal's  line  corrensponding  to  the  line  containing the active
  3298.       position to be changed to match the virtual line.  Please refer to the
  3299.       procedure update_line within the package redisplay.
  3300.  
  3301.       3.2.3.7.19.4  Parameters - None.
  3302.  
  3303.       3.2.3.7.19.5  Local Constants, Types, And Variables - TBD.
  3304.  
  3305.       3.2.3.7.19.6  Errors - The page terminal  may  not  have  been  opened
  3306.       prior to calling this procedure.
  3307.  
  3308.       3.2.3.7.19.7  Exceptions - If the page terminal has  not  been  opened
  3309.       previously to this then the exception uninitialized will be raised.
  3310.  
  3311.       3.2.3.7.19.8  The Ada Source -
  3312.  
  3313.       PROCEDURE update_line;
  3314.  
  3315. REQUIREMENTS                                                       Page 3-61
  3316. Getting Data From The Keyboard                                     16 Nov 84
  3317.  
  3318.  
  3319.       3.2.3.7.20  Getting Data From The Keyboard -
  3320.  
  3321.       3.2.3.7.20.1  Introduction - This procedure is called to get  all  the
  3322.       data typed at the keyboard since the last call on page_terminal.get or
  3323.       since the virtual terminal was opened.
  3324.  
  3325.       3.2.3.7.20.2  The Object Name - get
  3326.  
  3327.       3.2.3.7.20.3  Abstract - When page_terminal.get  is  called  the  keys
  3328.       that the user struck at the actual terminal keyboard since the virtual
  3329.       terminal was opened, or since the last call to  page_terminal.get  are
  3330.       returned.
  3331.  
  3332.       3.2.3.7.20.4  Parameters - A string parameter named data  returns  the
  3333.       string  that  the user typed.  Function/arrow keys that were typed are
  3334.       not embedded in this string, they are identified seperately.  The last
  3335.       position  of  the  string  is  returned  in the parameter last of type
  3336.       natural.  A timeout can be specified of type  duration.   This  allows
  3337.       the  get  to  eventually  timeout  and  return.   A  default  for this
  3338.       parameter is specified as duration'last which is  a  system  dependent
  3339.       value.   Hopefully  it is large enough to effectively mean infinitely.
  3340.       The function/arrow keys are identified by the paramter keys of private
  3341.       limited type function_key_descriptor.
  3342.  
  3343.       Three cases are important:
  3344.  
  3345.       1.  get returns with the parameter last equal to zero, and there  were
  3346.           no  function/arrow  keys  pressed.   This  means that no keys were
  3347.           typed since the last call on get or since the virtual terminal was
  3348.           called.
  3349.  
  3350.       2.  get returns with the parameter last equal to zero, and there  were
  3351.           function/arrow  keys pressed.  This means that only function/arrow
  3352.           keys were pressed since the last call on get or since the  virtual
  3353.           terminal was initialized.
  3354.  
  3355.       3.  get returns with the parameter last not equal to  zero  and  there
  3356.           were  function/arrow  keys pressed.  Here both function/arrow keys
  3357.           and regular keys were pressed.
  3358.  
  3359.       As an example, consider the  case  where  a  user  opens  the  virtual
  3360.       terminal then presses three keys.  First an (say) "a" is pressed, then
  3361.       a function key (say "F1" on some terminal), and finally a (say) "b" is
  3362.       pressed.   The  string  parameter data would have length 2 and contain
  3363.       the characters "a" and "b" as its values.  The  keys  parameter  could
  3364.       then be used to get the function key that was pressed ("F1") by making
  3365.       a call on function_count to get the number of function keys that  were
  3366.       pressed  (this would return a 1).  Then a call on function_key passing
  3367.       in the keys parameter obtained from the call on get with the index set
  3368.       to  1  (the first key struck) will return a key_identifier which is an
  3369.       enumeration of the function key pressed (in this case an f1)  and  the
  3370.       previous_position in the string that was returned from the call on get
  3371.       (in this case it would return a 2).
  3372. REQUIREMENTS                                                       Page 3-62
  3373. Getting Data From The Keyboard                                     16 Nov 84
  3374.  
  3375.  
  3376.       3.2.3.7.20.5  Local Constants, Types, And Variables - TBD
  3377.  
  3378.       3.2.3.7.20.6  Errors - The virtual terminal may not have  been  opened
  3379.       prior to calling this procedure.
  3380.  
  3381.       3.2.3.7.20.7  Exceptions - If the virtual terminal has not been opened
  3382.       previously to this then the exception page_terminal.uninitialized will
  3383.       be raised.
  3384.  
  3385.       3.2.3.7.20.8  The Ada Source -
  3386.  
  3387.       PROCEDURE get( data : OUT string;  
  3388.                      last : OUT natural;
  3389.                      keys : OUT function_key_descriptor;
  3390.                   timeout : IN duration := duration'last );
  3391.  
  3392. REQUIREMENTS                                                       Page 3-63
  3393. Getting The Specified Function/Arrow Key From The List             16 Nov 84
  3394.  
  3395.  
  3396.       3.2.3.7.21  Getting The Specified Function/Arrow Key From The List -
  3397.  
  3398.       3.2.3.7.21.1  Introduction - This  procedure  is  called  to  get  the
  3399.       specified function/arrow key from the list of function/arrow keys that
  3400.       were returned from a call on page_terminal.get.
  3401.  
  3402.       3.2.3.7.21.2  The Object Name - function_key
  3403.  
  3404.       3.2.3.7.21.3  Abstract - As     described     in     the     procedure
  3405.       page_terminal.get,  this procedure returns a key_identifier that has a
  3406.       value of type function_key_enum  identifying  the  function/arrow  key
  3407.       that  corresponds  to the index parameter in the list of function keys
  3408.       identified by the keys parameter.  This procedure is called repeatedly
  3409.       to process the function/arrow keys varying index (usually in ascending
  3410.       numerical order).
  3411.  
  3412.       3.2.3.7.21.4  Parameters - The parameters are:
  3413.  
  3414.       1.  keys   -   the    value    of    the    private    limited    type
  3415.           function_key_descriptor   that   was   returned  from  a  call  on
  3416.           page_terminal.get.  This is a user variable.  A user may have more
  3417.           than  one of these variables, and consequently, identify more than
  3418.           one list of function/arrow keys.
  3419.  
  3420.       2.  index - the number of  the  function/arrow  key  in  the  list  of
  3421.           function/arrow  keys  identified  by  the parameter keys, that the
  3422.           user is interested in.
  3423.  
  3424.       3.  key_identifier - returns an enumerated type which  identifies  the
  3425.           function/arrow key as described in the terminal capabilities file.
  3426.  
  3427.       4.  previous_position - a position in the  string  that  was  returned
  3428.           from  a  call  on  page_terminal.get.   This  position  is the one
  3429.           immediately before the  function/arrow  key  was  pressed.   Three
  3430.           cases are important:
  3431.  
  3432.           a.  the function/arrow key was pressed before  any  of  the  other
  3433.               keys.  In this case previous_position would return a zero.
  3434.  
  3435.           b.  the functon key was the last key pressed.  In  this  case  the
  3436.               value returned would be the same as last.
  3437.  
  3438.           c.  the function/arrow key  was  pressed  in  the  middle  of  the
  3439.               string.   In  this  case  the  character  position  before the
  3440.               function/arrow key would be returned.
  3441.  
  3442.  
  3443.       An example.  Consider the case where a character "a" was pressed, then
  3444.       function key "F9" (as defined in the terminal capabilities file), then
  3445.       the key "b".  page_terminal.get would return
  3446.  
  3447.       data  =  "ab"
  3448.       last  =  2
  3449.       a reference to keys
  3450. REQUIREMENTS                                                       Page 3-64
  3451. Getting The Specified Function/Arrow Key From The List             16 Nov 84
  3452.  
  3453.  
  3454.  
  3455.       When page_terminal.function_key is called and passed the reference  to
  3456.       keys  and  the  index  =  1,  then  key_identifier would return f9 and
  3457.       previous_position would return 1.
  3458.  
  3459.       3.2.3.7.21.5  Local Constants, Types, And Variables - TBD.
  3460.  
  3461.       3.2.3.7.21.6  Errors - The virtual terminal may not have  been  opened
  3462.       prior   to   calling   this  procedure.   The  index  may  indicate  a
  3463.       function/arrow key that is illegal.
  3464.  
  3465.       3.2.3.7.21.7  Exceptions - If the virtual terminal has not been opened
  3466.       previously to this then the exception page_terminal.uninitialized will
  3467.       be raised.  The exception invalid_function_key may be raised from this
  3468.       procedure.
  3469.  
  3470.       3.2.3.7.21.8  The Ada Source -
  3471.  
  3472.       PROCEDURE function_key(keys           : IN     function_key_descriptor;
  3473.                              index          : IN     positive;
  3474.                              key_identifier :    OUT function_key_enum;
  3475.                           previous_position :    OUT natural);
  3476.  
  3477. REQUIREMENTS                                                       Page 3-65
  3478. Getting The Name Of A Function Key                                 16 Nov 84
  3479.  
  3480.  
  3481.       3.2.3.7.22  Getting The Name Of A Function Key -
  3482.  
  3483.       3.2.3.7.22.1  Introduction - The procedure is called to get  the  name
  3484.       of the function key (as it appears on the actual terminal keyboard).
  3485.  
  3486.       3.2.3.7.22.2  The Object Name - function_key_name
  3487.  
  3488.       3.2.3.7.22.3  Abstract - This procedure returns a string that  is  the
  3489.       name  of  the  function  key.   This information is extracted from the
  3490.       terminal capabilities database when the virtual terminal is opened and
  3491.       stored in the tcf package data structures.
  3492.  
  3493.       3.2.3.7.22.4  Parameters - The parameters are:
  3494.  
  3495.       1.  key_identifier - a  value  of  enumerated  type  function_key_enum
  3496.           which identifies the function key of interest.
  3497.  
  3498.       2.  key_name - a string which is the function key name as  it  appears
  3499.           in the terminal capabilities file (exactly).
  3500.  
  3501.       3.  last - a natural number which is the last  character  position  in
  3502.           the key_name.
  3503.  
  3504.       This version of the terminal capabilities file limits  the  number  of
  3505.       function keys to 32 (plus the four arrow keys).
  3506.  
  3507.       3.2.3.7.22.5  Local Constants, Types, And Variables - TBD.
  3508.  
  3509.       3.2.3.7.22.6  Errors - The virtual terminal may not have  been  opened
  3510.       prior to calling this procedure.
  3511.  
  3512.       3.2.3.7.22.7  Exceptions - If the virtual terminal has not been opened
  3513.       previously to this then the exception page_terminal.uninitialized will
  3514.       be raised.
  3515.  
  3516.       3.2.3.7.22.8  The Ada Source -
  3517.  
  3518.       PROCEDURE function_key_name
  3519.           key_identifier : IN     positive;
  3520.           key_name       :    OUT string;
  3521.           last           :    OUT natural);
  3522.  
  3523. REQUIREMENTS                                                       Page 3-66
  3524. Ringing The Terminal Bell                                          16 Nov 84
  3525.  
  3526.  
  3527.       3.2.3.7.23  Ringing The Terminal Bell -
  3528.  
  3529.       3.2.3.7.23.1  Introduction - Bell causes the actual terminal's bell to
  3530.       ring.
  3531.  
  3532.       3.2.3.7.23.2  The Object Name - bell
  3533.  
  3534.       3.2.3.7.23.3  Abstract - Page_terminal.bell will cause the  terminal's
  3535.       bell  to  ring  immediately  when called.  There is no implicit update
  3536.       performed.  If the user has defined the bell  field  in  the  terminal
  3537.       capabilities file, then that sequence will be output to the terminal.
  3538.  
  3539.       3.2.3.7.23.4  Parameters - None.
  3540.  
  3541.       3.2.3.7.23.5  Local Constants, Types, And Variables - TBD.
  3542.  
  3543.       3.2.3.7.23.6  Errors - The page terminal  may  not  have  been  opened
  3544.       prior to calling this procedure.
  3545.  
  3546.       3.2.3.7.23.7  Exceptions - If the page terminal has  not  been  opened
  3547.       previously to this then the exception uninitialized will be raised.
  3548.  
  3549.       3.2.3.7.23.8  The Ada Source -
  3550.  
  3551.       PROCEDURE bell;
  3552.  
  3553.  
  3554.       3.2.3.8  Errors - As above in the individual sections.
  3555.  
  3556.       3.2.3.9  Exceptions - As above in the individual sections.
  3557.  
  3558.       3.2.3.10  The Ada Source -
  3559.  
  3560.       PACKAGE page_terminal IS
  3561.  
  3562.           TYPE function_key_enum IS
  3563.             ( up_arrow,       down_arrow,     left_arrow,     right_arrow,
  3564.               f1,     f2,     f3,     f4,     f5,     f6,     f7,     f8,
  3565.               f9,     f10,    f11,    f12,    f13,    f14,    f15,    f16,
  3566.               f17,    f18,    f19,    f20,    f21,    f22,    f23,    f24,
  3567.               f25,    f26,    f27,    f28,    f29,    f30,    f31,    f32 );
  3568.  
  3569.           TYPE function_key_descriptor IS LIMITED PRIVATE;
  3570.  
  3571.           TYPE xy_position IS 
  3572.           RECORD
  3573.               line    : positive;
  3574.               column  : positive;
  3575.           END RECORD;
  3576.  
  3577.           TYPE select_enumeration IS (from_xy_position_to_end,
  3578.                                       from_start_to_xy_position,
  3579.                                       all_positions);
  3580.  
  3581. REQUIREMENTS                                                       Page 3-67
  3582. The Ada Source                                                     16 Nov 84
  3583.  
  3584.  
  3585.           TYPE graphic_rendition_enumeration IS
  3586.                                      (primary_rendition,
  3587.                                       reverse_image);
  3588.  
  3589.           PROCEDURE open (name     : IN OUT string);
  3590.  
  3591.           PROCEDURE close;
  3592.  
  3593.           PROCEDURE set_position (position : IN     xy_position);
  3594.  
  3595.           FUNCTION  position RETURN xy_position;
  3596.  
  3597.           FUNCTION  size RETURN xy_position;
  3598.  
  3599.           PROCEDURE delete_character (count    : IN     positive := 1);
  3600.           PROCEDURE delete_line      (count    : IN     positive := 1);
  3601.  
  3602.           PROCEDURE erase_in_display (selection : select_enumeration);
  3603.           PROCEDURE erase_in_line    (selection : select_enumeration);
  3604.  
  3605.           PROCEDURE enter_insert_mode;
  3606.           PROCEDURE exit_insert_mode;
  3607.  
  3608.           PROCEDURE insert_line      (count     : IN     positive := 1);
  3609.  
  3610.           PROCEDURE select_graphic_rendition
  3611.                            (selection : IN     graphic_rendition_enumeration);
  3612.  
  3613.           PROCEDURE set_tab;
  3614.           PROCEDURE clear_tab;
  3615.  
  3616.           PROCEDURE tab       (count    : IN     positive := 1);
  3617.  
  3618.           PROCEDURE put (item     : IN     character);
  3619.           PROCEDURE put (item     : IN     string);
  3620.  
  3621.           PROCEDURE update_screen_with_movement;
  3622.           PROCEDURE update_screen_with_redraw;
  3623.           PROCEDURE update_line;
  3624.           PROCEDURE redraw_screen;
  3625.  
  3626.           FUNCTION valid_character( item : IN character ) RETURN boolean;
  3627.  
  3628.           PROCEDURE get( data : OUT string;  
  3629.                          last : OUT natural;
  3630.                          keys : OUT function_key_descriptor;
  3631.                       timeout : IN  duration := duration'last );
  3632.  
  3633.           FUNCTION function_count(keys : IN function_key_descriptor)
  3634.               RETURN natural;
  3635.  
  3636.           PROCEDURE function_key(keys           : IN     function_key_descriptor;
  3637.                                  index          : IN     positive;
  3638.                                  key_identifier :    OUT positive;
  3639. REQUIREMENTS                                                       Page 3-68
  3640. The Ada Source                                                     16 Nov 84
  3641.  
  3642.  
  3643.                               previous_position :    OUT natural);
  3644.  
  3645.           PROCEDURE function_key_name
  3646.               key_identifier : IN     positive;
  3647.               key_name       :    OUT string;
  3648.               last           :    OUT natural);
  3649.  
  3650.           PROCEDURE bell;
  3651.  
  3652.           uninitialized        : EXCEPTION;
  3653.           name_error           : EXCEPTION;
  3654.           tcf_error            : EXCEPTION;
  3655.           unsupported_terminal : EXCEPTION;
  3656.           invalid_function_key : EXCEPTION;
  3657.  
  3658.           PRIVATE
  3659.  
  3660.               TYPE funtion_key_descriptor IS positive;
  3661.  
  3662.       END page_terminal;
  3663.  
  3664. REQUIREMENTS                                                       Page 3-69
  3665. The Form Terminal Package                                          16 Nov 84
  3666.  
  3667.  
  3668.       3.2.4  The Form Terminal Package
  3669.  
  3670.       3.2.4.1  Introduction - The  form  terminal   package   provides   the
  3671.       functionality for manipulating a form terminal.
  3672.  
  3673.       3.2.4.2  The Object Name - form_terminal
  3674.  
  3675.       3.2.4.3  Abstract - A user's program may WITH this package to  provide
  3676.       a   device-independent   terminal   interface   that  is  functionally
  3677.       equivalent to a form terminal.
  3678.  
  3679.       The display of a form-mode terminal is divided  into  qualified  areas
  3680.       that  have  the  same  attributes.  The user program defines qualified
  3681.       areas   on    the    virtual    display    by    making    calls    on
  3682.       form_terminal.set_position and form_terminal.define_qualified_area.  A
  3683.       call upon form_terminal.activate_form will map  the  virtual  terminal
  3684.       display into the actual terminal display and allow editing of the form
  3685.       without user program intervention.  When the user has finished editing
  3686.       the  form  the user presses a function key (as defined in the terminal
  3687.       capabilities file) which returns control to the user's program.
  3688.  
  3689.       3.2.4.4  Parameters - none
  3690.  
  3691.       3.2.4.5  Local Constants, Types, And Variables -
  3692.  
  3693.        *  termination_key_range - indicates the number of  a  function  keys
  3694.           available  to  use as a terminate key.  The range is 1 to 32.  The
  3695.           terminate key is the key that was pressed to return  control  back
  3696.           to the user's program.
  3697.  
  3698.        *  area_intensity - indicates the intensity at which  the  characters
  3699.           in  the  area should be displayed.  NONE indicates that characters
  3700.           are not displayed.  NORMAL indicates the default  setting  of  the
  3701.           terminal at the instant the user is running a form terminal.  HIGH
  3702.           intensity  indicates  something  other  than  NORMAL   where   the
  3703.           characters are visible on the display.
  3704.  
  3705.        *  area_protection -  specifies  whether  the  user  can  modify  the
  3706.           contents  of  the  area  when  the  form  has been activated.  The
  3707.           choices are PROTECTED and UNPROTECTED.
  3708.  
  3709.        *  area_input - specifies the valid characters that may be entered by
  3710.           the   user.    GRAPHIC_CHARACTERS  indicates  that  any  printable
  3711.           characters may be entered.  The choices are  NUMERIC,  ALPHABETIC,
  3712.           and GRAPHIC_CHARACTERS.       
  3713.  
  3714.        *  area_value - indicates the initial value that the area should have
  3715.           when  activated.   NO_FILL  indicates  that  the  value  has  been
  3716.           specified by a previous PUT statement.  FILL_WITH_ZEROES indicates
  3717.           that  the value of the area is 0 when activated.  FILL_WITH_SPACES
  3718.           indicates that the value of the area is blank when activated.
  3719.  
  3720. REQUIREMENTS                                                       Page 3-70
  3721. Selectors (Functions)                                              16 Nov 84
  3722.  
  3723.  
  3724.       3.2.4.6  Selectors (Functions) -
  3725.  
  3726.       3.2.4.6.1  Retrieving The Current Position -
  3727.  
  3728.       3.2.4.6.1.1  Introduction - This function is called to get the  active
  3729.       position on the virtual display.
  3730.  
  3731.       3.2.4.6.1.2  The Object Name - position
  3732.  
  3733.       3.2.4.6.1.3  Abstract - Form_terminal.position returns  a  line/column
  3734.       pair  of type xy_position that identifies where the active position is
  3735.       located on the virtual terminal display.
  3736.  
  3737.       3.2.4.6.1.4  Parameters - None.
  3738.  
  3739.       3.2.4.6.1.5  Local Constants, Types, And Variables - TBD.
  3740.  
  3741.       3.2.4.6.1.6  Errors - The form terminal may not have been opened prior
  3742.       to calling this procedure.
  3743.  
  3744.       3.2.4.6.1.7  Exceptions - If the form terminal  has  not  been  opened
  3745.       previously to this then the exception generated in the driver package,
  3746.       driver.uninitialized, will be propogated out to  the  calling  program
  3747.       unit.
  3748.  
  3749.       3.2.4.6.1.8  The Ada Source -
  3750.  
  3751.       FUNCTION  position RETURN xy_position;
  3752.  
  3753. REQUIREMENTS                                                       Page 3-71
  3754. Determining The Size Of The Display                                16 Nov 84
  3755.  
  3756.  
  3757.       3.2.4.6.2  Determining The Size Of The Display -
  3758.  
  3759.       3.2.4.6.2.1  Introduction - This function is called to  determine  the
  3760.       size of the actual display.
  3761.  
  3762.       3.2.4.6.2.2  The Object Name - size
  3763.  
  3764.       3.2.4.6.2.3  Abstract - form_terminal.size  returns  the   number   of
  3765.       columns  and  number  of  lines contained in the actual display.  This
  3766.       information is located in the terminal capabilities file  and  can  be
  3767.       set and altered by the user.
  3768.  
  3769.       3.2.4.6.2.4  Parameters - None.
  3770.  
  3771.       3.2.4.6.2.5  Local Constants, Types, And Variables - TBD.
  3772.  
  3773.       3.2.4.6.2.6  Errors - The form terminal may not have been opened prior
  3774.       to calling this function.
  3775.  
  3776.       3.2.4.6.2.7  Exceptions - If the form terminal  has  not  been  opened
  3777.       previously to this then the exception generated in the driver package,
  3778.       driver.uninitialized, will be propogated out to  the  calling  program
  3779.       unit.
  3780.  
  3781.       3.2.4.6.2.8  The Ada Source -
  3782.  
  3783.       FUNCTION  size RETURN xy_position;
  3784.  
  3785. REQUIREMENTS                                                       Page 3-72
  3786. Determining The Form Status                                        16 Nov 84
  3787.  
  3788.  
  3789.       3.2.4.6.3  Determining The Form Status -
  3790.  
  3791.       3.2.4.6.3.1  Introduction - The  is_form_updated  function  determines
  3792.       changes to the form.
  3793.  
  3794.       3.2.4.6.3.2  The Object Name - is_form_updated
  3795.  
  3796.       3.2.4.6.3.3  Abstract - Form_terminal.is_form_updated returns  whether
  3797.       the form was modified by     the   user   since   the   last  call  on
  3798.       form_terminal.activate_form.
  3799.  
  3800.       3.2.4.6.3.4  Parameters - None.
  3801.  
  3802.       3.2.4.6.3.5  Local Constants, Types, And Variables - TBD
  3803.  
  3804.       3.2.4.6.3.6  Errors - The form terminal may not have been opened prior
  3805.       to calling this procedure.
  3806.  
  3807.       3.2.4.6.3.7  Exceptions - If the form terminal  has  not  been  opened
  3808.       previously to this then the exception generated in the driver package,
  3809.       driver.uninitialized, will be propogated out to  the  calling  program
  3810.       unit.
  3811.  
  3812.       3.2.4.6.3.8  The Ada Source -
  3813.  
  3814.       FUNCTION  is_form_updated RETURN boolean;
  3815.  
  3816. REQUIREMENTS                                                       Page 3-73
  3817. Determining The Termination Key                                    16 Nov 84
  3818.  
  3819.  
  3820.       3.2.4.6.4  Determining The Termination Key -
  3821.  
  3822.       3.2.4.6.4.1  Introduction - The  termination_key  function  determines
  3823.       the termination key.
  3824.  
  3825.       3.2.4.6.4.2  The Object Name - termination_key
  3826.  
  3827.       3.2.4.6.4.3  Abstract - Form_terminal.termination_key returns a number
  3828.       that  indicates  which  key  as specified in the Terminal Capabilities
  3829.       File terminated the activate_form procedure.
  3830.  
  3831.       3.2.4.6.4.4  Parameters - None.
  3832.  
  3833.       3.2.4.6.4.5  Local Constants, Types, And Variables - TBD
  3834.  
  3835.       3.2.4.6.4.6  Errors - The form terminal may not have been opened prior
  3836.       to calling this procedure.
  3837.  
  3838.       3.2.4.6.4.7  Exceptions - If the form terminal  has  not  been  opened
  3839.       previously to this then the exception generated in the driver package,
  3840.       driver.uninitialized, will be propogated out to  the  calling  program
  3841.       unit.
  3842.  
  3843.       3.2.4.6.4.8  The Ada Source -
  3844.  
  3845.       FUNCTION  termination_key RETURN termination_key_range;
  3846.  
  3847. REQUIREMENTS                                                       Page 3-74
  3848. Actors (Procedures)                                                16 Nov 84
  3849.  
  3850.  
  3851.       3.2.4.7  Actors (Procedures) -
  3852.  
  3853.       3.2.4.7.1  Opening A Form Terminal -
  3854.  
  3855.       3.2.4.7.1.1  Introduction - This procedure is called to open the  form
  3856.       terminal.
  3857.  
  3858.       3.2.4.7.1.2  The Object Name - open
  3859.  
  3860.       3.2.4.7.1.3  Abstract - Form_terminal.open  is   called   to   perform
  3861.       initialization  and define a form-mode virtual terminal for the user's
  3862.       program to make use of.  This initialization consists of:
  3863.  
  3864.       1.  defining the necessary data structures within the virtual terminal
  3865.           to support a form terminal.
  3866.  
  3867.       2.  calling the  driver  package  and  initializing  the  needed  data
  3868.           structures from the terminal capabilities file.
  3869.  
  3870.       3.  raising the necessary exceptions if the form terminal could not be
  3871.           opened.
  3872.  
  3873.  
  3874.       3.2.4.7.1.4  Parameters - The name parameter contains the name of  the
  3875.       actual  terminal  that  the user is interfacing with.  This may change
  3876.       from one invocation of the program to another.  This name  must  match
  3877.       exactly  (string  and  case)  with the terminal name as defined in the
  3878.       terminal capabilities file.
  3879.  
  3880.       The form terminal may have been previously opened.  In this  case  the
  3881.       terminal  is  implicitly closed and reopened.  No implicit update will
  3882.       be performed before the close operation.
  3883.  
  3884.       3.2.4.7.1.5  Local Constants, Types, And Variables - TBD.
  3885.  
  3886.       3.2.4.7.1.6  Errors - Errors include:
  3887.  
  3888.       1.  passing  in  a  name  that  does  not  appear  in   the   terminal
  3889.           capabilities file.
  3890.  
  3891.       2.  if the terminal capabilities file is not available to read.
  3892.  
  3893.       3.  if the terminal does not have the needed capabilities to be a form
  3894.           terminal.
  3895.  
  3896.  
  3897.       3.2.4.7.1.7  Exceptions - The exceptions raised are (respectively):
  3898.  
  3899.        *  name_error
  3900.  
  3901.        *  tcf_error
  3902. REQUIREMENTS                                                       Page 3-75
  3903. Opening A Form Terminal                                            16 Nov 84
  3904.  
  3905.  
  3906.        *  unsupported_terminal
  3907.  
  3908.  
  3909.       3.2.4.7.1.8  The Ada Source -
  3910.  
  3911.       PROCEDURE open (name     : IN     string);
  3912.  
  3913. REQUIREMENTS                                                       Page 3-76
  3914. Closing A Form Terminal                                            16 Nov 84
  3915.  
  3916.  
  3917.       3.2.4.7.2  Closing A Form Terminal -
  3918.  
  3919.       3.2.4.7.2.1  Introduction - This procedure is called to close the form
  3920.       terminal.
  3921.  
  3922.       3.2.4.7.2.2  The Object Name - close
  3923.  
  3924.       3.2.4.7.2.3  Abstract - Form_terminal.close   closes    the    virtual
  3925.       terminal.   If  the  virtual  terminal  was  already  closed,  then no
  3926.       operation will occur.
  3927.  
  3928.       3.2.4.7.2.4  Parameters - None.
  3929.  
  3930.       3.2.4.7.2.5  Local Constants, Types, And Variables - TBD.
  3931.  
  3932.       3.2.4.7.2.6  Errors - None.
  3933.  
  3934.       3.2.4.7.2.7  Exceptions - None.
  3935.  
  3936.       3.2.4.7.2.8  The Ada Source -
  3937.  
  3938.       PROCEDURE close;
  3939.  
  3940. REQUIREMENTS                                                       Page 3-77
  3941. Setting The Current Position                                       16 Nov 84
  3942.  
  3943.  
  3944.       3.2.4.7.3  Setting The Current Position -
  3945.  
  3946.       3.2.4.7.3.1  Introduction - This procedure is called to set the active
  3947.       position (line and column) on the virtual terminal display.
  3948.  
  3949.       3.2.4.7.3.2  The Object Name - set_position
  3950.  
  3951.       3.2.4.7.3.3  Abstract - Form_terminal.set_position   will   move   the
  3952.       active position in the virtual terminal display to the new coordinates
  3953.       given in the parameter list.  A call on this procedure does not affect
  3954.       the  actual terminal's display, only the virtual representation of the
  3955.       display.  Wrapping occurs if the parameter contains a  value  that  is
  3956.       outside the actual screen or line dimensions.
  3957.  
  3958.       3.2.4.7.3.4  Parameters - This procedure has one parameter,  position,
  3959.       which  identifies  the line and column that the active position should
  3960.       be moved to.
  3961.  
  3962.       3.2.4.7.3.5  Local Constants, Types, And Variables - TBD.
  3963.  
  3964.       3.2.4.7.3.6  Errors - The scroll terminal may  not  have  been  opened
  3965.       prior to calling this procedure.
  3966.  
  3967.       3.2.4.7.3.7  Exceptions - If the scroll terminal has not  been  opened
  3968.       previously to this then the exception generated in the driver package,
  3969.       driver.uninitialized, will be propogated out to  the  calling  program
  3970.       unit.
  3971.  
  3972.       3.2.4.7.3.8  The Ada Source -
  3973.  
  3974.       PROCEDURE set_position (position : IN     xy_position);
  3975.  
  3976. REQUIREMENTS                                                       Page 3-78
  3977. Defining Qualified Areas                                           16 Nov 84
  3978.  
  3979.  
  3980.       3.2.4.7.4  Defining Qualified Areas -
  3981.  
  3982.       3.2.4.7.4.1  Introduction - This procedure  defines  sections  of  the
  3983.       display to be used as qualified areas of the form.
  3984.  
  3985.       3.2.4.7.4.2  The Object Name - define_qualified_area
  3986.  
  3987.       3.2.4.7.4.3  Abstract - Form_terminal.define_qualified_area is  called
  3988.       to  define  qualified areas.  These qualified areas are bounded by the
  3989.       next qualified area defined such that the end of a qualified  area  is
  3990.       indicated by the beginning of the next qualified area.  Each qualified
  3991.       area may have user editing restrictions imposed.   A  virtual  display
  3992.       that  has  no qualified area defined by the user program is considered
  3993.       protected and set to blank.
  3994.  
  3995.       3.2.4.7.4.4  Parameters -
  3996.  
  3997.        *  intensity - set the intensity of the qualified  area  (default  is
  3998.           normal).
  3999.  
  4000.        *  protection - set the protection of the qualified area (default  is
  4001.           protected).
  4002.  
  4003.        *  input - the permissible input characters for the area.
  4004.  
  4005.        *  value - the intial value of the area (default is no_fill).
  4006.  
  4007.  
  4008.       3.2.4.7.4.5  Local Constants, Types, And Variables - TBD.
  4009.  
  4010.       3.2.4.7.4.6  Errors - The form terminal may not have been opened prior
  4011.       to calling this procedure.
  4012.  
  4013.       3.2.4.7.4.7  Exceptions - If the form terminal  has  not  been  opened
  4014.       previously to this then the exception generated in the driver package,
  4015.       driver.uninitialized, will be propogated out to  the  calling  program
  4016.       unit.
  4017.  
  4018.       3.2.4.7.4.8  The Ada Source -
  4019.  
  4020.       PROCEDURE define_qualified_area
  4021.                 (intensity  : IN     area_intensity  := normal;
  4022.                  protection : IN     area_protection := protected;
  4023.                  input      : IN     area_input := graphic_characters;
  4024.                  value      : IN     area_value      := no_fill);
  4025.  
  4026. REQUIREMENTS                                                       Page 3-79
  4027. Clearing A Qualified Area                                          16 Nov 84
  4028.  
  4029.  
  4030.       3.2.4.7.5  Clearing A Qualified Area -
  4031.  
  4032.       3.2.4.7.5.1  Introduction - This procedure clears a qualified area  on
  4033.       the form terminal screen.
  4034.  
  4035.       3.2.4.7.5.2  The Object Name - clear_qualified_area
  4036.  
  4037.       3.2.4.7.5.3  Abstract - Form_terminal.clear_qualified_area removes  an
  4038.       area  qualifier  from  the  active  position.  The qualified area that
  4039.       precedes this one is extended to encompass the removed area.
  4040.  
  4041.       3.2.4.7.5.4  Parameters - None.
  4042.  
  4043.       3.2.4.7.5.5  Local Constants, Types, And Variables - TBD.
  4044.  
  4045.       3.2.4.7.5.6  Errors - The form terminal may not have been opened prior
  4046.       to calling this procedure.
  4047.  
  4048.       3.2.4.7.5.7  Exceptions - If the form terminal  has  not  been  opened
  4049.       previously to this then the exception generated in the driver package,
  4050.       driver.uninitialized, will be propogated out to  the  calling  program
  4051.       unit.
  4052.  
  4053.       3.2.4.7.5.8  The Ada Source -
  4054.  
  4055.       PROCEDURE clear_qualified_area;
  4056.  
  4057. REQUIREMENTS                                                       Page 3-80
  4058. Tabbing To The Next Qualified Area                                 16 Nov 84
  4059.  
  4060.  
  4061.       3.2.4.7.6  Tabbing To The Next Qualified Area -
  4062.  
  4063.       3.2.4.7.6.1  Introduction - The  tab  procedure  moves  to  the   next
  4064.       qualified area.
  4065.  
  4066.       3.2.4.7.6.2  The Object Name - tab
  4067.  
  4068.       3.2.4.7.6.3  Abstract - Form_terminal.tab moves  the  active  position
  4069.       the specified number of qualified areas toward the end of the display.
  4070.       The resultant active position is the first character position  of  the
  4071.       designated  qualified area.  If the next qualified area moved to is at
  4072.       the end of a line, the active position is at the first qualified  area
  4073.       of  the  next line.  If the next qualified area moved to is at the end
  4074.       of the form, then the active position is at the first  qualified  area
  4075.       of the form.
  4076.  
  4077.       3.2.4.7.6.4  Parameters - None.
  4078.  
  4079.       3.2.4.7.6.5  Local Constants, Types, And Variables - TBD.
  4080.  
  4081.       3.2.4.7.6.6  Errors - The form terminal may not have been opened prior
  4082.       to calling this procedure.
  4083.  
  4084.       3.2.4.7.6.7  Exceptions - If the form terminal  has  not  been  opened
  4085.       previously to this then the exception generated in the driver package,
  4086.       driver.uninitialized, will be propogated out to  the  calling  program
  4087.       unit.
  4088.  
  4089.       3.2.4.7.6.8  The Ada Source -
  4090.  
  4091.       PROCEDURE tab;
  4092.  
  4093. REQUIREMENTS                                                       Page 3-81
  4094. Writing Data To The Terminal                                       16 Nov 84
  4095.  
  4096.  
  4097.       3.2.4.7.7  Writing Data To The Terminal -
  4098.  
  4099.       3.2.4.7.7.1  Introduction - The  put  procedure  writes  data  to  the
  4100.       virtual display.
  4101.  
  4102.       3.2.4.7.7.2  The Object Name - put
  4103.  
  4104.       3.2.4.7.7.3  Abstract - There are two types of puts performed  by  the
  4105.       form_terminal.  One writes a character, the other writes a string from
  4106.       the virtual display.  Form_terminal.put may write a character  to  the
  4107.       virtual  display  at  the  active  position.  The column of the active
  4108.       position is incremented by one.  Form_terminal.put may  also  write  a
  4109.       string  from  the  virtual  form  display at the active position.  The
  4110.       column of the active position is incremented by length of the  string.
  4111.       If  the  character/string is written in the last column of a line, the
  4112.       active position is advanced to the first column of the following line.
  4113.       If  the  character/string  is  written  to the last column of the last
  4114.       line, the active position is moved to the first column  of  the  first
  4115.       line.
  4116.  
  4117.       3.2.4.7.7.4  Parameters -
  4118.  
  4119.        *  item:  the character/string to be written to the display.
  4120.  
  4121.  
  4122.       3.2.4.7.7.5  Local Constants, Types, And Variables - TBD.
  4123.  
  4124.       3.2.4.7.7.6  Errors - The form terminal may not have been opened prior
  4125.       to calling this procedure.
  4126.  
  4127.       3.2.4.7.7.7  Exceptions - If the form terminal  has  not  been  opened
  4128.       previously to this then the exception generated in the driver package,
  4129.       driver.uninitialized, will be propogated out to  the  calling  program
  4130.       unit.
  4131.  
  4132.       3.2.4.7.7.8  The Ada Source -
  4133.  
  4134.       PROCEDURE put (item     : IN     character);
  4135.       PROCEDURE put (item     : IN     string);
  4136.  
  4137. REQUIREMENTS                                                       Page 3-82
  4138. Reading Data From Qualified Areas                                  16 Nov 84
  4139.  
  4140.  
  4141.       3.2.4.7.8  Reading Data From Qualified Areas -
  4142.  
  4143.       3.2.4.7.8.1  Introduction - The  get   procedure   reads   data   from
  4144.       qualified areas on the virtual display.
  4145.  
  4146.       3.2.4.7.8.2  The Object Name - get
  4147.  
  4148.       3.2.4.7.8.3  Abstract - There are two types of reads performed by  the
  4149.       form_terminal.   One  reads a character, the other reads a string from
  4150.       the actual display.  Form_terminal.get may read a character  from  the
  4151.       virtual  display  at  the  active  position.   The  active position is
  4152.       advanced forward one position.   Form_terminal.get  may  also  read  a
  4153.       string  from  the  virtual display at the active position.  The active
  4154.       position is advanced forward the length of the string.
  4155.  
  4156.       3.2.4.7.8.4  Parameters -
  4157.  
  4158.        *  item:  the character/string to be read into.
  4159.  
  4160.  
  4161.       3.2.4.7.8.5  Local Constants, Types, And Variables - TBD.
  4162.  
  4163.       3.2.4.7.8.6  Errors - The form terminal may not have been opened prior
  4164.       to calling this procedure.
  4165.  
  4166.       3.2.4.7.8.7  Exceptions - If the form terminal  has  not  been  opened
  4167.       previously to this then the exception generated in the driver package,
  4168.       driver.uninitialized, will be propogated out to  the  calling  program
  4169.       unit.
  4170.  
  4171.       3.2.4.7.8.8  The Ada Source -
  4172.  
  4173.       PROCEDURE get (item     :    OUT character);
  4174.       PROCEDURE get (item     :    OUT string);
  4175.  
  4176. REQUIREMENTS                                                       Page 3-83
  4177. Erasing A Qualified Area                                           16 Nov 84
  4178.  
  4179.  
  4180.       3.2.4.7.9  Erasing A Qualified Area -
  4181.  
  4182.       3.2.4.7.9.1  Introduction - The   erase_area   procedure   erases    a
  4183.       qualified area on the terminal form.
  4184.  
  4185.       3.2.4.7.9.2  The Object Name - erase_area
  4186.  
  4187.       3.2.4.7.9.3  Abstract - Form_terminal.erase_area clears  the  area  in
  4188.       which  the  active  position  is  located  by  replacing the area with
  4189.       blanks.
  4190.  
  4191.       3.2.4.7.9.4  Parameters - None.
  4192.  
  4193.       3.2.4.7.9.5  Local Constants, Types, And Variables - TBD.
  4194.  
  4195.       3.2.4.7.9.6  Errors - The form terminal may not have been opened prior
  4196.       to calling this procedure.
  4197.  
  4198.       3.2.4.7.9.7  Exceptions - If the form terminal  has  not  been  opened
  4199.       previously to this then the exception generated in the driver package,
  4200.       driver.uninitialized, will be propogated out to  the  calling  program
  4201.       unit.
  4202.  
  4203.       3.2.4.7.9.8  The Ada Source -
  4204.  
  4205.       PROCEDURE erase_area;
  4206.  
  4207. REQUIREMENTS                                                       Page 3-84
  4208. Erasing The Display Screen                                         16 Nov 84
  4209.  
  4210.  
  4211.       3.2.4.7.10  Erasing The Display Screen -
  4212.  
  4213.       3.2.4.7.10.1  Introduction - The erase_display  procedure  erases  the
  4214.       display.
  4215.  
  4216.       3.2.4.7.10.2  The Object Name - erase_display
  4217.  
  4218.       3.2.4.7.10.3  Abstract - Form_terminal.erase_display    clears     the
  4219.       display  and  removes  all  user program defined area qualifiers.  The
  4220.       display is then reset to  the  default  form  which  consists  of  one
  4221.       qualified  area  (the  entire  size of the display) which is blank and
  4222.       protected.
  4223.  
  4224.       3.2.4.7.10.4  Parameters - None.
  4225.  
  4226.       3.2.4.7.10.5  Local Constants, Types, And Variables - TBD.
  4227.  
  4228.       3.2.4.7.10.6  Errors - The form terminal  may  not  have  been  opened
  4229.       prior to calling this procedure.
  4230.  
  4231.       3.2.4.7.10.7  Exceptions - If the form terminal has  not  been  opened
  4232.       previously to this then the exception generated in the driver package,
  4233.       driver.uninitialized, will be propogated out to  the  calling  program
  4234.       unit.
  4235.  
  4236.       3.2.4.7.10.8  The Ada Source -
  4237.  
  4238.       PROCEDURE erase_display;
  4239.  
  4240. REQUIREMENTS                                                       Page 3-85
  4241. Activating A Form For Input                                        16 Nov 84
  4242.  
  4243.  
  4244.       3.2.4.7.11  Activating A Form For Input -
  4245.  
  4246.       3.2.4.7.11.1  Introduction - The activate form procedure  activates  a
  4247.       terminal form for input.
  4248.  
  4249.       3.2.4.7.11.2  The Object Name - activate_form
  4250.  
  4251.       3.2.4.7.11.3  Abstract - Form_terminal.activate_form maps the  virtual
  4252.       display    into    the    actual    display.     Activate_form   calls
  4253.       redisplay_screen_with_movement procedure to make the terminal  display
  4254.       look  like  the  data  structures in the vt_contents package.  This is
  4255.       called once when activate form is first  called.   When  the  form  is
  4256.       activated  the  cursor  is placed at the first editing position on the
  4257.       form.   Form  editing  is  performed  by   the   procedure   body   of
  4258.       activate_form.   The  procedure  body  calls  vt_input.get to read the
  4259.       characters from the keyboard into the data structures of  vt_contents.
  4260.       Redisplay_line_with_movement is called after each call of vt_input.get
  4261.       to redisplay the virtual display line  to  the  actual  display  line.
  4262.       Control  returns  to  the  user's  program  when  a  function  key  is
  4263.       depressed.  The virtual form will exist in the data  structures  until
  4264.       the virtual display is erased or the qualified areas are cleared.  The
  4265.       user's program may then choose to define another form if desired.
  4266.  
  4267.       3.2.4.7.11.4  Parameters - None.
  4268.  
  4269.       3.2.4.7.11.5  Local Constants, Types, And Variables - TBD.
  4270.  
  4271.       3.2.4.7.11.6  Errors - The form terminal  may  not  have  been  opened
  4272.       prior to calling this procedure.
  4273.  
  4274.       3.2.4.7.11.7  Exceptions - If the form terminal has  not  been  opened
  4275.       previously to this then the exception generated in the driver package,
  4276.       driver.uninitialized, will be propogated out to  the  calling  program
  4277.       unit.
  4278.  
  4279.       3.2.4.7.11.8  The Ada Source -
  4280.  
  4281.       PROCEDURE activate_form;
  4282.  
  4283.  
  4284.       3.2.4.8  Errors - As above in the individual sections.
  4285.  
  4286.       3.2.4.9  Exceptions - As above in the individual sections.
  4287.  
  4288.       3.2.4.10  The Ada Source -
  4289.  
  4290.       PACKAGE form_terminal IS
  4291.  
  4292.           TYPE termination_key_range IS RANGE 1..32;
  4293.  
  4294.           TYPE area_intensity  IS (none, normal, high);
  4295.           TYPE area_protection IS (unprotected, protected);
  4296.           TYPE area_input      IS (graphic_characters, numerics, alphabetics);
  4297.           TYPE area_value      IS (no_fill, fill_with_zeroes, fill_with_spaces);
  4298. REQUIREMENTS                                                       Page 3-86
  4299. The Ada Source                                                     16 Nov 84
  4300.  
  4301.  
  4302.  
  4303.           PROCEDURE open (name     : IN     string);
  4304.  
  4305.           PROCEDURE close;
  4306.  
  4307.           PROCEDURE set_position (position : IN     xy_position);
  4308.  
  4309.           FUNCTION  position RETURN xy_position;
  4310.  
  4311.           FUNCTION  size RETURN xy_position;
  4312.  
  4313.           PROCEDURE define_qualified_area
  4314.                            (intensity  : IN     area_intensity  := normal;
  4315.                             protection : IN     area_protection := protected;
  4316.                             input      : IN     area_input
  4317.                                                      := graphic_characters;
  4318.                             value      : IN     area_value      := no_fill);
  4319.  
  4320.           PROCEDURE clear_qualified_area;
  4321.  
  4322.           PROCEDURE tab;
  4323.           PROCEDURE put (item     : IN     character);
  4324.           PROCEDURE put (item     : IN     string);
  4325.  
  4326.           PROCEDURE get (item     :    OUT character);
  4327.           PROCEDURE get (item     :    OUT string);
  4328.  
  4329.           PROCEDURE erase_area;
  4330.           PROCEDURE erase_display;
  4331.           PROCEDURE activate_form;
  4332.  
  4333.           FUNCTION  is_form_updated RETURN boolean;
  4334.           FUNCTION  area_qualifier_requires_space RETURN boolean;
  4335.           FUNCTION  termination_key RETURN termination_key_range;
  4336.  
  4337.           -- exceptions
  4338.  
  4339.       END form_terminal;
  4340.  
  4341. REQUIREMENTS                                                       Page 3-87
  4342. The Virtual Terminal Content Package                               16 Nov 84
  4343.  
  4344.  
  4345.       3.2.5  The Virtual Terminal Content Package
  4346.  
  4347.       3.2.5.1  Introduction - This package defines the constants  and  types
  4348.       used in defining a virtual display.
  4349.  
  4350.       3.2.5.2  The Object Name - vt_content
  4351.  
  4352.       3.2.5.3  Abstract - This package contains the supporting  contant  and
  4353.       type definitions used by other packages in defining and manipulating a
  4354.       virtual display.
  4355.  
  4356.       Many of the enumerated types use names that match  the  names  in  the
  4357.       ANSI X3.64 [ANSI74] standard.
  4358.  
  4359.       3.2.5.4  Parameters - None.
  4360.  
  4361.       3.2.5.5  Local Constants, Types, And Variables -
  4362.  
  4363.       1.  class_enum - an  enumerated  type  describing  the  class  of  the
  4364.           terminal.  The choices are scroll, page, or form.
  4365.  
  4366.       2.  graphic_rendition_enum - an enumerated type describing the graphic
  4367.           rendition  for a position on the virtual display.  The choices are
  4368.           primary rendition and reverse image.
  4369.  
  4370.       3.  graphic_rendition_set -  the  set  of  all  possible  choices  for
  4371.           graphics rendition for a position on the virtual display.
  4372.  
  4373.       4.  area_qualifier_enum -  an  enumerated  type  describing  the  area
  4374.           qualifiers.  All are obvious with the following exceptions:
  4375.  
  4376.           a.  accept no input means  the  area  is  protected  against  user
  4377.               modification,
  4378.  
  4379.           b.  graphic input is all printing ascii characters,
  4380.  
  4381.           c.  zero fill means that an area will be filled (written to)  with
  4382.               ascii NULs (ascii code 0).
  4383.  
  4384.  
  4385.       5.  area_qualifiers_set - the set of all possible area qualifiers  for
  4386.           a position on the virtual display.
  4387.  
  4388.       6.  edit_extent_enum - an enumerated type describing the extent on the
  4389.           virtual  display  that editting will effect.  The choices are line
  4390.           and qualified area.
  4391.  
  4392.       7.  max_row - the absolute maximum number of rows  that  this  virtual
  4393.           terminal will support.
  4394.  
  4395.       8.  max_column - the absolute maximum  number  of  columns  that  this
  4396.           virtual terminal will support.
  4397. REQUIREMENTS                                                       Page 3-88
  4398. Local Constants, Types, And Variables                              16 Nov 84
  4399.  
  4400.  
  4401.       9.  column_range - the range of columns for the virtual display.
  4402.  
  4403.      10.  row_range - the range of rows for the virtual display.
  4404.  
  4405.      11.  vt_position_record - a type with x and y components that  identify
  4406.           a specific position on the virtual display.
  4407.  
  4408.      12.  max_position_data - the maximum number  that  a  position  on  the
  4409.           display can have as data.  Normally limited to the ascii character
  4410.           set.
  4411.  
  4412.      13.  vt_position_data - the range of values  that  a  position  on  the
  4413.           display can take.
  4414.  
  4415.      14.  vt_position_record - the contents of a  position  on  the  virtual
  4416.           display are:
  4417.  
  4418.           a.  rendition - the graphic rendition of the position as described
  4419.               above,
  4420.  
  4421.           b.  qualifiers - the area qualifiers as described above,
  4422.  
  4423.           c.  data - the data.  Normally this is ascii characters,
  4424.  
  4425.           d.  tab_set - identifies whether this position has a tab stop set.
  4426.  
  4427.  
  4428.      15.  vt_column_array - an array of positions describing a line  on  the
  4429.           virtual display,
  4430.  
  4431.      16.  vt_content_array - an array of lines describing  the  contents  of
  4432.           the full virtual display,
  4433.  
  4434.      17.  vt_content_record - a record containing the contents of the screen
  4435.           and  fields  identifying the active position, editting extent, and
  4436.           the contents of all positions on the virtual display,
  4437.  
  4438.      18.  vt_content_access   -   an   access    type    pointing    to    a
  4439.           vt_content_record.
  4440.  
  4441.      19.  width - a variable set after  VT  initialization  identifying  the
  4442.           actual width (number of columns) that the terminal supports.
  4443.  
  4444.      20.  height - a variable set after VT  initialization  identifying  the
  4445.           actual height (number of rows) that the terminal supports.
  4446.  
  4447.  
  4448.       3.2.5.6  Selectors (Functions) - None.
  4449. REQUIREMENTS                                                       Page 3-89
  4450. Actors (Procedures)                                                16 Nov 84
  4451.  
  4452.  
  4453.       3.2.5.7  Actors (Procedures) - None.
  4454.  
  4455.       3.2.5.8  Errors - None.
  4456.  
  4457.       3.2.5.9  Exceptions - None.
  4458.  
  4459.       3.2.5.10  The Ada Source -
  4460.  
  4461.       PACKAGE vt_content IS
  4462.  
  4463.            TYPE class_enum IS (scroll, 
  4464.                                page, 
  4465.                                form);
  4466.  
  4467.            TYPE graphic_rendition_enum IS
  4468.                            (   sgpr,     -- primary rendition
  4469.                                sgri );   -- reverse image
  4470.  
  4471.            TYPE graphic_rendition_set IS
  4472.                           ARRAY ( graphic_rendition_enum ) OF boolean;
  4473.  
  4474.            TYPE area_qualifiers_enum IS
  4475.                            (   dqnn,      -- accept no input and do not transmit
  4476.                                dqag,      -- accept graphic input
  4477.                                dqan,      -- accept numeric input
  4478.                                dqaa,      -- accept alphabetic input
  4479.                                dqzf,      -- zero fill area
  4480.                                dqsf );    -- space fill in area
  4481.  
  4482.            TYPE area_qualifiers_set IS
  4483.                           ARRAY( area_qualifiers_enum ) OF boolean;
  4484.  
  4485.            TYPE edit_extent_enum IS
  4486.                            (   seel,      -- edit in line
  4487.                                seqa );    -- edit in qualified area
  4488.  
  4489.            max_row    : positive CONSTANT := 72;
  4490.  
  4491.            max_column : positive CONSTANT := 132;
  4492.  
  4493.            SUBTYPE column_range IS POSITIVE RANGE 1..max_column;
  4494.  
  4495.            SUBTYPE row_range IS POSITIVE RANGE 1..max_row;
  4496.  
  4497.            TYPE vt_position_xy_record IS
  4498.                            RECORD
  4499.                                x_position     :row_range;
  4500.                                y_position     :column_range;
  4501.                            END RECORD;
  4502.  
  4503.            max_position_data : natural CONSTANT := 255;  --  8 bits
  4504.  
  4505.            SUBTYPE vt_position_data IS natural RANGE 0..max_position_data;
  4506.  
  4507. REQUIREMENTS                                                       Page 3-90
  4508. The Ada Source                                                     16 Nov 84
  4509.  
  4510.  
  4511.            TYPE vt_position_record IS
  4512.                            RECORD
  4513.                                rendition      :graphic_rendition_set;
  4514.                                qualifiers     :area_qualifiers_set;
  4515.                                data           :vt_position_data;
  4516.                                tab_set        :boolean;
  4517.                            END RECORD; -- vt_position_record
  4518.  
  4519.            TYPE vt_column_array IS
  4520.                            ARRAY( column_range ) OF vt_position_record;
  4521.  
  4522.            TYPE vt_content_array IS
  4523.                            ARRAY( row_range ) OF vt_column_array;
  4524.  
  4525.            TYPE vt_content_record IS
  4526.                            RECORD
  4527.                                active_position
  4528.                                               :vt_position_xy_record;
  4529.                                edit_extent    :edit_extent_enum;
  4530.                                element        :vt_content_array;
  4531.                            END RECORD; -- vt_content_record
  4532.  
  4533.            TYPE vt_content_access IS ACCESS vt_content_record;
  4534.  
  4535.            height : row_range;
  4536.            width : column_range;
  4537.  
  4538.       END vt_content;
  4539.  
  4540.  
  4541. REQUIREMENTS                                                       Page 3-91
  4542. The Virtual Terminal Keyboard Input Package                        16 Nov 84
  4543.  
  4544.  
  4545.       3.2.6  The Virtual Terminal Keyboard Input Package
  4546.  
  4547.       3.2.6.1  Introduction -
  4548.  
  4549.       3.2.6.2  The Object Name - vt_input
  4550.  
  4551.       3.2.6.3  Abstract - This  package  provides  an   interface   to   get
  4552.       keystrokes from the actual terminals keyboard.  The keystrokes include
  4553.       regular ASCII keys and function keys (including the arrow keys).   The
  4554.       function and arrow keys are identified through the use of the terminal
  4555.       capabilities database.  There can be up to 32  function  keys.   There
  4556.       will always be 4 arrow keys.
  4557.  
  4558.       Facilities are provided to:
  4559.  
  4560.       1.  get all the keystrokes that were typed  since  the  last  call  on
  4561.           vt_input.get,
  4562.  
  4563.       2.  get the total number of function keys that this terminal supports,
  4564.  
  4565.       3.  get the string (name) associated with each function key,
  4566.  
  4567.  
  4568.       3.2.6.4  Parameters - None.
  4569.  
  4570.       3.2.6.5  Local Constants, Types, And Variables - The  private  limited
  4571.       type  function_key_descriptor  is  defined here.  This type is used to
  4572.       traverse the function/arrow key list whose reference is returned  from
  4573.       a  call  to vt_input.get (see below).  The user must define a variable
  4574.       of this type (or more than one) in order to use the function/arrow key
  4575.       procedures and functions.
  4576.  
  4577.       The enumerated type function_key_enum  identifies  the  function/arrow
  4578.       keys  that  are used in the function/arrow key handling procedures and
  4579.       functions.
  4580. REQUIREMENTS                                                       Page 3-92
  4581. Selectors (Functions)                                              16 Nov 84
  4582.  
  4583.  
  4584.       3.2.6.6  Selectors (Functions) -
  4585.  
  4586.       3.2.6.6.1  Getting The Number Of Typed Function/Arrow Keys -
  4587.  
  4588.       3.2.6.6.1.1  Introduction - This function is called to get the  number
  4589.       of function/arrow keys that were returned from a call on vt_input.get.
  4590.  
  4591.       3.2.6.6.1.2  The Object Name - function_count
  4592.  
  4593.       3.2.6.6.1.3  Abstract - A value  is  returned  of  type  natural  that
  4594.       identifies the number of function/arrow keys that were typed since the
  4595.       last call on vt_input.get.  There is a 20 key limit on the  number  of
  4596.       function/arrow  keys  that can be buffered.  If the number returned is
  4597.       zero then no function/arrow keys were typed since  the  last  call  on
  4598.       vt_input.get.
  4599.  
  4600.       3.2.6.6.1.4  Parameters - The  single  input  parameter  keys  is  the
  4601.       limited  private  type  returned  from the call on vt_input.get.  This
  4602.       identifies the specific list  of  function/arrow  keys  that  will  be
  4603.       operated on by this function.
  4604.  
  4605.       3.2.6.6.1.5  Local Constants, Types, And Variables - TBD
  4606.  
  4607.       3.2.6.6.1.6  Errors - The virtual terminal may not  have  been  opened
  4608.       prior to calling this procedure.
  4609.  
  4610.       3.2.6.6.1.7  Exceptions - If the virtual terminal has not been  opened
  4611.       previously  to  this then the exception vt_input.uninitialized will be
  4612.       raised.
  4613.  
  4614.       3.2.6.6.1.8  The Ada Source -
  4615.  
  4616.       FUNCTION function_count(keys : IN function_key_descriptor)
  4617.           RETURN natural;
  4618.  
  4619. REQUIREMENTS                                                       Page 3-93
  4620. Actors (Procedures)                                                16 Nov 84
  4621.  
  4622.  
  4623.       3.2.6.7  Actors (Procedures) -
  4624.  
  4625.       3.2.6.7.1  Getting Data From The Keyboard -
  4626.  
  4627.       3.2.6.7.1.1  Introduction - This procedure is called to  get  all  the
  4628.       data  typed  at  the  keyboard  since the last call on vt_input.get or
  4629.       since the virtual terminal was opened.
  4630.  
  4631.       3.2.6.7.1.2  The Object Name - get
  4632.  
  4633.       3.2.6.7.1.3  Abstract - When vt_input.get is called the keys that  the
  4634.       user struck at the actual terminal keyboard since the virtual terminal
  4635.       was opened, or since the last call to vt_input.get are returned.
  4636.  
  4637.       3.2.6.7.1.4  Parameters - A string parameter named  data  returns  the
  4638.       string  that  the user typed.  Function/arrow keys that were typed are
  4639.       not embedded in this string, they are identified seperately.  The last
  4640.       position  of  the  string  is  returned  in the parameter last of type
  4641.       natural.  A timeout can be specified of type  duration.   This  allows
  4642.       the  get  to  eventually  timeout  and  return.   A  default  for this
  4643.       parameter is specified as duration'last which is  a  system  dependent
  4644.       value.   Hopefully  it is large enough to effectively mean infinitely.
  4645.       The function/arrow keys are identified by the paramter keys of private
  4646.       limited type function_key_descriptor.
  4647.  
  4648.       Three cases are important:
  4649.  
  4650.       1.  get returns with the parameter last equal to zero, and there  were
  4651.           no  function/arrow  keys  pressed.   This  means that no keys were
  4652.           typed since the last call on get or since the virtual terminal was
  4653.           called.
  4654.  
  4655.       2.  get returns with the parameter last equal to zero, and there  were
  4656.           function/arrow  keys pressed.  This means that only function/arrow
  4657.           keys were pressed since the last call on get or since the  virtual
  4658.           terminal was initialized.
  4659.  
  4660.       3.  get returns with the parameter last not equal to  zero  and  there
  4661.           were  function/arrow  keys pressed.  Here both function/arrow keys
  4662.           and regular keys were pressed.
  4663.  
  4664.       As an example, consider the  case  where  a  user  opens  the  virtual
  4665.       terminal then presses three keys.  First an (say) "a" is pressed, then
  4666.       a function key (say "F1" on some terminal), and finally a (say) "b" is
  4667.       pressed.   The  string  parameter data would have length 2 and contain
  4668.       the characters "a" and "b" as its values.  The  keys  parameter  could
  4669.       then be used to get the function key that was pressed ("F1") by making
  4670.       a call on function_count to get the number of function keys that  were
  4671.       pressed  (this would return a 1).  Then a call on function_key passing
  4672.       in the keys parameter obtained from the call on get with the index set
  4673.       to  1  (the first key struck) will return a key_identifier which is an
  4674.       enumeration of the function key pressed (in this case an f1)  and  the
  4675.       previous_position in the string that was returned from the call on get
  4676.       (in this case it would return a 2).
  4677. REQUIREMENTS                                                       Page 3-94
  4678. Getting Data From The Keyboard                                     16 Nov 84
  4679.  
  4680.  
  4681.       3.2.6.7.1.5  Local Constants, Types, And Variables - TBD
  4682.  
  4683.       3.2.6.7.1.6  Errors - The virtual terminal may not  have  been  opened
  4684.       prior to calling this procedure.
  4685.  
  4686.       3.2.6.7.1.7  Exceptions - If the virtual terminal has not been  opened
  4687.       previously  to  this then the exception vt_input.uninitialized will be
  4688.       raised.
  4689.  
  4690.       3.2.6.7.1.8  The Ada Source -
  4691.  
  4692.       PROCEDURE get( data : OUT string;  
  4693.                      last : OUT natural;
  4694.                      keys : OUT function_key_descriptor;
  4695.                   timeout : IN duration := duration'last );
  4696.  
  4697. REQUIREMENTS                                                       Page 3-95
  4698. Getting The Specified Function/Arrow Key From The List             16 Nov 84
  4699.  
  4700.  
  4701.       3.2.6.7.2  Getting The Specified Function/Arrow Key From The List -
  4702.  
  4703.       3.2.6.7.2.1  Introduction - This  procedure  is  called  to  get   the
  4704.       specified function/arrow key from the list of function/arrow keys that
  4705.       were returned from a call on vt_input.get.
  4706.  
  4707.       3.2.6.7.2.2  The Object Name - function_key
  4708.  
  4709.       3.2.6.7.2.3  Abstract - As described in  the  procedure  vt_input.get,
  4710.       this  procedure  returns  a  key_identifier  that  has a value of type
  4711.       function_key_enum identifying the function/arrow key that  corresponds
  4712.       to  the index parameter in the list of function keys identified by the
  4713.       keys parameter.  This procedure is called repeatedly  to  process  the
  4714.       function/arrow  keys  varying  index  (usually  in ascending numerical
  4715.       order).
  4716.  
  4717.       3.2.6.7.2.4  Parameters - The parameters are:
  4718.  
  4719.       1.  keys   -   the    value    of    the    private    limited    type
  4720.           function_key_descriptor   that   was   returned  from  a  call  on
  4721.           vt_input.get.  This is a user variable.  A user may have more than
  4722.           one  of  these variables, and consequently, identify more than one
  4723.           list of function/arrow keys.
  4724.  
  4725.       2.  index - the number of  the  function/arrow  key  in  the  list  of
  4726.           function/arrow  keys  identified  by  the parameter keys, that the
  4727.           user is interested in.
  4728.  
  4729.       3.  key_identifier - returns an enumerated type which  identifies  the
  4730.           function/arrow key as described in the terminal capabilities file.
  4731.  
  4732.       4.  previous_position - a position in the  string  that  was  returned
  4733.           from a call on vt_input.get.  This position is the one immediately
  4734.           before the  function/arrow  key  was  pressed.   Three  cases  are
  4735.           important:
  4736.  
  4737.           a.  the function/arrow key was pressed before  any  of  the  other
  4738.               keys.  In this case previous_position would return a zero.
  4739.  
  4740.           b.  the functon key was the last key pressed.  In  this  case  the
  4741.               value returned would be the same as last.
  4742.  
  4743.           c.  the function/arrow key  was  pressed  in  the  middle  of  the
  4744.               string.   In  this  case  the  character  position  before the
  4745.               function/arrow key would be returned.
  4746.  
  4747.  
  4748.       An example.  Consider the case where a character "a" was pressed, then
  4749.       function key "F9" (as defined in the terminal capabilities file), then
  4750.       the key "b".  vt_input.get would return
  4751.  
  4752.       data  =  "ab"
  4753.       last  =  2
  4754.       a reference to keys
  4755. REQUIREMENTS                                                       Page 3-96
  4756. Getting The Specified Function/Arrow Key From The List             16 Nov 84
  4757.  
  4758.  
  4759.  
  4760.       When vt_input.function_key is called and passed the reference to  keys
  4761.       and   the   index  =  1,  then  key_identifier  would  return  f9  and
  4762.       previous_position would return 1.
  4763.  
  4764.       3.2.6.7.2.5  Local Constants, Types, And Variables - TBD.
  4765.  
  4766.       3.2.6.7.2.6  Errors - The virtual terminal may not  have  been  opened
  4767.       prior   to   calling   this  procedure.   The  index  may  indicate  a
  4768.       function/arrow key that is illegal.
  4769.  
  4770.       3.2.6.7.2.7  Exceptions - If the virtual terminal has not been  opened
  4771.       previously  to  this then the exception vt_input.uninitialized will be
  4772.       raised.  The exception invalid_function_key may be  raised  from  this
  4773.       procedure.
  4774.  
  4775.       3.2.6.7.2.8  The Ada Source -
  4776.  
  4777.       PROCEDURE function_key(keys           : IN     function_key_descriptor;
  4778.                              index          : IN     positive;
  4779.                              key_identifier :    OUT function_key_enum;
  4780.                           previous_position :    OUT natural);
  4781.  
  4782. REQUIREMENTS                                                       Page 3-97
  4783. Getting The Name Of A Function Key                                 16 Nov 84
  4784.  
  4785.  
  4786.       3.2.6.7.3  Getting The Name Of A Function Key -
  4787.  
  4788.       3.2.6.7.3.1  Introduction - The procedure is called to get the name of
  4789.       the function key (as it appears on the actual terminal keyboard).
  4790.  
  4791.       3.2.6.7.3.2  The Object Name - function_key_name
  4792.  
  4793.       3.2.6.7.3.3  Abstract - This procedure returns a string  that  is  the
  4794.       name  of  the  function  key.   This information is extracted from the
  4795.       terminal capabilities database when the virtual terminal is opened and
  4796.       stored in the tcf package data structures.
  4797.  
  4798.       3.2.6.7.3.4  Parameters - The parameters are:
  4799.  
  4800.       1.  key_identifier - a  value  of  enumerated  type  function_key_enum
  4801.           which identifies the function key of interest.
  4802.  
  4803.       2.  key_name - a string which is the function key name as  it  appears
  4804.           in the terminal capabilities file (exactly).
  4805.  
  4806.       3.  last - a natural number which is the last  character  position  in
  4807.           the key_name.
  4808.  
  4809.       This version of the terminal capabilities file limits  the  number  of
  4810.       function keys to 32 (plus the four arrow keys).
  4811.  
  4812.       3.2.6.7.3.5  Local Constants, Types, And Variables - TBD.
  4813.  
  4814.       3.2.6.7.3.6  Errors - The virtual terminal may not  have  been  opened
  4815.       prior to calling this procedure.
  4816.  
  4817.       3.2.6.7.3.7  Exceptions - If the virtual terminal has not been  opened
  4818.       previously  to  this then the exception vt_input.uninitialized will be
  4819.       raised.
  4820.  
  4821.       3.2.6.7.3.8  The Ada Source -
  4822.  
  4823.       PROCEDURE function_key_name
  4824.           key_identifier : IN     positive;
  4825.           key_name       :    OUT string;
  4826.           last           :    OUT natural);
  4827.  
  4828.  
  4829.       3.2.6.8  Errors - A call could be made on any of these  procedures  or
  4830.       functions without previously having intialized the actual terminal.
  4831.  
  4832.       3.2.6.9  Exceptions - The exception vt_input.uninitialized  is  raised
  4833.       if the actual terminal has not been initialized (by a previous call to
  4834.       driver.virtual_terminal_initialize).
  4835. REQUIREMENTS                                                       Page 3-98
  4836. The Ada Source                                                     16 Nov 84
  4837.  
  4838.  
  4839.       3.2.6.10  The Ada Source -
  4840.  
  4841.       PACKAGE vt_input IS
  4842.  
  4843.           TYPE function_key_enum IS
  4844.             ( up_arrow,       down_arrow,     left_arrow,     right_arrow,
  4845.               f1,     f2,     f3,     f4,     f5,     f6,     f7,     f8,
  4846.               f9,     f10,    f11,    f12,    f13,    f14,    f15,    f16,
  4847.               f17,    f18,    f19,    f20,    f21,    f22,    f23,    f24,
  4848.               f25,    f26,    f27,    f28,    f29,    f30,    f31,    f32 );
  4849.  
  4850.           TYPE function_key_descriptor IS LIMITED PRIVATE;
  4851.  
  4852.           PROCEDURE get( data : OUT string;  
  4853.                          last : OUT natural;
  4854.                          keys : OUT function_key_descriptor;
  4855.                       timeout : IN  duration := duration'last );
  4856.  
  4857.           FUNCTION function_count(keys : IN function_key_descriptor)
  4858.               RETURN natural;
  4859.  
  4860.           PROCEDURE function_key(keys           : IN     function_key_descriptor;
  4861.                                  index          : IN     positive;
  4862.                                  key_identifier :    OUT function_key_enum;
  4863.                               previous_position :    OUT natural);
  4864.  
  4865.           PROCEDURE function_key_name
  4866.               key_identifier : IN     function_key_enum;
  4867.               key_name       :    OUT string;
  4868.               last           :    OUT natural);
  4869.  
  4870.           invalid_function_key  : EXCEPTION;
  4871.           uninitialized         : EXCEPTION;
  4872.  
  4873.           PRIVATE
  4874.  
  4875.               TYPE funtion_key_descriptor IS positive;
  4876.  
  4877.       END vt_input;
  4878.  
  4879. REQUIREMENTS                                                       Page 3-99
  4880. The Redisplay Package                                              16 Nov 84
  4881.  
  4882.  
  4883.       3.2.7  The Redisplay Package
  4884.  
  4885.       3.2.7.1  Introduction - The redisplay package performs the function of
  4886.       mapping   characters  and  lines  from  the  data  structures  of  the
  4887.       vt_content package to the actual display.
  4888.  
  4889.       3.2.7.2  The Object Name - redisplay
  4890.  
  4891.       3.2.7.3  Abstract -
  4892.  
  4893.       The redisplay package WITH's the vt_content package to make  the  data
  4894.       structures  in  vt_content  visible to redisplay.  The vt_content data
  4895.       structures describe how the image on the actual  display  looks  after
  4896.       the  redisplay  package  is  invoked  and  how the image of the actual
  4897.       display looks before the redisplay package is invoked.  When a  change
  4898.       is  made to the data structures in vt_content, the image on the actual
  4899.       display must be updated to reflect the change.
  4900.  
  4901.       3.2.7.4  Parameters - None.
  4902.  
  4903.       3.2.7.5  Local Constants, Types, And Variables - Tbd.
  4904.  
  4905.       3.2.7.6  Selectors (Functions) - None.
  4906. REQUIREMENTS                                                      Page 3-100
  4907. Actors (Procedures)                                                16 Nov 84
  4908.  
  4909.  
  4910.       3.2.7.7  Actors (Procedures) -
  4911.  
  4912.       3.2.7.7.1  Redisplay_screen_with_movement -
  4913.  
  4914.       3.2.7.7.1.1  Introduction - This  procedure  transforms  the   present
  4915.       screen display into the desired screen display.
  4916.  
  4917.       3.2.7.7.1.2  Abstract - Redisplay.redisplay_screen_with_movement   has
  4918.       two  input  parameters  that  are pointers to a record of arrays.  The
  4919.       record vt_content.vt_content_record describes the display.  The arrays
  4920.       vt_content.vt_column_array  in  this  record  represent the individual
  4921.       lines of the display.
  4922.  
  4923.       This procedure uses insert and delete line to map the data  structures
  4924.       of  the  virtual display onto the actual display minimizing the number
  4925.       of insertions and deletions used.  The  redisplay_screen_with_movement
  4926.       procedure  makes  repeated  calls  to the redisplay_line_with_movement
  4927.       procedures to redisplay the entire display.
  4928.  
  4929.       3.2.7.7.1.3  Parameters -
  4930.  
  4931.        *  old_screen - how the actual display  looks  before  the  redisplay
  4932.           package  is  called.   The old_screen parameter will look like the
  4933.           new_screen parameter after redisplay is invoked.
  4934.  
  4935.        *  new_screen - how the actual  display  looks  after  the  redisplay
  4936.           package is called.
  4937.  
  4938.  
  4939.       3.2.7.7.1.4  Local Constants, Types, And Variables - TBD.
  4940.  
  4941.       3.2.7.7.1.5  Errors - The virtual terminal may not  have  been  opened
  4942.       prior to calling this procedure.
  4943.  
  4944.       3.2.7.7.1.6  Exceptions - If the virtual terminal has not been  opened
  4945.       previously  to this then the exception redisplay.uninitialized will be
  4946.       raised.
  4947.  
  4948.       3.2.7.7.1.7  The Ada Source -
  4949.  
  4950.       PROCEDURE redisplay_screen_with_movement(
  4951.                          old_screen : IN OUT vt_contents.vt_content_access;
  4952.                          new_screen : IN OUT vt_contents.vt_content_access;
  4953.  
  4954. REQUIREMENTS                                                      Page 3-101
  4955. Redisplay_screen_with_redraw                                       16 Nov 84
  4956.  
  4957.  
  4958.       3.2.7.7.2  Redisplay_screen_with_redraw -
  4959.  
  4960.       3.2.7.7.2.1  Introduction - This procedure determines the  differences
  4961.       between  the present screen display and the desired screen display and
  4962.       redraws those differences to the actual display.
  4963.  
  4964.       3.2.7.7.2.2  Redisplay_screen_with_redraw -
  4965.  
  4966.       3.2.7.7.2.3  Abstract - Redisplay.redisplay_screen_with_redraw has two
  4967.       input  parameters that are pointers to a record of arrays.  The record
  4968.       vt_content.vt_content_record  describes  the  display.    The   arrays
  4969.       vt_content.vt_column_array  in  this  record  represent the individual
  4970.       lines of the display.
  4971.  
  4972.       This procedure redraws the differences found  between  the  two  input
  4973.       parameters  onto the actual display.  The redisplay_screen_with_redraw
  4974.       procedure  makes  repeated  calls  to  the  redisplay_line_with_redraw
  4975.       procedures to map the entire display.
  4976.  
  4977.       3.2.7.7.2.4  Parameters -
  4978.  
  4979.        *  old_screen - how the actual display  looks  before  the  redisplay
  4980.           package  is  called.   The old_screen parameter will look like the
  4981.           new_screen parameter after redisplay is invoked.
  4982.  
  4983.        *  new_screen - how the actual  display  looks  after  the  redisplay
  4984.           package is called.
  4985.  
  4986.  
  4987.       3.2.7.7.2.5  Local Constants, Types, And Variables - TBD.
  4988.  
  4989.       3.2.7.7.2.6  Errors - The virtual terminal may not  have  been  opened
  4990.       prior to calling this procedure.
  4991.  
  4992.       3.2.7.7.2.7  Exceptions - If the virtual terminal has not been  opened
  4993.       previously  to this then the exception redisplay.uninitialized will be
  4994.       raised.
  4995.  
  4996.       3.2.7.7.2.8  The Ada Source -
  4997.  
  4998.       PROCEDURE redisplay_screen_with_redraw(
  4999.                          old_screen : IN OUT vt_contents.vt_content_access;
  5000.                          new_screen : IN vt_contents.vt_content_access );
  5001.  
  5002. REQUIREMENTS                                                      Page 3-102
  5003. Redisplay_line_with_movement                                       16 Nov 84
  5004.  
  5005.  
  5006.       3.2.7.7.3  Redisplay_line_with_movement -
  5007.  
  5008.       3.2.7.7.3.1  Introduction - This procedure transforms the present line
  5009.       of the display into the desired line of the display.
  5010.  
  5011.       3.2.7.7.3.2  The Object Name - redisplay_line_with_movement
  5012.  
  5013.       3.2.7.7.3.3  Abstract - Redisplay.redisplay_line_with_movement has two
  5014.       input      parameters      that      are     arrays     of     records
  5015.       vt_contents.vt_column_array describing a line  on  the  display.   The
  5016.       records   of  the  vt_content.vt_column_array  describe  the  terminal
  5017.       rendition, the qualifiers, the data, and the tab sets for each array.
  5018.  
  5019.       This procedure uses insert and delete character to map the data   
  5020.       structures  of  the virtual display onto the actual display minimizing
  5021.       the number of insertions and deletions used.
  5022.  
  5023.       3.2.7.7.3.4  Parameters -
  5024.  
  5025.        *  old_line - how the  actual  display  looks  before  the  redisplay
  5026.           package  is  called.   The  old_line  parameter will look like the
  5027.           new_line parameter after redisplay is invoked.
  5028.  
  5029.        *  new_line - how  the  actual  display  looks  after  the  redisplay
  5030.           package is called.
  5031.  
  5032.  
  5033.       3.2.7.7.3.5  Local Constants, Types, And Variables - TBD.
  5034.  
  5035.       3.2.7.7.3.6  Errors - The virtual terminal may not  have  been  opened
  5036.       prior to calling this procedure.
  5037.  
  5038.       3.2.7.7.3.7  Exceptions - If the virtual terminal has not been  opened
  5039.       previously  to this then the exception redisplay.uninitialized will be
  5040.       raised.
  5041.  
  5042.       3.2.7.7.3.8  The Ada Source -
  5043.  
  5044.           PROCEDURE redisplay_line_with_movement( 
  5045.                              old_line : IN OUT vt_contents.vt_column_array;
  5046.                              new_line : IN vt_contents.vt_column_array );
  5047.  
  5048. REQUIREMENTS                                                      Page 3-103
  5049. Redisplay_line_with_redraw                                         16 Nov 84
  5050.  
  5051.  
  5052.       3.2.7.7.4  Redisplay_line_with_redraw -
  5053.  
  5054.       3.2.7.7.4.1  Introduction - This procedure determines the  differences
  5055.       between  the  present  line  and  the  desired  line and redraws those
  5056.       differences to the actual display.
  5057.  
  5058.       3.2.7.7.4.2  The Object Name - redisplay_line_with_redraw
  5059.  
  5060.       3.2.7.7.4.3  Abstract - Redisplay.redisplay_line_with_redraw  has  two
  5061.       input  parameters  that are arrays of records describing a line on the
  5062.       display.  The records of the vt_content.vt_column_array  describe  the
  5063.       terminal  rendition,  the  qualifiers,  the data, and the tab sets for
  5064.       each array.
  5065.  
  5066.       This procedure redraws the differences found  between  the  two  input
  5067.       parameters onto the actual display.
  5068.  
  5069.       3.2.7.7.4.4  Parameters -
  5070.  
  5071.        *  old_line - how the  actual  display  looks  before  the  redisplay
  5072.           package  is  called.   The  old_line  parameter will look like the
  5073.           new_line parameter after redisplay is invoked.
  5074.  
  5075.        *  new_line - how  the  actual  display  looks  after  the  redisplay
  5076.           package is called.
  5077.  
  5078.  
  5079.       3.2.7.7.4.5  Local Constants, Types, And Variables - Tbd.
  5080.  
  5081.       3.2.7.7.4.6  Errors - The virtual terminal may not  have  been  opened
  5082.       prior to calling this procedure.
  5083.  
  5084.       3.2.7.7.4.7  Exceptions - If the virtual terminal has not been  opened
  5085.       previously  to this then the exception redisplay.uninitialized will be
  5086.       raised.
  5087.  
  5088.       3.2.7.7.4.8  The Ada Source -
  5089.  
  5090.            PROCEDURE redisplay_line_with_redraw( 
  5091.                              old_line : IN OUT vt_contents.vt_column_array;
  5092.                              new_line : IN vt_contents.vt_column_array );
  5093. REQUIREMENTS                                                      Page 3-104
  5094. Redraw_screen                                                      16 Nov 84
  5095.  
  5096.  
  5097.       3.2.7.7.5  Redraw_screen -
  5098.  
  5099.       3.2.7.7.5.1  Introduction - This procedure redraws the entire display.
  5100.  
  5101.       3.2.7.7.5.2  Redraw_screen -
  5102.  
  5103.       3.2.7.7.5.3  Abstract - Redisplay.redraw_screen    has    two    input
  5104.       parameter  that  are  pointers  to  a  record  of  arrays.  The record
  5105.       vt_content.vt_content_record  describes  the  display.    The   arrays
  5106.       vt_content.vt_column_array  in  this  record represents the individual
  5107.       lines of the display.
  5108.  
  5109.       This procedure clears the  terminal  screen,  blanks  out  the  actual
  5110.       display and calls redisplay_screen_with_movement.
  5111.  
  5112.       3.2.7.7.5.4  Parameters -
  5113.  
  5114.        *  old_screen - how the actual display  looks  before  the  redisplay
  5115.           package  is  called.   The old_screen parameter will look like the
  5116.           new_screen parameter after redisplay is invoked.
  5117.  
  5118.        *  new_screen - how the actual  display  looks  after  the  redisplay
  5119.           package is called.
  5120.  
  5121.  
  5122.       3.2.7.7.5.5  Local Constants, Types, And Variables - Tbd.
  5123.  
  5124.       3.2.7.7.5.6  Errors - The virtual terminal may not  have  been  opened
  5125.       prior to calling this procedure.
  5126.  
  5127.       3.2.7.7.5.7  Exceptions - If the virtual terminal has not been  opened
  5128.       previously  to this then the exception redisplay.uninitialized will be
  5129.       raised.
  5130.  
  5131.       3.2.7.7.5.8  The Ada Source -
  5132.  
  5133.           PROCEDURE redraw_screen(
  5134.                              old_screen : IN OUT vt_contents.vt_column_array;
  5135.                              new_screen : IN vt_contents.vt_column_array );
  5136.  
  5137.           uninitialized        : EXCEPTION;
  5138.  
  5139. REQUIREMENTS                                                      Page 3-105
  5140. Errors                                                             16 Nov 84
  5141.  
  5142.  
  5143.       3.2.7.8  Errors - As described in the individual sections.
  5144.  
  5145.       3.2.7.9  Exceptions - As described in the inidividual sections.
  5146.  
  5147.       3.2.7.10  The Ada Source -
  5148.  
  5149.           PROCEDURE redisplay_screen_with_movement( 
  5150.                              old_screen : IN OUT vt_contents.vt_content_access;
  5151.                              new_screen : IN vt_contents.vt_content_access );
  5152.         
  5153.           PROCEDURE redisplay_screen_with_redraw( 
  5154.                              old_screen : IN OUT vt_contents.vt_content_access;
  5155.                              new_screen : IN vt_contents.vt_content_access );
  5156.  
  5157.  
  5158.           PROCEDURE redisplay_line_with_movement( 
  5159.                              old_line : IN OUT vt_contents.vt_column_array;
  5160.                              new_line : IN vt_contents.vt_column_array );
  5161.  
  5162.  
  5163.           PROCEDURE redisplay_line_with_redraw( 
  5164.                              old_line : IN OUT vt_contents.vt_column_array;
  5165.                              new_line : IN vt_contents.vt_column_array );
  5166.  
  5167.           PROCEDURE redraw_screen(
  5168.                              old_screen : IN OUT vt_contents.vt_column_array;
  5169.                              new_screen : IN vt_contents.vt_column_array );
  5170.  
  5171.           uninitialized        : EXCEPTION;
  5172.  
  5173.       END redisplay;
  5174.        
  5175. REQUIREMENTS                                                      Page 3-106
  5176. The Driver Package Specification                                   16 Nov 84
  5177.  
  5178.  
  5179.       3.2.8  The Driver Package Specification
  5180.  
  5181.       3.2.8.1  Introduction      - This section  defines  the  specification
  5182.       for the driver package.
  5183.  
  5184.       3.2.8.2  The Object Name - driver                         
  5185.  
  5186.       3.2.8.3  Abstract  - The  driver  package   performs   the   following
  5187.       functions:
  5188.  
  5189.        *  Initialize the actual terminal,
  5190.  
  5191.        *  Initialize the TCF,
  5192.  
  5193.        *  Interpret the ANSI compatible character codes and  translate  them
  5194.           into device specific character codes.
  5195.  
  5196.        *  close the actual terminal.
  5197.  
  5198.  
  5199.       3.2.8.4  Parameters - none
  5200.  
  5201.       3.2.8.5  Local Constants, Types, And Variables -
  5202.  
  5203.        *  terminal_capabilites_enum - An enumeration  type  identifying  the
  5204.           terminal capabilities.
  5205.  
  5206.        *  terminal_capabilities_set - a boolean array of an  enumeration  of
  5207.           terminal capabilities.
  5208.  
  5209.        *  supported_functions - a variable of type  terminal_capabilties_set
  5210.           that  identifies  which  functions  are  directly supported by the
  5211.           actual display.
  5212.  
  5213.  
  5214.       3.2.8.6  Selectors (Functions) - none
  5215. REQUIREMENTS                                                      Page 3-107
  5216. Actors (Procedures)                                                16 Nov 84
  5217.  
  5218.  
  5219.       3.2.8.7  Actors (Procedures)       - The following pages describe  the
  5220.       specifications for the procedures of the driver package specification.
  5221.  
  5222.       3.2.8.7.1  Initializeing The Virtual Terminal -
  5223.  
  5224.       3.2.8.7.1.1  Introduction - This procedure is called to initialize the
  5225.       actual terminal.
  5226.  
  5227.       3.2.8.7.1.2  The Object Name - virtual_terminal_initialize        
  5228.  
  5229.       3.2.8.7.1.3  Abstract - This procedure is  called  to  initialize  the
  5230.       virtual terminal.  It precedes any other calls to the virtual terminal
  5231.       procedures and/or functions.  This procedure makes a call to  the  tcf
  5232.       package  to  initialize  the terminal capabilities file.  If the input
  5233.       parameter 'name' is empty then the SYSDEP package is invoked.
  5234.  
  5235.       3.2.8.7.1.4  Parameters -
  5236.  
  5237.        *  name - A variable length character string holding  terminal  name.
  5238.           This  name  must  match an entry in the terminal capabilities file
  5239.           exactly (case and character).
  5240.  
  5241.        *  lines - the number of  lines  that  the  actual  terminal  display
  5242.           contains.
  5243.  
  5244.        *  columns - the number of columns that the actual  terminal  display
  5245.           contains.
  5246.  
  5247.  
  5248.       3.2.8.7.1.5  Errors -
  5249.  
  5250.        *  missing tcf - the tcf either could not be opened or could  not  be
  5251.           read for some system dependent reason.
  5252.  
  5253.        *  unsupported terminal - the terminal name could not be found in the
  5254.           terminal capabilities file.
  5255.  
  5256.        *  missing capabilities - the terminal does not have the capabilities
  5257.           necessary to support the virtual terminal.
  5258.  
  5259.  
  5260.       3.2.8.7.1.6  Exceptions - The following exception can be  raised  from
  5261.       this procedure:
  5262.  
  5263.        *  tcf_error
  5264.  
  5265.        *  name_error
  5266.  
  5267.        *  unsupported_terminal
  5268.  
  5269. REQUIREMENTS                                                      Page 3-108
  5270. Initializeing The Virtual Terminal                                 16 Nov 84
  5271.  
  5272.  
  5273.       3.2.8.7.1.7  The Ada Source -
  5274.  
  5275.       PROCEDURE virtual_terminal_initialize(
  5276.                         name          : IN string;
  5277.                         lines         : OUT positive;
  5278.                         columns       : OUT positive );
  5279.  
  5280. REQUIREMENTS                                                      Page 3-109
  5281. Closing The Virtual Terminal                                       16 Nov 84
  5282.  
  5283.  
  5284.       3.2.8.7.2  Closing The Virtual Terminal -
  5285.  
  5286.       3.2.8.7.2.1  Introduction - This procedure  is  called  to  close  the
  5287.       actual terminal.
  5288.  
  5289.       3.2.8.7.2.2  The Object Name - close_virtual_terminal             
  5290.  
  5291.       3.2.8.7.2.3  Abstract - This procedure is called  to  reestablish  the
  5292.       original  terminal characteristics and close the virtual terminal.  No
  5293.       virtual terminal procedures or functions should be called  after  this
  5294.       procedure      (this      naturally     excludes     the     procedure
  5295.       virtual_terminal_initialize).  If the  virtual  terminal  has  already
  5296.       been closed then this procedure performs no operation.
  5297.  
  5298.       3.2.8.7.2.4  Parameters - none
  5299.  
  5300.       3.2.8.7.2.5  Local Constants, Types, And Variables - tbd
  5301.  
  5302.       3.2.8.7.2.6  Errors - None.
  5303.  
  5304.       3.2.8.7.2.7  Exceptions - None.
  5305.  
  5306.       3.2.8.7.2.8  The Ada Source -
  5307.  
  5308.       PROCEDURE close_virtual_terminal;
  5309.  
  5310. REQUIREMENTS                                                      Page 3-110
  5311. Interpreting ANSI Character Sequences                              16 Nov 84
  5312.  
  5313.  
  5314.       3.2.8.7.3  Interpreting ANSI Character Sequences -
  5315.  
  5316.       3.2.8.7.3.1  Introduction - This   procedure    interprets    incoming
  5317.       commands from the user program using the terminal capabilities for the
  5318.       particular terminal.
  5319.  
  5320.       3.2.8.7.3.2  The Object Name - interpret
  5321.  
  5322.       3.2.8.7.3.3  Abstract - The interpret procedure accepts input  in  the
  5323.       form  of  a  command  string  passed  in  as  an  input  parameter and
  5324.       translates this command into the particular escape sequences  for  the
  5325.       specific  terminal.   The  translation  uses  the  information  in the
  5326.       terminal capabilities data structures (within the package  TCF).   See
  5327.       an  appendix  for  a  description  of  the  ANSI  sequences  that  are
  5328.       interpreted.
  5329.  
  5330.       3.2.8.7.3.4  Parameters -
  5331.  
  5332.        *  command_string - a command from the user's program to  be  scanned
  5333.           and parsed into escape sequences.
  5334.  
  5335.  
  5336.       3.2.8.7.3.5  Local Constants, Types, And Variables - tbd
  5337.  
  5338.       3.2.8.7.3.6  Actors  (Procedures) - The   following   procedures   are
  5339.       discussed in the package body of driver.
  5340.  
  5341.        *  erase_to_end_of_screen
  5342.  
  5343.        *  erase_to_end_of_line
  5344.  
  5345.        *  move_the_cursor_to
  5346.  
  5347.        *  insert_line
  5348.  
  5349.        *  delete_line
  5350.  
  5351.        *  delete_character
  5352.  
  5353.        *  beep
  5354.  
  5355.        *  write_string
  5356.  
  5357.        *  new_line
  5358.  
  5359.        *  read_string
  5360.  
  5361.        *  turn_on_highlighting
  5362.  
  5363.        *  turn_off_highlighting
  5364. REQUIREMENTS                                                      Page 3-111
  5365. Interpreting ANSI Character Sequences                              16 Nov 84
  5366.  
  5367.  
  5368.        *  enter_insert_mode
  5369.  
  5370.        *  exit_insert_mode
  5371.  
  5372.        *  scroll_up
  5373.  
  5374.        *  scroll_down
  5375.  
  5376.  
  5377.       3.2.8.7.3.7  Errors - The  virtual  terminal   may   not   have   been
  5378.       initialized prior to a call on this procedure.
  5379.  
  5380.       3.2.8.7.3.8  Exceptions - The exception driver.uninitialized  will  be
  5381.       raised  if  the  virtual  terminal  has  not been initialized prior to
  5382.       calling this procedure.
  5383.  
  5384.       3.2.8.7.3.9  The Ada Source -
  5385.  
  5386.       PROCEDURE interpret (command_string : string);
  5387.  
  5388. REQUIREMENTS                                                      Page 3-112
  5389. Errors                                                             16 Nov 84
  5390.  
  5391.  
  5392.       3.2.8.8  Errors - See the individual sections.
  5393.  
  5394.       3.2.8.9  Exceptions - See the individual sections.
  5395.  
  5396.       3.2.8.10  The Ada Source   -
  5397.  
  5398.       PACKAGE driver IS
  5399.  
  5400.       -- Types
  5401.  
  5402.                 TYPE terminal_capabilities_enum IS
  5403.                          ( erase_to_end_of_screen_is,
  5404.                            erase_to_end_of_line_is,
  5405.                            move_the_cursor_is,
  5406.                            insert_line_is,
  5407.                            delete_line_is,
  5408.                            delete_character_is,
  5409.                            beep_is,
  5410.                            highlight_is,
  5411.                            insert_mode_is,
  5412.                            scroll_up_is,
  5413.                            scroll_down_is );
  5414.  
  5415.               TYPE terminal_capabilities_set IS 
  5416.                       array( terminal_capabilities_enum ) OF boolean;
  5417.  
  5418.       -- Variables
  5419.  
  5420.               supported_functions      : terminal_capabilities_set;
  5421.  
  5422.       -- Procedures
  5423.  
  5424.       PROCEDURE virtual_terminal_initialize(
  5425.                       name  : IN string;
  5426.                       lines : OUT positive;
  5427.                     columns : OUT Positive );
  5428.  
  5429.       PROCEDURE close_virtual_terminal;
  5430.  
  5431.       PROCEDURE interpret ( command_string : IN string);
  5432.  
  5433.       uninitialized        : EXCEPTION;
  5434.       name_error           : EXCEPTION;
  5435.       tcf_error            : EXCEPTION;
  5436.       unsupported_terminal : EXCEPTION;
  5437.  
  5438.       END driver;
  5439.  
  5440. REQUIREMENTS                                                      Page 3-113
  5441. The Driver Package Body                                            16 Nov 84
  5442.  
  5443.  
  5444.       3.2.9  The Driver Package Body
  5445.  
  5446.       3.2.9.1  Introduction - This section defines the body  of  the  driver
  5447.       package.
  5448.  
  5449.       3.2.9.2  The Object Name - driver
  5450.  
  5451.       3.2.9.3  Abstract - The  driver   package   performs   the   following
  5452.       functions:
  5453.  
  5454.        *  Initialize the actual terminal,
  5455.  
  5456.        *  Initialize the TCF,
  5457.  
  5458.        *  Interpret the ANSI compatible character codes and  translate  them
  5459.           into device specific character codes.
  5460.  
  5461.        *  close the actual terminal.
  5462.  
  5463.  
  5464.       3.2.9.4  Parameters - none
  5465.  
  5466.       3.2.9.5  Local Constants, Types, And Variables - tbd
  5467. REQUIREMENTS                                                      Page 3-114
  5468. Actors (Procedures)                                                16 Nov 84
  5469.  
  5470.  
  5471.       3.2.9.6  Actors (Procedures) - The following procedures  are  part  of
  5472.       the Interpret specification in the Driver package specification.
  5473.  
  5474.       3.2.9.6.1  Erasing To The End Of The Screen -
  5475.  
  5476.       3.2.9.6.1.1  Introduction  - The   erase_to_end_of_screen    procedure
  5477.       erases from the current cursor position to the end of screen.
  5478.  
  5479.       3.2.9.6.1.2  The Object Name - erase_to_end_of_screen
  5480.  
  5481.       3.2.9.6.1.3  Abstract - This procedure is called  to  erase  from  the
  5482.       current  cursor  location to the end of the screen.  The cursor is not
  5483.       moved.
  5484.  
  5485.       3.2.9.6.1.4  Parameters - None.
  5486.  
  5487.       3.2.9.6.1.5  Local Constants, Types, And Variables - tbd
  5488.  
  5489.       3.2.9.6.1.6  Errors - The  actual   terminal   may   not   have   been
  5490.       initialized prior to a call to this procedure.
  5491.  
  5492.       3.2.9.6.1.7  Exceptions - If the actual terminal  has  not  previously
  5493.       been initialized then the exception driver.unitialized is raised.
  5494.  
  5495.       3.2.9.6.1.8  The Ada Source -
  5496.  
  5497.       PROCEDURE erase_to_end_of_screen;
  5498.  
  5499. REQUIREMENTS                                                      Page 3-115
  5500. Erasing To The End Of A Line                                       16 Nov 84
  5501.  
  5502.  
  5503.       3.2.9.6.2  Erasing To The End Of A Line -
  5504.  
  5505.       3.2.9.6.2.1  Introduction - The erase_to_end_of_line procedure  erases
  5506.       from the current cursor position to the end of the current line.
  5507.  
  5508.       3.2.9.6.2.2  The Object Name - erase_to_end_of_line       
  5509.  
  5510.       3.2.9.6.2.3  Abstract - This procedure is called  to  erase  from  the
  5511.       current cursor location to the end of the current line.  The cursor is
  5512.       left at the point it was originally.
  5513.  
  5514.       3.2.9.6.2.4  Parameters - none
  5515.  
  5516.       3.2.9.6.2.5  Local Constants, Types, And Variables - tbd
  5517.  
  5518.       3.2.9.6.2.6  Errors - The  actual   terminal   may   not   have   been
  5519.       initialized prior to a call to this procedure.
  5520.  
  5521.       3.2.9.6.2.7  Exceptions - If the actual terminal  has  not  previously
  5522.       been initialized then the exception driver.unitialized is raised.
  5523.  
  5524.       3.2.9.6.2.8  The Ada Source -
  5525.  
  5526.       PROCEDURE erase_to_end_of_line;
  5527.  
  5528. REQUIREMENTS                                                      Page 3-116
  5529. Moving The Cursor                                                  16 Nov 84
  5530.  
  5531.  
  5532.       3.2.9.6.3  Moving The Cursor -
  5533.  
  5534.       3.2.9.6.3.1  Introduction - The move_the_cursor_to procedure moves the
  5535.       cursor a specified point on the actual terminal screen.
  5536.  
  5537.       3.2.9.6.3.2  The Object Name - move_the_cursor_to
  5538.  
  5539.       3.2.9.6.3.3  Abstract - This procedure is called to move the cursor to
  5540.       the  specified position on the display screen.  If the values of x and
  5541.       y are outside the legal range unpredictable results may occur.    
  5542.  
  5543.       3.2.9.6.3.4  Parameters -
  5544.  
  5545.        *  p_x - the x (column) coordinate.
  5546.  
  5547.        *  p_y - the y (line) coordinate.
  5548.  
  5549.  
  5550.       3.2.9.6.3.5  Local Constants, Types, And Variables - tbd
  5551.  
  5552.       3.2.9.6.3.6  Errors - The  actual   terminal   may   not   have   been
  5553.       initialized prior to a call to this procedure.
  5554.  
  5555.       3.2.9.6.3.7  Exceptions - If the actual terminal  has  not  previously
  5556.       been initialized then the exception driver.unitialized is raised.
  5557.  
  5558.       3.2.9.6.3.8  The Ada Source -
  5559.  
  5560.       PROCEDURE move_the_cursor_to( 
  5561.                     p_x  : IN positive;
  5562.                     p_y  : IN positive );
  5563.  
  5564. REQUIREMENTS                                                      Page 3-117
  5565. Inserting A Line                                                   16 Nov 84
  5566.  
  5567.  
  5568.       3.2.9.6.4  Inserting A Line -
  5569.  
  5570.       3.2.9.6.4.1  Introduction - The insert_line procedure  will  insert  a
  5571.       blank  line  on the terminal screen at the line on which the cursor is
  5572.       located.
  5573.  
  5574.       3.2.9.6.4.2  The Object Name - insert_line
  5575.  
  5576.       3.2.9.6.4.3  Abstract - This procedure is called  to  insert  a  blank
  5577.       line on the display at the line on which the cursor is placed.  All of
  5578.       the lines including and below  the  line  containing  the  cursor  are
  5579.       pushed down one line and the bottom line is lost.  The cursor is moved
  5580.       to the beginning of the blank line.  To be  safe,  you  should  always
  5581.       place  the  cursor  at  the  beginning  of the line before issuing the
  5582.       procedure call.
  5583.  
  5584.       3.2.9.6.4.4  Parameters - None.
  5585.  
  5586.       3.2.9.6.4.5  Local Constants, Types, And Variables - tbd
  5587.  
  5588.       3.2.9.6.4.6  Errors - The  actual   terminal   may   not   have   been
  5589.       initialized prior to a call to this procedure.
  5590.  
  5591.       3.2.9.6.4.7  Exceptions - If the actual terminal  has  not  previously
  5592.       been initialized then the exception driver.unitialized is raised.
  5593.  
  5594.       3.2.9.6.4.8  The Ada Source -
  5595.  
  5596.       PROCEDURE insert_line;
  5597.  
  5598. REQUIREMENTS                                                      Page 3-118
  5599. Deleting A Line                                                    16 Nov 84
  5600.  
  5601.  
  5602.       3.2.9.6.5  Deleting A Line -
  5603.  
  5604.       3.2.9.6.5.1  Introduction - The delete_line procedure deletes lines at
  5605.       the current cursor position.
  5606.  
  5607.       3.2.9.6.5.2  The Object Name - delete_line
  5608.  
  5609.       3.2.9.6.5.3  Abstract - The procedure delete_line is called to  delete
  5610.       the  line  containing  the cursor.  The lines below the one containing
  5611.       the cursor are moved up and a blank line appears at the  bottom.   The
  5612.       cursor  is  left at the beginning of the line on which it was residing
  5613.       before the procedure call (now, of course, containing new  data).   To
  5614.       be  safe,  you  should always place the cursor at the beginning of the
  5615.       line before issuing the procedure call.
  5616.  
  5617.       3.2.9.6.5.4  Parameters - None.
  5618.  
  5619.       3.2.9.6.5.5  Local Constants, Types, And Variables - tbd
  5620.  
  5621.       3.2.9.6.5.6  Errors - The  actual   terminal   may   not   have   been
  5622.       initialized prior to a call to this procedure.
  5623.  
  5624.       3.2.9.6.5.7  Exceptions - If the actual terminal  has  not  previously
  5625.       been initialized then the exception driver.unitialized is raised.
  5626.  
  5627.       3.2.9.6.5.8  The Ada Source -
  5628.  
  5629.       PROCEDURE delete_line;
  5630.  
  5631. REQUIREMENTS                                                      Page 3-119
  5632. Deleting A Character                                               16 Nov 84
  5633.  
  5634.  
  5635.       3.2.9.6.6  Deleting A Character -
  5636.  
  5637.       3.2.9.6.6.1  Introduction - The  delete_character  procedure   deletes
  5638.       characters that the cursor is located on.
  5639.  
  5640.       3.2.9.6.6.2  The Object Name - deletecharacter
  5641.  
  5642.       3.2.9.6.6.3  Abstract - This  procedure  is  called  to   delete   the
  5643.       character  that  the cursor is sitting on.  The caracters to the right
  5644.       of the cursor are moved left to fill in the deleted  character  and  a
  5645.       blank  character  appears on the far right of the display screen.  The
  5646.       cursor is left at the position it was in before the procedure call (of
  5647.       course, containing new data).
  5648.  
  5649.       3.2.9.6.6.4  Parameters - None.
  5650.  
  5651.       3.2.9.6.6.5  Local Constants, Types, And Variables - tbd
  5652.  
  5653.       3.2.9.6.6.6  Errors - The  actual   terminal   may   not   have   been
  5654.       initialized prior to a call to this procedure.
  5655.  
  5656.       3.2.9.6.6.7  Exceptions - If the actual terminal  has  not  previously
  5657.       been initialized then the exception driver.unitialized is raised.
  5658.  
  5659.       3.2.9.6.6.8  The Ada Source -
  5660.  
  5661.       PROCEDURE delete_character;
  5662.  
  5663. REQUIREMENTS                                                      Page 3-120
  5664. Procedure Beep                                                     16 Nov 84
  5665.  
  5666.  
  5667.       3.2.9.6.7  Procedure Beep -
  5668.  
  5669.       3.2.9.6.7.1  Introduction - The  procedure  beep  rings  the  terminal
  5670.       bell.
  5671.  
  5672.       3.2.9.6.7.2  The Object Name - beep
  5673.  
  5674.       3.2.9.6.7.3  Abstract - This procedure is  called  to  get  the  users
  5675.       attention.  It does this by sending the sequence representing the bell
  5676.       obtained from the terminal capabilties file.
  5677.  
  5678.       3.2.9.6.7.4  Parameters - none
  5679.  
  5680.       3.2.9.6.7.5  Local Constants, Types, And Variables - tbd
  5681.  
  5682.       3.2.9.6.7.6  Errors - The  actual   terminal   may   not   have   been
  5683.       initialized prior to a call to this procedure.
  5684.  
  5685.       3.2.9.6.7.7  Exceptions - If the actual terminal  has  not  previously
  5686.       been initialized then the exception driver.unitialized is raised.
  5687.  
  5688.       3.2.9.6.7.8  The Ada Source -
  5689.  
  5690.       PROCEDURE beep;
  5691.  
  5692. REQUIREMENTS                                                      Page 3-121
  5693. Writing Data To The Actual Terminal                                16 Nov 84
  5694.  
  5695.  
  5696.       3.2.9.6.8  Writing Data To The Actual Terminal -
  5697.  
  5698.       3.2.9.6.8.1  Introduction - The    procedure    write_string    places
  5699.       character  strings  on  the  terminal  screen  at  the  current cursor
  5700.       position.
  5701.  
  5702.       3.2.9.6.8.2  The Object Name - write_string
  5703.  
  5704.       3.2.9.6.8.3  Abstract - The procedure write_string is called to  place
  5705.       character  strings on the display at the current cursor position.  The
  5706.       cursor is left at the position where the data ended  on  the  display.
  5707.       If the string length extends such that data is written past the end of
  5708.       a line then unpredictable results will occur.
  5709.  
  5710.       3.2.9.6.8.3.1  Parameters -
  5711.  
  5712.        *  data - An input parameter of type string.
  5713.  
  5714.  
  5715.       3.2.9.6.8.4  Local Constants, Types, And Variables - tbd
  5716.  
  5717.       3.2.9.6.8.5  Errors - The  actual   terminal   may   not   have   been
  5718.       initialized prior to a call to this procedure.
  5719.  
  5720.       3.2.9.6.8.6  Exceptions - If the actual terminal  has  not  previously
  5721.       been initialized then the exception driver.unitialized is raised.
  5722.  
  5723.       3.2.9.6.8.7  The Ada Source -
  5724.  
  5725.       PROCEDURE write_string( data  : IN string );
  5726.  
  5727. REQUIREMENTS                                                      Page 3-122
  5728. Moving The Cursor To A New Line                                    16 Nov 84
  5729.  
  5730.  
  5731.       3.2.9.6.9  Moving The Cursor To A New Line -
  5732.  
  5733.       3.2.9.6.9.1  Introduction - The new_line procedure  moves  the  cursor
  5734.       from its current position to the beginning of the next line.
  5735.  
  5736.       3.2.9.6.9.2  The Object Name - new_line
  5737.  
  5738.       3.2.9.6.9.3  Abstract - This procedure causes the cursor  to  go  from
  5739.       its current position to the beginning of the next line.  If the cursor
  5740.       was located at the  bottom  line  of  the  screen  then  unpredictable
  5741.       results will occur.
  5742.  
  5743.       3.2.9.6.9.4  Parameters - none
  5744.  
  5745.       3.2.9.6.9.5  Local Constants, Types, And Variables - tbd
  5746.  
  5747.       3.2.9.6.9.6  Errors - The  actual   terminal   may   not   have   been
  5748.       initialized prior to a call to this procedure.
  5749.  
  5750.       3.2.9.6.9.7  Exceptions - If the actual terminal  has  not  previously
  5751.       been initialized then the exception driver.unitialized is raised.
  5752.  
  5753.       3.2.9.6.9.8  The Ada Source -
  5754.  
  5755.       PROCEDURE new_line;
  5756.  
  5757. REQUIREMENTS                                                      Page 3-123
  5758. Turning On Highlighting                                            16 Nov 84
  5759.  
  5760.  
  5761.       3.2.9.6.10  Turning On Highlighting -
  5762.  
  5763.       3.2.9.6.10.1  Introduction - The turn_on_highlighting  procedure  puts
  5764.       the terminal in highlight mode.
  5765.  
  5766.       3.2.9.6.10.2  The Object Name - turn_on_highlighting
  5767.  
  5768.       3.2.9.6.10.3  Abstract - This  procedure  is  called  to   start   the
  5769.       highlighting  mode.   All characters written to the display after this
  5770.       are highlighted.  The cursor is not moved  and  its  position  is  not
  5771.       highlighted.
  5772.  
  5773.       3.2.9.6.10.4  Parameters - none
  5774.  
  5775.       3.2.9.6.10.5  Local Constants, Types, And Variables - tbd
  5776.  
  5777.       3.2.9.6.10.6  Errors - The  actual  terminal   may   not   have   been
  5778.       initialized prior to a call to this procedure.
  5779.  
  5780.       3.2.9.6.10.7  Exceptions - If the actual terminal has  not  previously
  5781.       been initialized then the exception driver.unitialized is raised.
  5782.  
  5783.       3.2.9.6.10.8  The Ada Source -
  5784.  
  5785.       PROCEDURE turn_on_highlighting;
  5786.  
  5787. REQUIREMENTS                                                      Page 3-124
  5788. Turning Off Highlighting                                           16 Nov 84
  5789.  
  5790.  
  5791.       3.2.9.6.11  Turning Off Highlighting -
  5792.  
  5793.       3.2.9.6.11.1  Introduction - The turn_off_highlighting procedure turns
  5794.       off the terminal's highlighting mode.
  5795.  
  5796.       3.2.9.6.11.2  The Object Name - turn_off_highlighting
  5797.  
  5798.       3.2.9.6.11.3  Abstract - This  procedure  is   called   to   end   the
  5799.       highlighting of characters.                 All  characters written to
  5800.       the display screen after this call are not highlighted.  The cursor is
  5801.       not  moved.   If  this  procedure  is  called  and highlighting is not
  5802.       enabled, unpredictable results occur.
  5803.  
  5804.       3.2.9.6.11.4  Parameters - none
  5805.  
  5806.       3.2.9.6.11.5  Local Constants, Types, And Variables - tbd
  5807.  
  5808.       3.2.9.6.11.6  Errors - The  actual  terminal   may   not   have   been
  5809.       initialized prior to a call to this procedure.
  5810.  
  5811.       3.2.9.6.11.7  Exceptions - If the actual terminal has  not  previously
  5812.       been initialized then the exception driver.unitialized is raised.
  5813.  
  5814.       3.2.9.6.11.8  The Ada Source -
  5815.  
  5816.       PROCEDURE turn_off_highlighting;
  5817.  
  5818. REQUIREMENTS                                                      Page 3-125
  5819. Entering Character Insert Mode                                     16 Nov 84
  5820.  
  5821.  
  5822.       3.2.9.6.12  Entering Character Insert Mode -
  5823.  
  5824.       3.2.9.6.12.1  Introduction - The  enter_insert_mode  procedure  begins
  5825.       character insertion mode.
  5826.  
  5827.       3.2.9.6.12.2  The Object Name - enter_insert_mode
  5828.  
  5829.       3.2.9.6.12.3  Abstract     - This  procedure  is   called   to   begin
  5830.       character insert mode.  In this mode, as characters are written to the
  5831.       display screen, all characters to the right of the cursor are moved to
  5832.       the  right.  The characters at the far right of the display screen are
  5833.       moved off the display screen and lost (wrapping does NOT occur).   The
  5834.       cursor is not moved.
  5835.  
  5836.       3.2.9.6.12.4  Parameters - none
  5837.  
  5838.       3.2.9.6.12.5  Local Constants, Types, And Variables - tbd
  5839.  
  5840.       3.2.9.6.12.6  Errors - The  actual  terminal   may   not   have   been
  5841.       initialized prior to a call to this procedure.
  5842.  
  5843.       3.2.9.6.12.7  Exceptions - If the actual terminal has  not  previously
  5844.       been initialized then the exception driver.unitialized is raised.
  5845.  
  5846.       3.2.9.6.12.8  The Ada Source -
  5847.  
  5848.       PROCEDURE enter_insert_mode;
  5849.  
  5850. REQUIREMENTS                                                      Page 3-126
  5851. Exiting Character Insert Mode                                      16 Nov 84
  5852.  
  5853.  
  5854.       3.2.9.6.13  Exiting Character Insert Mode -
  5855.  
  5856.       3.2.9.6.13.1  Introduction - The exit_insert_mode procedure exits  the
  5857.       character insertion mode.
  5858.  
  5859.       3.2.9.6.13.2  The Object Name - exit_insert_mode
  5860.  
  5861.       3.2.9.6.13.3  Abstract - This  procedure  is  called   to   exit   the
  5862.       character  insert  mode.   If  this  procedure is called and character
  5863.       insert  mode  is  not  enabled  (  the   procedure   enter_insert_mode
  5864.       previously  called),  unpredictable  results occur.  The cursor is not
  5865.       moved.
  5866.  
  5867.       3.2.9.6.13.4  Parameters - none
  5868.  
  5869.       3.2.9.6.13.5  Local Constants, Types, And Variables - tbd
  5870.  
  5871.       3.2.9.6.13.6  Errors - The  actual  terminal   may   not   have   been
  5872.       initialized prior to a call to this procedure.
  5873.  
  5874.       3.2.9.6.13.7  Exceptions - If the actual terminal has  not  previously
  5875.       been initialized then the exception driver.unitialized is raised.
  5876.  
  5877.       3.2.9.6.13.8  The Ada Source -
  5878.  
  5879.       PROCEDURE exit_insert_mode;
  5880.  
  5881. REQUIREMENTS                                                      Page 3-127
  5882. Scrolling The Actual Display Up                                    16 Nov 84
  5883.  
  5884.  
  5885.       3.2.9.6.14  Scrolling The Actual Display Up -
  5886.  
  5887.       3.2.9.6.14.1  Introduction - The  scroll_up   procedure   causes   the
  5888.       terminal screen to scroll up on line.
  5889.  
  5890.       3.2.9.6.14.2  The Object Name - scroll_up
  5891.  
  5892.       3.2.9.6.14.3  Abstract - This procedure is called to cause the display
  5893.       screen  to  scroll  up  one  line.  The line at the top of the display
  5894.       screen is lost.  The cursor follows the scroll operation  (remains  on
  5895.       the character it was positioned on).
  5896.  
  5897.       3.2.9.6.14.4  Parameters - none
  5898.  
  5899.       3.2.9.6.14.5  Local Constants, Types, And Variables - tbd
  5900.  
  5901.       3.2.9.6.14.6  Errors - The  actual  terminal   may   not   have   been
  5902.       initialized prior to a call to this procedure.
  5903.  
  5904.       3.2.9.6.14.7  Exceptions - If the actual terminal has  not  previously
  5905.       been initialized then the exception driver.unitialized is raised.
  5906.  
  5907.       3.2.9.6.14.8  The Ada Source -
  5908.  
  5909.       PROCEDURE scroll_up;
  5910.  
  5911. REQUIREMENTS                                                      Page 3-128
  5912. Scrolling The Actual Display Down                                  16 Nov 84
  5913.  
  5914.  
  5915.       3.2.9.6.15  Scrolling The Actual Display Down -
  5916.  
  5917.       3.2.9.6.15.1  Introduction - The  scroll_down  procedure  causes   the
  5918.       display screen to scroll down one line.
  5919.  
  5920.       3.2.9.6.15.2  The Object Name - scroll_down
  5921.  
  5922.       3.2.9.6.15.3  Abstract - This procedure is called to cause the display
  5923.       screen to scroll down one line.  The line at the bottom of the display
  5924.       screen is lost.  The cursor follows the scroll operation  (remains  on
  5925.       the character it was positioned on).
  5926.  
  5927.       3.2.9.6.15.4  Parameters - none
  5928.  
  5929.       3.2.9.6.15.5  Local Constants, Types, And Variables - tbd
  5930.  
  5931.       3.2.9.6.15.6  Errors - The  actual  terminal   may   not   have   been
  5932.       initialized prior to a call to this procedure.
  5933.  
  5934.       3.2.9.6.15.7  Exceptions - If the actual terminal has  not  previously
  5935.       been initialized then the exception driver.unitialized is raised.
  5936.  
  5937.       3.2.9.6.15.8  The Ada Source -
  5938.  
  5939.       PROCEDURE scroll_down;
  5940.  
  5941.  
  5942.       3.2.9.7  Errors - See the individual sections.
  5943.  
  5944.       3.2.9.8  Exceptions - See the individual sections.
  5945.  
  5946.       3.2.9.9  The Ada Source -
  5947.  
  5948.       PACKAGE BODY driver IS
  5949.  
  5950.         PROCEDURE virtual_terminal_initialize(
  5951.                       name  : IN string;
  5952.                       lines : OUT positive;
  5953.                     columns : OUT Positive ) IS
  5954.           NULL;
  5955.         END virtual_terminal_initialize;
  5956.  
  5957.         PROCEDURE close_virtual_terminal IS
  5958.           NULL;
  5959.         END close_virtual_terminal;
  5960.  
  5961.         PROCEDURE interpret ( IN commandstring :  string ) IS
  5962.  
  5963.           PROCEDURE erase_to_end_of_screen;
  5964.  
  5965.           PROCEDURE erase_to_end_of_line;
  5966.  
  5967.           PROCEDURE move_the_cursor_to( 
  5968.                       p_x  : IN postiive;
  5969. REQUIREMENTS                                                      Page 3-129
  5970. The Ada Source                                                     16 Nov 84
  5971.  
  5972.  
  5973.                       p_y  : IN positive );
  5974.  
  5975.  
  5976.           PROCEDURE insert_line;
  5977.  
  5978.           PROCEDURE delete_line;
  5979.  
  5980.           PROCEDURE deletecharacter;
  5981.  
  5982.           PROCEDURE beep;
  5983.  
  5984.           PROCEDURE write_string( data  : IN string );
  5985.  
  5986.           PROCEDURE new_line;
  5987.  
  5988.           PROCEDURE turn_on_highlighting;
  5989.  
  5990.           PROCEDURE turn_off_highlighting;
  5991.  
  5992.           PROCEDURE enter_insert_mode;
  5993.  
  5994.           PROCEDURE exit_insert_mode;
  5995.  
  5996.           PROCEDURE scroll_up;
  5997.  
  5998.           PROCEDURE scroll_down;
  5999.  
  6000.         END interpret;
  6001.  
  6002.       END driver;
  6003.  
  6004. REQUIREMENTS                                                      Page 3-130
  6005. The TCF Package                                                    16 Nov 84
  6006.  
  6007.  
  6008.       3.2.10  The TCF Package
  6009.  
  6010.       3.2.10.1  Introduction - This package defines  the  specification  for
  6011.       the terminal capabilities file.
  6012.  
  6013.       3.2.10.2  Abstract - This package incorporates a variation of the UNIX
  6014.       terminal  capabilities  data base which is used to define the mapping.
  6015.       The  TCF  Package  defines  one  procedure  called  initialize.   This
  6016.       initialize  procedure  opens the TCF data base file, fills in the data
  6017.       structures and then  closes  the  TCF  data  base  file.   The  'name'
  6018.       parameter  passed  in holds the terminal name.  This parameter is used
  6019.       to search the tcf file for  the  terminal  characteristics  associated
  6020.       with  the  terminal name.  These characteristics are then put into the
  6021.       termcap_operations variable.  The variable termcap_operations is  used
  6022.       by both the driver package and the vt_input package.
  6023.  
  6024.       3.2.10.3  Parameters - none
  6025.  
  6026.       3.2.10.4  Local Constants, Types, And Variables -
  6027.  
  6028.        *  max_term_cap_entry - the maximum number of entries in the terminal
  6029.           capabilities file.  The maximum length is 1920.
  6030.  
  6031.        *  max_string_data - a constant defining the maximum length of a data
  6032.           string.  The maximum length is 100.
  6033.  
  6034.        *  string_data_array - a string of data with a range of 1 to 100.
  6035.  
  6036.        *  termcap_operation_record - a  record  containing  a  string,  it's
  6037.           length,  and  any parameters (if required) describing a particular
  6038.           terminal operation.  This is the terminal specific  data  that  an
  6039.           ANSI  operation is translated into.  This data structure is filled
  6040.           by  the  procedure  tcf.initialize  from  data  contained  in  the
  6041.           terminal capabilities file.
  6042.  
  6043.        *  termcap_entry_array - a subtype of a string with a range of  1  to
  6044.           the max_termcap_entry.
  6045.  
  6046.        *  termcap_entries_enum  -  an  enumeration  of  terminal  capability
  6047.           entries.   These  match  the  entries in the terminal capabilities
  6048.           file.
  6049.  
  6050.        *  termcap_operation_array - an array  of  termcap_operation_records.
  6051.           The  array contains all the entries for the terminal of given name
  6052.           from the terminal capabilities file.  This array is indexed by the
  6053.           termcap_entries_enum.
  6054.  
  6055.        *  termcap_operations - A variable of  type  termcapoperations  array
  6056.           that   identify   the  operations  associated  with  a  particular
  6057.           terminal.
  6058.  
  6059. REQUIREMENTS                                                      Page 3-131
  6060. Selectors (Functions)                                              16 Nov 84
  6061.  
  6062.  
  6063.       3.2.10.5  Selectors (Functions) - none
  6064.  
  6065.       3.2.10.6  Actors  (Procedures) - The  following  pages  describe   the
  6066.       specifications for the procedures of the TCF package.
  6067. REQUIREMENTS                                                      Page 3-132
  6068. Initialize The Terminal Capabilities File                          16 Nov 84
  6069.  
  6070.  
  6071.       3.2.10.6.1  Initialize The Terminal Capabilities File -
  6072.  
  6073.       3.2.10.6.1.1  Introduction - The   initialize    procedure    performs
  6074.       intialization on the terminal capabilities file.
  6075.  
  6076.       3.2.10.6.1.2  The Object Name - initialize
  6077.  
  6078.       3.2.10.6.1.3  Abstract - Initialize opens  the  terminal  capabilities
  6079.       file,   searches   this  file  for  capabilties  associated  with  the
  6080.       particular  terminal,  and  associates   the   capabilities   to   the
  6081.       termcap_operations array.  If the input parameter 'name' is empty then
  6082.       the SYSDEP package is invoked.
  6083.  
  6084.       3.2.10.6.1.4  Parameters -
  6085.  
  6086.        *  name - the name of the terminal passed in from one of the terminal
  6087.           packages (scroll, form, page).
  6088.  
  6089.  
  6090.       3.2.10.6.1.5  Local Constants, Types, And Variables - tbd
  6091.  
  6092.       3.2.10.6.1.6  Errors - It may not be possible  to  open  the  terminal
  6093.       capabilities  file.   The  named  terminal  may  not  be  found in the
  6094.       terminal capabilities file.
  6095.  
  6096.       3.2.10.6.1.7  Exceptions - The exception tcf_error can be raised  from
  6097.       this  procedure.   The  exception  name_error  can be raised from this
  6098.       procedure.
  6099.  
  6100.       3.2.10.6.1.8  The Ada Source -
  6101.  
  6102.       PROCEDURE initialize ( name : IN string );
  6103.               
  6104. REQUIREMENTS                                                      Page 3-133
  6105. Errors                                                             16 Nov 84
  6106.  
  6107.  
  6108.       3.2.10.7  Errors - See the individual sections.
  6109.  
  6110.       3.2.10.8  Exceptions - See the individual sections.
  6111.  
  6112.       3.2.10.9  The Ada Source -
  6113.  
  6114.       PACKAGE tcf IS
  6115.  
  6116.       --  Constants
  6117.  
  6118.                 max_termcap_entry : CONSTANT integer := 1920;
  6119.                 max_string_data   : CONSTANT integer := 100;
  6120.               
  6121.       --  Types
  6122.  
  6123.                 SUBTYPE string_data_array IS string( 1..max_string_data );
  6124.  
  6125.  
  6126.               TYPE termcap_operation_record is
  6127.               RECORD
  6128.                     encoded_data         : string;
  6129.                     encoded_data_length  : integer;
  6130.                     parameter            : integer;
  6131.                     bool_parameter       : boolean;
  6132.               END record;
  6133.  
  6134.               SUBTYPE termcap_entry_array IS string( 1..max_termcap_entry );
  6135.        
  6136.               TYPE termcap_entries_enum IS
  6137.                                ( cd,  -- clear to end of display
  6138.                                  ce,  -- clear to end of line 
  6139.                                  cm,  -- cursor movement      
  6140.                                  i_s, -- initialization string
  6141.                                  al,  -- insert line          
  6142.                                  dl,  -- delete line          
  6143.                                  dc,  -- delete character     
  6144.                                  be,  -- bell                 
  6145.                                  nl,  -- new line             
  6146.                                  so,  -- start standout mode  
  6147.                                  se,  -- end standout mode    
  6148.                                  im,  -- enter insert mode    
  6149.                                  ei,  -- end insert mode      
  6150.                                  sf,  -- scroll up            
  6151.                                  sr,  -- scroll down          
  6152.                                  ku,  -- cursor up key        
  6153.                                  kd,  -- cursor down key      
  6154.                                  kl,  -- cursor left key      
  6155.                                  kr,  -- cursor right key     
  6156.                                  l1,  -- function key 1 label 
  6157.                                  l2,  -- function key 2 label 
  6158.                                  l3,  -- function key 3 label 
  6159.                                  l4,  -- function key 4 label 
  6160.                                  l5,  -- function key 5 label 
  6161.                                  l6,  -- function key 6 label 
  6162. REQUIREMENTS                                                      Page 3-134
  6163. The Ada Source                                                     16 Nov 84
  6164.  
  6165.  
  6166.                                  l7,  -- function key 7 label 
  6167.                                  l8,  -- function key 8 label 
  6168.                                  l9,  -- function key 9 label 
  6169.                                  y0,  -- function key 10 label
  6170.                                  y1,  -- function key 11 label
  6171.                                  y2,  -- function key 12 label
  6172.                                  y3,  -- function key 13 label
  6173.                                  y4,  -- function key 14 label
  6174.                                  y5,  -- function key 15 label
  6175.                                  y6,  -- function key 16 label
  6176.                                  y7,  -- function key 17 label       
  6177.                                  y8,  -- function key 18 label       
  6178.                                  y9,  -- function key 19 label       
  6179.                                  h0,  -- function key 20 label       
  6180.                                  h1,  -- function key 21 label    
  6181.                                  h2,  -- function key 22 label
  6182.                                  h3,  -- function key 23 label       
  6183.                                  h4,  -- function key 24 label
  6184.                                  h5,  -- function key 25 label 
  6185.                                  h6,  -- function key 26 label
  6186.                                  h7,  -- function key 27 label
  6187.                                  h8,  -- function key 28 label
  6188.                                  h9,  -- function key 29 label 
  6189.                                  v0,  -- function key 30 label
  6190.                                  v1,  -- function key 31 label
  6191.                                  v2,  -- function key 32 label
  6192.                                  k1,  -- function 1 key       
  6193.                                  k2,  -- function 2 key       
  6194.                                  k3,  -- function 3 key       
  6195.                                  k4,  -- function 4 key       
  6196.                                  k5,  -- function 5 key       
  6197.                                  k6,  -- function 6 key       
  6198.                                  k7,  -- function 7 key       
  6199.                                  k8,  -- function 8 key       
  6200.                                  k9,  -- function 9 key       
  6201.                                  x0,  -- function 10 key      
  6202.                                  x1,  -- function 11 key      
  6203.                                  x2,  -- function 12 key      
  6204.                                  x3,  -- function 13 key      
  6205.                                  x4,  -- function 14 key      
  6206.                                  x5,  -- function 15 key      
  6207.                                  x6,  -- function 16 key      
  6208.                                  x7,  -- function 17 key      
  6209.                                  x8,  -- function 18 key      
  6210.                                  x9,  -- function 19 key      
  6211.                                  g0,  -- function 20 key             
  6212.                                  g1,  -- function 21 key      
  6213.                                  g2,  -- function 22 key      
  6214.                                  g3,  -- function 23 key      
  6215.                                  g4,  -- function 24 key      
  6216.                                  g5,  -- function 25 key      
  6217.                                  g6,  -- function 26 key      
  6218.                                  g7,  -- function 27 key      
  6219.                                  g8,  -- function 28 key      
  6220. REQUIREMENTS                                                      Page 3-135
  6221. The Ada Source                                                     16 Nov 84
  6222.  
  6223.  
  6224.                                  g9,  -- function 29 key      
  6225.                                  t0,  -- function 30 key      
  6226.                                  t1,  -- function 31 key      
  6227.                                  t2,  -- function 32 key      
  6228.                                  wr,  -- wraps at end of line 
  6229.                                  su,  -- scrolls up at bottom 
  6230.                                  li,  -- number of lines      
  6231.                                  co   -- number of columns    
  6232.                                     );
  6233.  
  6234.  
  6235.  
  6236.                TYPE termcap_operation_array is
  6237.                     array(termcap_entries_enum) of termcap_operation_record;
  6238.  
  6239.       -- Variables
  6240.  
  6241.               termcap_operations       : termcap_operation_array;
  6242.  
  6243.       -- Procedures
  6244.  
  6245.               PROCEDURE initialize ( name : IN string);
  6246.  
  6247.       -- Exceptions
  6248.  
  6249.               tcf_error   : EXCEPTION;
  6250.               name_error  : EXCEPTION;
  6251.  
  6252.       END tcf;
  6253.  
  6254. REQUIREMENTS                                                      Page 3-136
  6255. The System Dependent Package SYSDEP                                16 Nov 84
  6256.  
  6257.  
  6258.       3.2.11  The System Dependent Package SYSDEP
  6259.  
  6260.       3.2.11.1  Introduction - This   package   centralizes    all    system
  6261.       dependencies in the virtual terminal.
  6262.  
  6263.       3.2.11.2  The Object Name - sysdep
  6264.  
  6265.       3.2.11.3  Abstract - When rehosting the  VT  to  another  environment,
  6266.       only  this package should need to be changed.  The supported functions
  6267.       are:
  6268.  
  6269.        *  open the physical terminal,
  6270.  
  6271.        *  close the physical terminal,
  6272.  
  6273.        *  put strings to the physical terminal,
  6274.  
  6275.        *  get strings from the physical terminal,
  6276.  
  6277.        *  get the terminal capabilities file (TCF) name,
  6278.  
  6279.        *  get the terminal's name (to be subsequently looked up in the TCF),
  6280.  
  6281.        *  check the validity of a particular character.
  6282.  
  6283. REQUIREMENTS                                                      Page 3-137
  6284. Selectors (Functions)                                              16 Nov 84
  6285.  
  6286.  
  6287.       3.2.11.4  Selectors (Functions) -
  6288.  
  6289.       3.2.11.4.1  Determining The Validity Of A Character -
  6290.  
  6291.       3.2.11.4.1.1  Introduction - This procedure  is  called  to  determine
  6292.       whether  a  particular  character  can  be  considered  valid for this
  6293.       environment.
  6294.  
  6295.       3.2.11.4.1.2  The Object Name - valid_character
  6296.  
  6297.       3.2.11.4.1.3  Abstract - Sysdep.valid_character is called to check  if
  6298.       the character specified in the input parameter is one that can be used
  6299.       (and therefore considered valid) for this environment.  Character that
  6300.       should be considered suspect include:
  6301.  
  6302.        *  XON (CTRL-S)
  6303.  
  6304.        *  XOFF (CTRL-Q)
  6305.  
  6306.        *  (CTRL-Y)
  6307.  
  6308.        *  (CTRL-C)
  6309.  
  6310.  
  6311.       3.2.11.4.1.4  Parameters - There is one input parameter,  item,  which
  6312.       identifies  the  character  of interest.  A boolean value is returned.
  6313.       True indicates that the character is valid  and  can  be  used,  false
  6314.       indicates that the charater should not be used.
  6315.  
  6316.       3.2.11.4.1.5  Local Constants, Types, And Variables - TBD.
  6317.  
  6318.       3.2.11.4.1.6  Errors - The physical terminal may not have been  opened
  6319.       prior to calling this procedure.
  6320.  
  6321.       3.2.11.4.1.7  Exceptions - If  the  physical  terminal  has  not  been
  6322.       opened  previously  to  this  then the exception uninitialized will be
  6323.       raised.
  6324.  
  6325.       3.2.11.4.1.8  The Ada Source -
  6326.  
  6327.       FUNCTION valid_character( item : IN character ) RETURN boolean;
  6328.  
  6329. REQUIREMENTS                                                      Page 3-138
  6330. Actors (Procedures)                                                16 Nov 84
  6331.  
  6332.  
  6333.       3.2.11.5  Actors (Procedures) -
  6334.  
  6335.       3.2.11.5.1  Opening The Physical Terminal -
  6336.  
  6337.       3.2.11.5.1.1  Introduction - This procedure  is  called  to  open  the
  6338.       physical terminal.
  6339.  
  6340.       3.2.11.5.1.2  The Object Name - Open
  6341.  
  6342.       3.2.11.5.1.3  Abstract - Sysdep.open makes the physical terminal ready
  6343.       for receiving characters.  The terminal connection should be such that
  6344.       keys that are pressed on the terminal  keyboard  must  not  be  echoed
  6345.       automatically by the OS.
  6346.  
  6347.       As a general rule the terminal should  be  configured  to  accept  all
  6348.       character sent to it.  Similarly, all characters typed at the terminal
  6349.       keyboard should be returned when sysdep.get is called.   This  can  be
  6350.       compromised  somewhat  to  support  flow control or other OS dependent
  6351.       operations.
  6352.  
  6353.       Any characters that are to be used for other  purposes  and  thus  not
  6354.       available   to   the   VT   should   be   noted   and   the   function
  6355.       sysdep.valid_character made to reflect this.
  6356.  
  6357.       3.2.11.5.1.4  Parameters - None.
  6358.  
  6359.       3.2.11.5.1.5  Local Constants, Types, And Variables - TBD.
  6360.  
  6361.       3.2.11.5.1.6  Errors - None.
  6362.  
  6363.       3.2.11.5.1.7  Exceptions - It is assumed that the OS will generate  an
  6364.       exception if the terminal could not be opened.  This exception will be
  6365.       propogated out of this package.
  6366.  
  6367.       3.2.11.5.1.8  The Ada Source -
  6368.  
  6369.       PROCEDURE open;
  6370.  
  6371. REQUIREMENTS                                                      Page 3-139
  6372. Closing The Physical Terminal                                      16 Nov 84
  6373.  
  6374.  
  6375.       3.2.11.5.2  Closing The Physical Terminal -
  6376.  
  6377.       3.2.11.5.2.1  Introduction - This procedure is  called  to  close  the
  6378.       physical terminal.
  6379.  
  6380.       3.2.11.5.2.2  The Object Name -
  6381.  
  6382.       3.2.11.5.2.3  Abstract - Sysdep.close performs a close on the physical
  6383.       terminal.  The actual actions performed are system dependent.
  6384.  
  6385.       3.2.11.5.2.4  Parameters - None.
  6386.  
  6387.       3.2.11.5.2.5  Local Constants, Types, And Variables - TBD.
  6388.  
  6389.       3.2.11.5.2.6  Errors - None.
  6390.  
  6391.       3.2.11.5.2.7  Exceptions - It is assumed that the OS will generate  an
  6392.       exception if the terminal could not be opened.  This exception will be
  6393.       propogated out of this package.
  6394.  
  6395.       3.2.11.5.2.8  The Ada Source -
  6396.  
  6397.       PROCEDURE close;
  6398.  
  6399. REQUIREMENTS                                                      Page 3-140
  6400. Writing Data To The Physical Terminal                              16 Nov 84
  6401.  
  6402.  
  6403.       3.2.11.5.3  Writing Data To The Physical Terminal -
  6404.  
  6405.       3.2.11.5.3.1  Introduction -
  6406.  
  6407.       3.2.11.5.3.2  The Object Name - put
  6408.  
  6409.       3.2.11.5.3.3  Abstract - Sysdep.put is called to  write  data  to  the
  6410.       physical  terminal's  display  screen.   This  data  (ideally)  is not
  6411.       interpreted or changed by the OS.  This can be compromised to  support
  6412.       flow   control  or  other  system  dependent  operations.   If  it  is
  6413.       compromised, those special characters must be marked as not valid in a
  6414.       call to sysdep.valid_character.
  6415.  
  6416.       3.2.11.5.3.4  Parameters - There are two input parameters.
  6417.  
  6418.        *  data - the string buffer that the output characters are passed  in
  6419.           through.
  6420.  
  6421.        *  last - the last  position  in  the  string  buffer  that  contains
  6422.           meaningful data.
  6423.  
  6424.  
  6425.       3.2.11.5.3.5  Local Constants, Types, And Variables - TBD.
  6426.  
  6427.       3.2.11.5.3.6  Errors - None.
  6428.  
  6429.       3.2.11.5.3.7  Exceptions - It is assumed that the OS will generate  an
  6430.       exception if the terminal could not be opened.  This exception will be
  6431.       propogated out of this package.
  6432.  
  6433.       3.2.11.5.3.8  The Ada Source -
  6434.  
  6435.       PROCEDURE put( data : IN string;
  6436.                      last : IN natural );
  6437.  
  6438. REQUIREMENTS                                                      Page 3-141
  6439. Reading Data From The Terminal Keyboard                            16 Nov 84
  6440.  
  6441.  
  6442.       3.2.11.5.4  Reading Data From The Terminal Keyboard -
  6443.  
  6444.       3.2.11.5.4.1  Introduction - This procedure is  called  to  read  data
  6445.       from the physical terminal's keyboard.
  6446.  
  6447.       3.2.11.5.4.2  The Object Name - get
  6448.  
  6449.       3.2.11.5.4.3  Abstract - Sysdep.get is called to  retrieve  data  from
  6450.       the   physical  terminal's  keyboard.   This  data  (ideally)  is  not
  6451.       interpreted or changed by the OS.  This can be compromised to  support
  6452.       flow   control  or  other  system  dependent  operations.   If  it  is
  6453.       compromised, those special characters must be marked as not valid in a
  6454.       call to sysdep.valid_character.
  6455.  
  6456.       3.2.11.5.4.4  Parameters - There are two output parameters.
  6457.  
  6458.        *  data - the string buffer that  the  input  characters  are  to  be
  6459.           returned in.
  6460.  
  6461.        *  last - the last  position  in  the  string  buffer  that  contains
  6462.           meaningful data to be returned from this procedure call.
  6463.  
  6464.  
  6465.       3.2.11.5.4.5  Local Constants, Types, And Variables - TBD.
  6466.  
  6467.       3.2.11.5.4.6  Errors - None.
  6468.  
  6469.       3.2.11.5.4.7  Exceptions - It is assumed that the OS will generate  an
  6470.       exception if the terminal could not be opened.  This exception will be
  6471.       propogated out of this package.
  6472.  
  6473.       3.2.11.5.4.8  The Ada Source -
  6474.  
  6475.       PROCEDURE get( data : OUT string;
  6476.                      last : OUT natural );
  6477.  
  6478. REQUIREMENTS                                                      Page 3-142
  6479. Retrieving The TCF Name                                            16 Nov 84
  6480.  
  6481.  
  6482.       3.2.11.5.5  Retrieving The TCF Name -
  6483.  
  6484.       3.2.11.5.5.1  Introduction - This procedure is called to retrieve  the
  6485.       the name of the terminal capabilities file.
  6486.  
  6487.       3.2.11.5.5.2  The Object Name - tcf_name
  6488.  
  6489.       3.2.11.5.5.3  Abstract - Sysdep.get_name is called to get the name  of
  6490.       the TCF.
  6491.  
  6492.       3.2.11.5.5.4  Parameters - There are two output parameters:
  6493.  
  6494.        *  name - the string buffer that the name of  the  TCF  will  be  put
  6495.           into,
  6496.  
  6497.        *  last - the last significant character in the string buffer.
  6498.  
  6499.  
  6500.       3.2.11.5.5.5  Local Constants, Types, And Variables - TBD.
  6501.  
  6502.       3.2.11.5.5.6  Errors - None.
  6503.  
  6504.       3.2.11.5.5.7  Exceptions - None.
  6505.  
  6506.       3.2.11.5.5.8  The Ada Source -
  6507.  
  6508.       PROCEDURE tcf_name ( name : OUT string;
  6509.                            last : OUT natural );
  6510.  
  6511. REQUIREMENTS                                                      Page 3-143
  6512. Retrieving The Terminal's Name                                     16 Nov 84
  6513.  
  6514.  
  6515.       3.2.11.5.6  Retrieving The Terminal's Name -
  6516.  
  6517.       3.2.11.5.6.1  Introduction - This procedure is called  to  return  the
  6518.       terminal's name.
  6519.  
  6520.       3.2.11.5.6.2  The Object Name - terminal_name
  6521.  
  6522.       3.2.11.5.6.3  Abstract - Sysdep.terminal_name returns the name of  the
  6523.       terminal.   The  exact  manner  that this name is determined is system
  6524.       dependent.  This name is the one used  to  match  the  TCF  entry  and
  6525.       retreive the capabilities in the TCF package.
  6526.  
  6527.       3.2.11.5.6.4  Parameters - There are two input parameters:
  6528.  
  6529.        *  name - a string buffer that will contain the name of the  terminal
  6530.           when the procedure returns,
  6531.  
  6532.        *  last - the last significant position in the string buffer.
  6533.  
  6534.  
  6535.       3.2.11.5.6.5  Local Constants, Types, And Variables - TBD.
  6536.  
  6537.       3.2.11.5.6.6  Errors - None.
  6538.  
  6539.       3.2.11.5.6.7  Exceptions - None.
  6540.  
  6541.       3.2.11.5.6.8  The Ada Source -
  6542.  
  6543.       PROCEDURE terminal_name ( name : OUT string;
  6544.                                 last : OUT natural );
  6545.  
  6546.  
  6547.       3.2.11.6  Errors - See the individual sections above.
  6548.  
  6549.       3.2.11.7  Exceptions - See the individual sections above.
  6550.  
  6551.       3.2.11.8  The Ada Source -
  6552.  
  6553.       PACKAGE sysdep IS
  6554.  
  6555.           PROCEDURE open;
  6556.           PROCEDURE close;
  6557.  
  6558.           PROCEDURE put( data : IN string;
  6559.                          last : IN natural );
  6560.  
  6561.           PROCEDURE get( data : OUT string;
  6562.                          last : OUT natural );
  6563.  
  6564.           PROCEDURE tcf_name ( name : OUT string;
  6565.                                last : OUT natural );
  6566.  
  6567.           PROCEDURE terminal_name ( name : OUT string;
  6568.                                     last : OUT natural );
  6569. REQUIREMENTS                                                      Page 3-144
  6570. The Ada Source                                                     16 Nov 84
  6571.  
  6572.  
  6573.  
  6574.           FUNCTION valid_character ( item : IN character ) 
  6575.                              RETURN boolean;
  6576.  
  6577.           uninitialized : EXCEPTION;
  6578.  
  6579.       END sysdep;
  6580.  
  6581.  
  6582. REQUIREMENTS                                                      Page 3-145
  6583. STORAGE AND PROCESSING ALLOCATION                                  16 Nov 84
  6584.  
  6585.  
  6586.       3.3  STORAGE AND PROCESSING ALLOCATION
  6587.  
  6588.       Not Applicable.
  6589.  
  6590.       3.4  PROGRAM FUNCTIONAL FLOW CONTROL
  6591.  
  6592.       3.4.1  General
  6593.  
  6594.       This  section  describes  the  data  flow  through  the  NOSC  virtual
  6595.       terminal.
  6596.  
  6597.       A physical terminal can be viewed as  three  seperate  and  individual
  6598.       devices.
  6599.  
  6600.        *  the keyboard,
  6601.  
  6602.        *  the display,
  6603.  
  6604.        *  the bell.
  6605.  
  6606.       These separate devices will be treated individually in  the  NOSC  VT.
  6607.       Data  can  flow  from  the  keyboard and to the display independently.
  6608.       Similarly the bell can be rang independently from the other data flow.
  6609.  
  6610.       There are two asynchronous data generators in the NOSC VT.  These  are
  6611.       the  keyboard  (actually  the  user  and their fingers) and the user's
  6612.       program.  The data that is generated and processed  is  ANSI  standard
  6613.       characters  and  character sequences.  These will conform to the ASCII
  6614.       standard.
  6615.  
  6616.       3.4.2  Keyboard Data
  6617.  
  6618.       The        packages        virtual_terminal.scroll_terminal        and
  6619.       virtual_terminal.page_terminal treat the keyboard similarly.  The form
  6620.       terminal treats the keyboard quite differently.  First,  a  discussion
  6621.       of  the  flow  of data from the keyboard to the user's program through
  6622.       the scroll_terminal and  page  terminal  is  given.   Assume  for  the
  6623.       following  examples  that the appropriate terminal has been previously
  6624.       opened.
  6625.  
  6626.       The sequence that must be followed for a  user's  program  to  receive
  6627.       keyboard data is as follows:
  6628.  
  6629.       1.  The  user  calls  either  virtual_terminal.scroll_terminal.get  or
  6630.           virtual_terminal.page_terminal.get.
  6631.  
  6632.       2.  The  body  of  this  procedure  makes   calls   to   the   package
  6633.           vt_input.get.
  6634.  
  6635.       3.  The body of this procedure makes calls to the  package  SYSDEP  to
  6636.           actually read the data from the keyboard.
  6637. REQUIREMENTS                                                      Page 3-146
  6638. Keyboard Data                                                      16 Nov 84
  6639.  
  6640.  
  6641.       4.  The data is  returned  from  SYSDEP  to  vt_input.get  which  then
  6642.           returns the data to either virtual_terminal.scroll_terminal.get or
  6643.           virtual_terminal.page_terminal.get which ever is appropriate.
  6644.  
  6645.  
  6646.       For a form terminal the following sequence ocurrs:
  6647.  
  6648.       1.  The user program creates a form  by  making  successive  calls  to
  6649.           virtual_terminal.form_terminal.define_qualified_area           and
  6650.           virtual_terminal.form_terminal.set_position  to  setup  the  areas
  6651.           that input will be allowed.
  6652.  
  6653.       2.  A call is made on virtual_terminal.form_terminal.activate_form  to
  6654.           place the virtual screen (which contains the form) onto the actual
  6655.           screen.
  6656.  
  6657.       3.  The procedure body of virtual_terminal.form_terminal.activate_form
  6658.           will read data from the keyboard to support the editting functions
  6659.           required of the form terminal by making calls on vt_input.get.
  6660.  
  6661.       4.  vt_input.get will make calls on SYSDEP to get the characters  from
  6662.           the keyboard.
  6663.  
  6664.       5.  SYSDEP returns the string from the keyboard  to  vt_input.get  who
  6665.           then  passes  the data back to the procedure body of activate_form
  6666.           which performs the local editting placing the data in the  virtual
  6667.           display.
  6668.  
  6669.       6.  When the user presses a function key control is returned from  the
  6670.           call on virtual_terminal.form_terminal.activate_form.
  6671.  
  6672.       7.  The user's program can then place the  active  position  and  read
  6673.           data    from    the    virtual    display    using   the   various
  6674.           virtual_terminal.form_terminal.get procedures.
  6675.  
  6676.  
  6677.       3.4.3  User Program Generated Data
  6678.  
  6679.       The data generated by the user program can be destined either for  the
  6680.       virtual  terminal's  internal  representation  of  the display, or the
  6681.       actual terminal's bell.   A  user's  program  will  never  write  data
  6682.       directly  to  the  actual  terminal's  display.   Rather,  the data is
  6683.       "buffered" in the virtual display until a call is made on any of:
  6684.  
  6685.       1.  redisplay.redisplay_screen_with_movement
  6686.  
  6687.       2.  redisplay.redisplay_screen_with_redraw
  6688.  
  6689.       3.  redisplay.redisplay_line_with_movement
  6690.  
  6691.       4.  redisplay.redisplay_line_with_redraw
  6692.  
  6693.       These procedures make  the  actual  calls  to  driver  to  change  the
  6694.       representation on the actual display.
  6695. REQUIREMENTS                                                      Page 3-147
  6696. User Program Generated Data                                        16 Nov 84
  6697.  
  6698.  
  6699.       In     the     packages      virtual_terminal.scroll_terminal      and
  6700.       virtual_terminal.page_terminal  the data flows from the user's program
  6701.       to the display in the following way:
  6702.  
  6703.       1.  The user's program makes calls to change the representaiton of the
  6704.           virtual  display.   These  calls  could  be  to  put data onto the
  6705.           virtual display, move the active position, or change  the  graphic
  6706.           rendition.
  6707.  
  6708.       2.  When the  user's  program  calls  one  of  the  procedures  within
  6709.           redisplay,  the  actual  display  will then be made to reflect the
  6710.           virtual  display.   The  pacakge  redisplay  will  make  calls  on
  6711.           driver.interpret to send data to the actual display.
  6712.  
  6713.       3.  driver.interpret will take the data (which is in the form of  ANSI
  6714.           compatible  character  sequences),  interpret it and make calls on
  6715.           SYSDEP to send  the  correct  sequences  to  the  actual  terminal
  6716.           display.
  6717.  
  6718.  
  6719.       In the package virtual_terminal.form_terminal the data flows from  the
  6720.       user's program to the display in the following way:
  6721.  
  6722.       1.  The user's program makes calls to change the representaiton of the
  6723.           virtual  display.   These  calls  could  be  to  put data onto the
  6724.           virtual display, move the active  position,  or  change  the  area
  6725.           intensity.
  6726.  
  6727.       2.  When the user's program calls form_terminal.activate_form, a  call
  6728.           is  made  from  within  the body of activate_form to the procedure
  6729.           redisplay.redisplay_screen_with_movement  to   make   the   actual
  6730.           display look like the virtual display.
  6731.  
  6732.       3.  The package redisplay will make calls on driver.interpret to  send
  6733.           data to the actual display.
  6734.  
  6735.       4.  driver.interpret will take the data (which is in the form of  ANSI
  6736.           compatible  character  sequences),  interpret it and make calls on
  6737.           SYSDEP to send  the  correct  sequences  to  the  actual  terminal
  6738.           display.
  6739.  
  6740.  
  6741.       When     the     user's     program     makes      a      call      on
  6742.       virtual_terminal.scroll_terminal.bell                               or
  6743.       virtual_terminal.page_terminal.bell a call is  made  from  within  the
  6744.       procedure  body  to driver.interpret passing the ANSI sequence to ring
  6745.       the bell.  Driver.interpret then makes a call to  SYSDEP  passing  the
  6746.       string  that  will ring the actual terminal's bell (the exact sequence
  6747.       is found in the terminal capabilities file).
  6748. REQUIREMENTS                                                      Page 3-148
  6749. Program Interrupt Control                                          16 Nov 84
  6750.  
  6751.  
  6752.       3.4.4  Program Interrupt Control
  6753.  
  6754.       Not applicable.
  6755.  
  6756.       3.4.5  Subprogram Reference Control
  6757.  
  6758.       3.4.6  Special Control Features
  6759.  
  6760.       Not applicable.
  6761. REQUIREMENTS                                                      Page 3-149
  6762. PROGRAMMING GUIDELINES                                             16 Nov 84
  6763.  
  6764.  
  6765.       3.5  PROGRAMMING GUIDELINES
  6766.  
  6767.       These are Texasn Instruments internal programming Guildelines.
  6768.  
  6769.       3.5.1  Development Environment
  6770.  
  6771.       The programming language for  the  development  of  the  NOSC  virtual
  6772.       terminal  shall  be  Ada.   The  user's  manual shall be the Reference
  6773.       Manual for the Ada Programming Language [DOD83 ].  The support  system
  6774.       shall  be an Ada Programming Support Environment, specifically ROLM/DG
  6775.       Ada Development Environment.
  6776.  
  6777.       3.5.2  Ada Programming Standards
  6778.  
  6779.       3.5.2.1  Introduction - This section contains the various  Ada  coding
  6780.       practices which will be used on this project.
  6781.  
  6782.       The  coding  practices  are  specified  as   either   "standards"   or
  6783.       "guidelines."    "Standards"    are   mandatory   requirements   while
  6784.       "guidelines" denote preferred practices.
  6785.  
  6786.       3.5.2.2  Prologue Documentation - This section specifies  the  minimum
  6787.       information  to  be  included  in the prologue of a program unit.  The
  6788.       prologue provides for program  version  identification  to  facilitate
  6789.       configuration management.
  6790.  
  6791.       STANDARD:   Each  program  unit  shall  have  an  associated  standard      _________
  6792.       prologue  directly  preceding the program unit.  The standard prologue
  6793.       will contain the information shown in Example 1.
  6794.  
  6795.       STANDARD:  All prologue information for each  program  unit  shall  be      _________
  6796.       present  before  the  code  is  placed  under configuration management
  6797.       control.
  6798.  
  6799.       STANDARD:  The Revision History  information  shall  contain  the  SAR      _________
  6800.       (Software  Activity  Request) number or equivalent for program version
  6801.       identification by configuration management control.
  6802. REQUIREMENTS                                                      Page 3-150
  6803. Prologue Documentation                                             16 Nov 84
  6804.  
  6805.  
  6806.        
  6807.       -----------------------PROLOGUE---------------------------------
  6808.       --
  6809.       -- Program Unit Name :
  6810.       -- Author       :
  6811.       -- Date created :
  6812.       -- Last update  :
  6813.       --
  6814.       ----------------------------------------------------------------
  6815.       --
  6816.       -- Abstract     :   (A one-paragraph overall description
  6817.       --              :    of the program unit function.)
  6818.       --              :
  6819.       --              :
  6820.       --
  6821.       ----------------------------------------------------------------
  6822.       --
  6823.       -- Mnemonic     :   (Exact name program unit is compiled by)
  6824.       -- Name         :   (Short functional name of program unit)
  6825.       -- Release date :   (Preliminary release)
  6826.       -- Revision History (After preliminary release)
  6827.       --     Date          Author           History
  6828.       --
  6829.       --                                   (Explanation of change
  6830.       --                                    including SAR number)
  6831.       --
  6832.       ----------------------- END PROLOGUE ---------------------------
  6833.        
  6834.        
  6835.                       Example 1. Ada Prologue Example
  6836. REQUIREMENTS                                                      Page 3-151
  6837. Naming Conventions                                                 16 Nov 84
  6838.  
  6839.  
  6840.       3.5.2.3  Naming Conventions -
  6841.  
  6842.       STANDARD:   All  names  shall  be  understandable,  significant,   and      _________
  6843.       meaningful.  Ada readily supports this objective by imposing almost no
  6844.       limit on the number of characters allowed in a name.  [FORE83]
  6845.  
  6846.       STANDARD:  The use of the underscore character (_) like the use of the      _________
  6847.       blank in English text strongly enhances readability.  The (_) shall be
  6848.       used to separate full English words.  Abbreviations may have  internal
  6849.       (_) where desired.  This standard is illustrated in Example 2.
  6850.  
  6851.       GUIDELINE:  Names which look alike due to the  overuse  of  "I",  "1",      __________
  6852.       "0",  "O",  "2",  and "Z" should be avoided.  Do not select identifier
  6853.       names which might be confused with their contents.   Choose  names  on
  6854.       the  basis  of  what  an  identifier  is  FOR, not what the identifier
  6855.       contains.  This guideline is illustrated in Example 2.  [FORE83]
  6856.  
  6857.        
  6858.               POOR                                BETTER
  6859.        
  6860.        istemperatureextreme              is_temperature_extreme
  6861.        switch_one                        end_mechanical_testing
  6862.        seven                             cost_per_unit
  6863.        
  6864.                       Example 2. Variable Declarations
  6865.  
  6866.  
  6867.  
  6868.       GUIDELINE:  Types should be named as common  noun  phrases  describing      __________
  6869.       the class of things they represent [BOO83].  For example:
  6870.  
  6871.       -- tree, linked_list, index
  6872.  
  6873.  
  6874.       GUIDELINE:  Objects/variables should be named as proper  noun  phrases      __________
  6875.       [BOO83].  For example:
  6876.  
  6877.       -- my_tree, personnel_linked_list, data_base_index
  6878. REQUIREMENTS                                                      Page 3-152
  6879. Declarations Usage                                                 16 Nov 84
  6880.  
  6881.  
  6882.       3.5.2.4  Declarations Usage -
  6883.  
  6884.       3.5.2.4.1  Commenting Declarations -
  6885.  
  6886.       GUIDELINE:   Each  constant,  type,  and  object/variable   identifier      __________
  6887.       declared should be accompanied by a brief comment if the identifier is
  6888.       not self-explanatory.  The comments should be aligned  as  closely  as
  6889.       possible  for  enhanced readability.  This guideline is illustrated in
  6890.       Example 3.
  6891.  
  6892.       3.5.2.4.2  Declaration Formatting -
  6893.  
  6894.       STANDARD:  All declarations shall be aligned and each one shall be  on      _________
  6895.       a  separate  line.  Identifier lists shall not be used.  This standard
  6896.       is illustrated in Example 3.
  6897.  
  6898.       GUIDELINE:  The grouping of  declarations  should  be  consistent  and      __________
  6899.       follow  one  of the methods described below.  The decision as to which
  6900.       grouping method will be enforced shall be made by the project manager.
  6901.       The grouping methods are :
  6902.  
  6903.       1.  All declarations possessing the  same  characteristics  should  be
  6904.           grouped  together  and  commented  accordingly.   For example, all
  6905.           CONSTANTS  shall   be   together,   all   TYPES   together,   etc.
  6906.           Additionally,  SUBTYPES should immediately follow their respective
  6907.           TYPES.  A blank line should be used to  separate  the  declaration
  6908.           groups.  This guideline is illustrated in Example 3 and Example 9.
  6909.  
  6910.       2.  All declarations concerning  the  same  usage  should  be  grouped
  6911.           together  and  commented accordingly.  A blank line should be used
  6912.           to separate the declaration groups.  This guideline is illustrated
  6913.           in Example 4.
  6914.  
  6915. REQUIREMENTS                                                      Page 3-153
  6916. Declaration Formatting                                             16 Nov 84
  6917.  
  6918.  
  6919.              -- constant declarations
  6920.        
  6921.       block_size      : CONSTANT := 560;    -- physical record length
  6922.       days_per_month  : CONSTANT := 31;
  6923.       ending_year     : CONSTANT := 2000;   -- last applicable year
  6924.       line_buffer     : CONSTANT := 80;     -- characters per line
  6925.       number_of_slots : CONSTANT := 30;
  6926.       page_size       : CONSTANT := 54;     -- lines per page
  6927.       screen_size     : CONSTANT := 24*80;  -- characters per VDT screen
  6928.        
  6929.        
  6930.              -- type declarations
  6931.        
  6932.       TYPE byte       IS RANGE  0..16#FF#;           -- byte addresses
  6933.       TYPE print_line IS ARRAY (1..line_buffer) OF character;
  6934.       TYPE page       IS ARRAY (1..page_size) OF print_line;
  6935.       TYPE month_name IS (jan,feb,mar,apr,may,jun,jul,aug,
  6936.                           sep,oct,nov,dec);
  6937.       SUBTYPE summer  IS month_name RANGE jun..sep;
  6938.        
  6939.       TYPE queue_slot IS RANGE 1..number_of_slots;
  6940.        
  6941.        
  6942.        
  6943.        
  6944.       TYPE date       IS
  6945.         RECORD
  6946.           day    : integer RANGE 1..days_per_month;
  6947.           month  : month_name;
  6948.           year   : integer RANGE 0..ending_year;
  6949.         END RECORD;
  6950.        
  6951.            -- actual variables
  6952.        
  6953.       LAST_MESSAGE_OCCUPIED : QUEUE_SLOT;
  6954.       NEXT_AVAIL_MESSAGE    : QUEUE_SLOT;
  6955.       EMPLOYEE_BIRTH_DATE   : DATE;
  6956.       IS_EMPTY              : BOOLEAN;         -- queue status
  6957.        
  6958.                    Example 3. Ada Declaration Formatting
  6959. REQUIREMENTS                                                      Page 3-154
  6960. Declaration Formatting                                             16 Nov 84
  6961.  
  6962.  
  6963.              -- day types
  6964.        
  6965.       TYPE day IS (monday,tuesday,wednesday,thursday,
  6966.                    friday,saturday,sunday);
  6967.        
  6968.       today : day;
  6969.       tomorrow : day;
  6970.        
  6971.              -- card types
  6972.        
  6973.       TYPE suit IS (clubs,diamonds,hearts,spades);
  6974.       TYPE value IS ('2','3','4','5','6','7','8','9',
  6975.                      '10',jack,queen,king,ace);
  6976.       TYPE player IS (north,west,south,east);
  6977.       TYPE card IS
  6978.            RECORD
  6979.              suit_name : suit;
  6980.              number_value : value;
  6981.            END RECORD;
  6982.       TYPE hand IS ARRAY(1..13) OF card;
  6983.       TYPE table IS ARRAY(player) OF hand;
  6984.        
  6985.       trumps       : suit;
  6986.       first_table  : table;
  6987.       second_table : table;
  6988.        
  6989.                    Example 4. Ada Declaration Formatting
  6990.  
  6991.  
  6992.  
  6993.  
  6994.       3.5.2.4.3  Use Of Constants -
  6995.  
  6996.       STANDARD:  Each character literal or string literal shall  be  located      _________
  6997.       in the constant declarations.  This standard is illustrated in Example
  6998.       3.
  6999.  
  7000.       STANDARD:  Do not embed "MAGIC NUMBER" constants in your  code.   Such      _________
  7001.       constants  lack  significance  and are difficult to maintain [FORE83].
  7002.       This standard is illustrated in Example 5.
  7003. REQUIREMENTS                                                      Page 3-155
  7004. Use Of Constants                                                   16 Nov 84
  7005.  
  7006.  
  7007.        
  7008.        
  7009.       If the cost of sensors is 45.50 you might write the following
  7010.       statement  to compute the cost of the sensors:
  7011.        
  7012.               sensor_cost := 45.50 * number_of_sensors;
  7013.        
  7014.       It is better to declare a constant,  cost_per_sensor,  initialized  to
  7015.       45.50, so that your statement would read:
  7016.        
  7017.               sensor_cost := cost_per_sensor * number_of_sensors;
  7018.        
  7019.       As such, changes in the cost of sensors are more  easily  accomplished
  7020.       since  you  will only have to make one change and not have to find all
  7021.       other occurrences of the "MAGIC NUMBER".  [FORE83]
  7022.  
  7023.  
  7024.                           Example 5. Magic Numbers
  7025.  
  7026.  
  7027.  
  7028.       GUIDELINE:  The upper bounds  of  all  non-dynamic  ARRAYS  should  be      __________
  7029.       specified  by  constants.  This guideline is illustrated in Example 3.
  7030.       SKIP 1
  7031.  
  7032.       3.5.2.4.4  Strong Typing -
  7033.  
  7034.  
  7035.       GUIDELINE:   The  strong  typing  feature  of  Ada  should   be   used      __________
  7036.       exhaustively.  Types should be distinguished as far as the application
  7037.       allows.  Different types should be declared  if  there  is  no  common
  7038.       processing.  [KARL81]
  7039.  
  7040.       GUIDELINE:  Avoid declaring and using objects/variables of a universal      __________
  7041.       type,  such as INTEGER or FLOAT.  An exception to this guideline might
  7042.       be variables of the type BOOLEAN.  This guideline  is  illustrated  in
  7043.       Example 6.
  7044.        
  7045.         checking_balance : integer;                     -- poor
  7046.        
  7047.        
  7048.        
  7049.        TYPE cash_type IS RANGE 100..500;                -- better
  7050.        
  7051.          checking_balance : cash_type;
  7052.        
  7053.                          Example 6. Universal Types
  7054. REQUIREMENTS                                                      Page 3-156
  7055. Coding Conventions                                                 16 Nov 84
  7056.  
  7057.  
  7058.       3.5.2.5  Coding Conventions - This section specifies coding  practices
  7059.       which apply to Ada statements.
  7060.  
  7061.       3.5.2.5.1  Attributes -
  7062.  
  7063.       GUIDELINE:  The use of attributes is recommended for  maintainability.      __________
  7064.       If  you  see  a  "MAGIC  NUMBER", try to use an attribute or declare a
  7065.       constant.  [ARPA3]
  7066.  
  7067.  
  7068.       3.5.2.5.2  Upper/Lower Case Usage -
  7069.  
  7070.       STANDARD:  All Ada reserved words shall be  one  case  and  all  other      _________
  7071.       names  shall  be  the  other  case.   Comments may be mixed case.  The
  7072.       examples given here use this standard.
  7073.  
  7074.  
  7075.       3.5.2.5.3  Statement Formatting For Readability -
  7076.  
  7077.       STANDARD:  Each statement shall begin on a  separate  line.   Multiple      _________
  7078.       statements  per line are not allowed.  This standard is illustrated in
  7079.       Example 7.
  7080.  
  7081.       STANDARD:  At least one  space  shall  appear  before  and  after  all      _________
  7082.       relational  and arithmetic operators.  This standard is illustrated in
  7083.       all examples.
  7084.  
  7085.       STANDARD:  Indentation is approached with "comb" structures.  Examples      _________
  7086.       of proper indentation techniques are shown in Example 7 and Example 8.
  7087.       [ARPA4]
  7088. REQUIREMENTS                                                      Page 3-157
  7089. Statement Formatting For Readability                               16 Nov 84
  7090.  
  7091.  
  7092.        
  7093.        
  7094.       IF valve_status = open THEN
  7095.          read_flow(rate);
  7096.       ELSE
  7097.          read_pressure(valve);
  7098.       END IF;
  7099.        
  7100.       ----------------------------------------------------------------
  7101.        
  7102.       IF indent_on THEN
  7103.          check_left_margin;
  7104.          left_shift;
  7105.       ELSIF outdent_on THEN
  7106.          right_shift;
  7107.       ELSE
  7108.          carriage_return;
  7109.          continue_scan;
  7110.       END IF;
  7111.        
  7112.       ----------------------------------------------------------------
  7113.        
  7114.       FOR i IN sensor_value_array'RANGE LOOP
  7115.           monitor_value_change(previous_reading_array(i),
  7116.                                new_reading_array(i));
  7117.           previous_reading_array(i) := new_reading_array(i);
  7118.       END LOOP;
  7119.        
  7120.       ----------------------------------------------------------------
  7121.        
  7122.       WHILE data_available LOOP
  7123.           read(my_file,input_buffer);
  7124.           process(input_buffer);
  7125.       END LOOP;
  7126.        
  7127.       ----------------------------------------------------------------
  7128.        
  7129.       main_cycle:
  7130.         LOOP
  7131.           get(temp);
  7132.           EXIT WHEN temp = critical_temp;
  7133.         END LOOP main_cycle;
  7134.        
  7135.                Example 7. Statement Alignment And Indentation
  7136. REQUIREMENTS                                                      Page 3-158
  7137. Statement Formatting For Readability                               16 Nov 84
  7138.  
  7139.  
  7140.        
  7141.       CASE string_length IS
  7142.         WHEN 0         => string_error;
  7143.         WHEN 1..80     => copy_string;
  7144.         WHEN 81..160   => copy_string;
  7145.                           string_length := string_length - max_string;
  7146.         WHEN 161 | 162 => delete_string;
  7147.         WHEN 163       => NULL;
  7148.         WHEN OTHERS    => RAISE system_error;
  7149.       END CASE;
  7150.        
  7151.       ----------------------------------------------------------------
  7152.        
  7153.       TASK sequencer IS
  7154.         ENTRY phase_1;
  7155.         ENTRY phase_2;
  7156.         ENTRY phase_3;
  7157.       END sequencer;
  7158.        
  7159.       TASK BODY sequencer IS
  7160.       BEGIN
  7161.         ACCEPT phase_1;
  7162.         ACCEPT phase_2;
  7163.         ACCEPT phase_3 do
  7164.           initiate_launch;
  7165.         END phase_3;
  7166.       END sequencer;
  7167.        
  7168.       ----------------------------------------------------------------
  7169.        
  7170.       LOOP
  7171.             -- program unit statements
  7172.         SELECT
  7173.           ACCEPT make_deposit(id     : IN account_type;
  7174.                               amount : IN cash_type)   DO
  7175.             -- program unit statements
  7176.           END make_deposit;
  7177.         OR
  7178.           ACCEPT make_drive_up_deposit(id     : IN account_type;
  7179.                                       (amount : IN cash_type)   DO
  7180.             -- program unit statements
  7181.           END make_drive_up_deposit;
  7182.         ELSE
  7183.           do_filing;
  7184.         END SELECT;
  7185.            -- program unit statements
  7186.       END LOOP;
  7187.        
  7188.                Example 8. Statement Alignment And Indentation
  7189. REQUIREMENTS                                                      Page 3-159
  7190. Subprogram Usage And Formatting                                    16 Nov 84
  7191.  
  7192.  
  7193.       3.5.2.5.4  Subprogram Usage And Formatting -
  7194.  
  7195.       STANDARD:  The formal part of each subprogram  shall  be  aligned  and      _________
  7196.       coded   with   one   argument   per   line.   Additionally,  parameter
  7197.       specification options shall be grouped  together  according  to  their
  7198.       mode  as  either  IN, OUT, or IN OUT.  This standard is illustrated in
  7199.       Example 9.
  7200.  
  7201.       STANDARD:  The END which concludes a PROCEDURE or  FUNCTION  shall  be      _________
  7202.       followed   by  the  name  of  the  program  unit.   This  standard  is
  7203.       illustrated in Example 9.
  7204.  
  7205.       GUIDELINE:  Subprograms should be named  with  verb  phrases  [BOO83].      __________
  7206.       For example:
  7207.  
  7208.       -- start_mixing_process, sort_list
  7209.  
  7210.  
  7211.  
  7212.       GUIDELINE:   Subprograms  should  be  used  for  main  program  units,      __________
  7213.       definition  of  functional control, and definition of type operations.
  7214.       [BOO83]
  7215.  
  7216.       GUIDELINE:  Functions that return a boolean value should be named with      __________                 ______ _ _______ _____
  7217.       phrases of the form "to be" [BOO83].  For example:
  7218.  
  7219.       -- is_not_empty
  7220.  
  7221.  
  7222.       GUIDELINE:  Named parameter association is  recommended  for  improved      __________
  7223.       readability   and  self-documentation.   It  also  helps  disambiguate
  7224.       instances of overloading.  [BOO83]
  7225.  
  7226. REQUIREMENTS                                                      Page 3-160
  7227. Subprogram Usage And Formatting                                    16 Nov 84
  7228.  
  7229.  
  7230.       WITH sample;
  7231.       PROCEDURE analyze_sensor_values IS
  7232.         actual_data : sample.values;
  7233.         fitted_data : sample.values;
  7234.        
  7235.         PROCEDURE get_samples (data : OUT    sample.values) IS SEPARATE;
  7236.         PROCEDURE limit_check (data : IN OUT sample.values) IS SEPARATE;
  7237.         PROCEDURE curve_fit   (data : IN     sample.values;
  7238.                                limit: IN     sample.values;
  7239.                                fit  : OUT    sample.values) IS SEPARATE;
  7240.         PROCEDURE report      (data : IN     sample.values) IS SEPARATE;
  7241.        
  7242.       BEGIN
  7243.         get_samples (actual_data);
  7244.         limit_check (actual_data);
  7245.         curve_fit (actual_data, limit_data, fit => fitted_data);
  7246.         report (fitted_data);
  7247.       END analyze_sensor_values;
  7248.        
  7249.  
  7250.  
  7251.        
  7252.       FUNCTION is_odd(value : IN integer) RETURN boolean IS
  7253.       BEGIN
  7254.         RETURN ((value REM 2) /= 0);
  7255.       END is_odd;                                              [BOO83]
  7256.        
  7257.                 Example 9. Procedure And Function Formatting
  7258.  
  7259.  
  7260.  
  7261.       GUIDELINE:  The use of the WITH statement without the USE statement is      __________
  7262.       recommended  for understandability and clarity of locations of program
  7263.       units.  This guideline is illustrated in Example 9 and in Example 10.
  7264.  
  7265.       GUIDELINE:  Each subprogram or function should contain only one RETURN      __________
  7266.       statement  and it must be the statement immediately preceding the END.
  7267.       This guideline is illustrated in Example 10.
  7268.  
  7269.  
  7270.  
  7271. REQUIREMENTS                                                      Page 3-161
  7272. Subprogram Usage And Formatting                                    16 Nov 84
  7273.  
  7274.  
  7275.        
  7276.       WITH text_io;
  7277.       FUNCTION is_read_flag_on RETURN boolean IS
  7278.         result           : boolean;
  7279.         user_input       : string(1..80);
  7280.       BEGIN
  7281.       edit_input:
  7282.           LOOP
  7283.             text_io.get(user_input);
  7284.             IF user_input(1..3) = "YES" THEN
  7285.                result :=  true;
  7286.                EXIT;
  7287.             ELSIF user_input(1..3) = "NO " THEN
  7288.                result :=  false;
  7289.                EXIT;
  7290.             ELSE
  7291.                text_io.put_line("Invalid response ... try again");
  7292.             END IF;
  7293.           END LOOP edit_input;
  7294.        
  7295.         RETURN result;
  7296.       END is_read_flag_on;       [ARPA5]
  7297.        
  7298.        
  7299.                     Example 10. Use Of Return Statements
  7300.  
  7301.  
  7302.       3.5.2.5.5  Packages, Tasks And Generics -
  7303.  
  7304.       GUIDELINE:   Packages  should  be  used  for  named   collections   of      __________
  7305.       declarations,  groups  of  related program units, abstract data types,
  7306.       and abstract state machines.  [BOO83]
  7307.  
  7308.       GUIDELINE:  Tasks should  be  used  for  concurrent  actions,  routing      __________
  7309.       messages, controlling resources, and interrupts.  [BOO83]
  7310.  
  7311.       GUIDELINE:  Generic program units should be  used  for  factoring  the      __________
  7312.       properties  of  a  class  of  program  units,  and  passing  types  as
  7313.       parameters to program units.  [BOO83]
  7314.  
  7315.       GUIDELINE:  Overloading should only be  used  to  name  an  equivalent      __________
  7316.       action for different types.  [BOO83]
  7317.  
  7318.       GUIDELINE:  Packages should be named with noun phrases summarizing the      __________
  7319.       package contents [BOO83].  For example:
  7320.  
  7321.       -- math_functions, earth_constants
  7322.  
  7323. REQUIREMENTS                                                      Page 3-162
  7324. Packages, Tasks And Generics                                       16 Nov 84
  7325.  
  7326.  
  7327.       GUIDELINE:  Tasks should be named with noun phrases, usually  denoting      __________
  7328.       some action [BOO83].  For example:
  7329.  
  7330.       -- timer, message_router, list_searcher
  7331.  
  7332.  
  7333.       3.5.2.5.6  Complex Expressions -
  7334.  
  7335.       GUIDELINE:   Complex   expressions   should   be   parenthesised   for      __________
  7336.       readability  and  understandability.  This guideline is illustrated in
  7337.       Example 11.
  7338.                         -- poor
  7339.        
  7340.          gamma_value := beta_value + alpha_value / 2 ** 5 * 6;
  7341.        
  7342.                         -- better
  7343.        
  7344.          gamma_value := beta_value + ((alpha_value / (2 ** 5)) * 6);
  7345.        
  7346.                       Example 11. Complex Expressions
  7347.  
  7348.  
  7349.       3.5.2.5.7  Labels And GOTOs -
  7350.  
  7351.       STANDARD:  The use of LABELs and GOTO statements shall require project      _________
  7352.       manager approval on a case by case basis.
  7353.  
  7354.       3.5.2.5.8  Task Termination -
  7355.  
  7356.       STANDARD:  ABORT shall not be used except as a last resort  and  shall      _________
  7357.       require project manager approval on a case by case basis.  [BOO83]
  7358.  
  7359.       GUIDELINE:  Every server task should have  a  TERMINATE  statement  to      __________
  7360.       achieve  regular  termination  with  its  parent  unless  an  ENTRY is
  7361.       provided for termination.  [BOO83]
  7362.  
  7363.  
  7364.       3.5.2.5.9  Exceptions -
  7365.  
  7366.       GUIDELINE:  Exceptions should be used as necessary to keep the flow of      __________
  7367.       control  in  the main body simple and representative of the body.  All
  7368.       unusual cases should be handled  as  exceptions.   This  guideline  is
  7369.       illustrated in Example 12.
  7370.  
  7371.       GUIDELINE:  Exceptions should not be suppressed.      __________
  7372.  
  7373.       GUIDELINE:  An exception should be captured  at  the  lowest  possible      __________
  7374.       level  at  which  the program can properly respond to the error.  This
  7375.       guideline is illustrated in Example 12.  [BOO83]
  7376. REQUIREMENTS                                                      Page 3-163
  7377. Exceptions                                                         16 Nov 84
  7378.  
  7379.  
  7380.       PROCEDURE driver IS
  7381.        
  7382.         --  ...program unit statments
  7383.        
  7384.         TYPE small IS DIGITS 5 RANGE 0.0..10.0;
  7385.         y : small;
  7386.         x : float;
  7387.        
  7388.         FUNCTION inverse(i: IN float) RETURN small IS
  7389.        
  7390.         BEGIN
  7391.           RETURN small(1.0/i);
  7392.         EXCEPTION
  7393.           WHEN numeric_error =>  RETURN small'LARGE;
  7394.         END inverse;
  7395.        
  7396.         -- ...program unit statements
  7397.        
  7398.       begin
  7399.        
  7400.         -- ...program unit statements
  7401.        
  7402.         y := inverse(x);
  7403.        
  7404.         -- ...program unit statements
  7405.        
  7406.       EXCEPTION
  7407.         WHEN constraint_error => NULL;
  7408.       END driver;                              [BOO83/ARPA6]
  7409.        
  7410.                        Example 12. Exception Handling
  7411. REQUIREMENTS                                                      Page 3-164
  7412. Program Version Identification And CM                              16 Nov 84
  7413.  
  7414.  
  7415.       3.5.3  Program Version Identification And CM
  7416.  
  7417.  
  7418.       The program version identification information  is  contained  in  the
  7419.       configuration  section  of  the  preamble.   This section includes the
  7420.       preliminary release date and  the  revision  history  information  for
  7421.       tracking.  The configuration management procedures will be followed as
  7422.       stated in the NOSC Virtual Terminal Proposal.
  7423.  
  7424.  
  7425.  
  7426.  
  7427.  
  7428.  
  7429.  
  7430.  
  7431.  
  7432.  
  7433.  
  7434.                                  CHAPTER 4
  7435.  
  7436.                              QUALITY ASSURANCE
  7437.  
  7438.  
  7439.  
  7440.  
  7441.       This program uses a software development methodology which  emphasizes
  7442.       object   oriented   design   and   development,   controlled  testing,
  7443.       verification and validation procedures, a baseline defined  management
  7444.       and  change  control  system  and a software Quality Assurance Program
  7445.       which monitors all phases of the software development life cycle.
  7446.  
  7447.       The software life cycle is divided into unique  phases  with  distinct
  7448.       initiation  and  termination  points  for  each phase.  Provisions for
  7449.       returning to a previous phase of a problem  solution  are  allowed  by
  7450.       using  comprehensive change control.  In all phases up to the test and
  7451.       integration phase, the status and progress are controlled and verified
  7452.       through a series of design reviews and audits.
  7453.  
  7454.       The software testing will be provided through the execution  of  those
  7455.       tasks  necessary  to  ensure  that  the software performs, with a high
  7456.       degree of reliability, according to the Proposal.
  7457.  
  7458.  
  7459.  
  7460.  
  7461.  
  7462.  
  7463.  
  7464.  
  7465.  
  7466.  
  7467.  
  7468.                                  CHAPTER 5
  7469.  
  7470.                                    NOTES
  7471.  
  7472.  
  7473.  
  7474.  
  7475.  
  7476.  
  7477.  
  7478.  
  7479.  
  7480.  
  7481.  
  7482.  
  7483.  
  7484.  
  7485.                                  APPENDIX A
  7486.  
  7487.                     THE TERMINAL CAPABILITIES FILE (TCF)
  7488.  
  7489.  
  7490.  
  7491.       A.1  INTRODUCTION
  7492.  
  7493.       The Terminal Capabilities File is a variation of the TERMCAP developed
  7494.       in the Berkeley extensions to the UNIX operating system.
  7495.  
  7496.       The TCF is a data base describing terminals.  Terminals are  described
  7497.       in  the  TCF  by  giving a set of capabilities which they have, and by
  7498.       describing how operations are  performed.   Padding  requirements  and
  7499.       initialization sequences are included in the TCF.
  7500.  
  7501.       Entries in the TCF consist of a number of ":" separated  fields.   The
  7502.       first  entry for each terminal gives the names which are known for the
  7503.       terminal, separated by "|" characters.  The first  name  is  always  2
  7504.       characters  long  and  is  used  by older UNIX systems which store the
  7505.       terminal type in a 16 bit word in a systemwide data base.  The  second
  7506.       name  given  is the most common abbreviation for the terminal, and the
  7507.       last name given should be a long name fully identifying the  terminal.
  7508.       This  second  name  is the one that is matched against the VMS logical
  7509.       name "TERM".  The second name should contain no blanks;  the last name
  7510.       may well contain blanks for readability.
  7511.  
  7512.  
  7513.       A.2  CAPABILITIES
  7514.  
  7515.  
  7516.            (P) indicates padding may be specified.
  7517.                Padding is an amount of time to be waited after the
  7518.                command is executed.
  7519.  
  7520.            Name   Type   Pad?   Description
  7521.            al     str    (P)    Add new blank line
  7522.            be     str    (P)    Bell
  7523.            cd     str    (P)    Clear to end of display
  7524.            co     num           Number of columns in a line
  7525.            ce     str    (P)    Clear to end of line
  7526.            cm     str    (P)    Cursor motion
  7527.            dc     str    (P)    Delete character
  7528.            dl     str    (P)    Delete line
  7529.            ei     str           End insert mode
  7530.            g0     str           sent by terminal function key 20
  7531. THE TERMINAL CAPABILITIES FILE (TCF)                                Page A-2
  7532. CAPABILITIES                                                       16 Nov 84
  7533.  
  7534.  
  7535.            g1     str           sent by terminal function key 21
  7536.            g2     str           Sent by terminal function key 22
  7537.            g3     str           Sent by terminal function key 23
  7538.            g4     str           Sent by terminal function key 24
  7539.            g5     str           Sent by terminal function key 25
  7540.            g6     str           Sent by terminal function key 26
  7541.            g7     str           Sent by terminal function key 27
  7542.            g8     str           Sent by terminal function key 28
  7543.            g9     str           Sent by terminal function key 29
  7544.            h0     str           Label on function key 20
  7545.            h1     str           Label on function key 21
  7546.            h2     str           Label on function key 22
  7547.            h3     str           Label on function key 23
  7548.            h4     str           Label on function key 24
  7549.            h5     str           Label on function key 25
  7550.            h6     str           Label on function key 26
  7551.            h7     str           Label on function key 27
  7552.            h8     str           Label on function key 28
  7553.            h9     str           Label on function key 29
  7554.            im     str           Enter insert character mode
  7555.            is     str           Terminal initialization string
  7556.            k1     str           Sent by terminal function key 1
  7557.            k2     str           Sent by terminal function key 2
  7558.            k3     str           Sent by terminal function key 3
  7559.            k4     str           Sent by terminal function key 4
  7560.            k5     str           Sent by terminal function key 5
  7561.            k6     str           Sent by terminal function key 6
  7562.            k7     str           Sent by terminal function key 7
  7563.            k8     str           Sent by terminal function key 8
  7564.            k9     str           Sent by terminal function key 9
  7565.            l1     str           Label on function key 1
  7566.            l2     str           Label on function key 2
  7567.            l3     str           Label on function key 3
  7568.            l4     str           Label on function key 4
  7569.            l5     str           Label on function key 5
  7570.            l6     str           Label on function key 6
  7571.            l7     str           Label on function key 7
  7572.            l8     str           Label on function key 8
  7573.            l9     str           Label on function key 9
  7574.            kd     str           Sent by terminal down arrow key
  7575.            kl     str           Sent by terminal left arrow key
  7576.            kr     str           Sent by terminal right arrow key
  7577.            ku     str           Sent by terminal up arrow key
  7578.            li     num           Number of lines on screen or page
  7579.            nl     str    (P)    Newline character (default \n)
  7580.            se     str           End stand out mode
  7581.            sf     str    (P)    Scroll forwards
  7582.            so     str           Begin stand out mode
  7583.            sr     str    (P)    Scroll reverse (backwards)
  7584.            su     bool          Scrolls up at bottom of screen
  7585.            t0     str           Sent by terminal function key 30
  7586.            t1     str           Sent by terminal function key 31
  7587.            t2     str           Sent by terminal function key 32
  7588.            v0     str           Label on function key 30
  7589. THE TERMINAL CAPABILITIES FILE (TCF)                                Page A-3
  7590. CAPABILITIES                                                       16 Nov 84
  7591.  
  7592.  
  7593.            v1     str           Label on function key 31
  7594.            v2     str           Label on function key 32
  7595.            wr     bool          Wraps at end of line
  7596.            x0     str           Sent by terminal function key 10
  7597.            x1     str           Sent by terminal function key 11
  7598.            x2     str           Sent by terminal function key 12
  7599.            x3     str           Sent by terminal function key 13
  7600.            x4     str           Sent by terminal function key 14
  7601.            x5     str           Sent by terminal function key 15
  7602.            x6     str           Sent by terminal function key 16
  7603.            x7     str           Sent by terminal function key 17
  7604.            x8     str           Sent by terminal function key 18
  7605.            x9     str           Sent by terminal function key 19
  7606.            y0     str           Label on function key 10
  7607.            y1     str           Label on function key 11
  7608.            y2     str           Label on function key 12
  7609.            y3     str           Label on function key 13
  7610.            y4     str           Label on function key 14
  7611.            y5     str           Label on function key 15
  7612.            y6     str           Label on function key 16
  7613.            y7     str           Label on function key 17
  7614.            y8     str           Label on function key 18
  7615.            y9     str           Label on function key 19
  7616.            
  7617.  
  7618.       The following  entry  describes  the  Televideo-970,  among  the  more
  7619.       complex entries in the TCF file as of this writing.
  7620.  
  7621.       t1|tv970|tv-970|televideo 970:\
  7622.               :al=1\E[1L:cd=\E[J:ce=\E[K:cm=\E[%i%2;%2H:co#80:\
  7623.               :dc=\E[1P:dl=1*\E[1M:ei=\E[4l:im=\E[4h:li#24:\
  7624.               :se=\E[0m:so=\E[7m:\
  7625.               :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:\
  7626.               :k1=\E?a\014:l1=F1:k2=\E?b\014:l2=F2:\
  7627.               :k3=\E?c\014:l3=F3:k4=\E?d\014:l4=F4:k5=\E?e\014:l5=F5:\
  7628.               :k6=\E?f\014:l6=F6:k7=\E?g\014:l7=F7:k8=\E?h\014:l7=F7:\
  7629.               :k9=\E?i\014:l9=F9:x0=\E?j\014:y0=F10:x1=\E?k\014:y1=F11:\
  7630.               :x2=\E?l\014:y2=F12:x3=\E?m\014:y3=F13:x4=\E?n\014:y4=F14:\
  7631.               :x5=\E?o\014:y5=F15:x6=\E?p\014:y6=F16:\
  7632.               :sr=\EM:is=\E<\E[>1;2;3;4;5;6;7;8;9l\E[0m\E[11m\E[?7h:\
  7633.               :be=\E[?5h\E[?5l:
  7634.  
  7635.       Note that entries may continue onto multiple lines by giving a "\"  as
  7636.       the  last  character  of a line, and that empty fields may be included
  7637.       for readability (here between the last field on a line and  the  first
  7638.       field  on the next).  Capabilities in TCF are of three types:  Boolean
  7639.       capabilities which indicate that  the  terminal  has  some  particular
  7640.       feature,  numeric  capabilities giving the size of the terminal or the
  7641.       size of particular delays,  and  string  capabilities,  which  give  a
  7642.       sequence which can be used to perform particular terminal operations.
  7643.  
  7644.       All capabilities have two  letter  codes.   Numeric  capabilities  are
  7645.       followed  by  the  character  "#" and then the value.  Thus "co" which
  7646.       indicates the number of columns the terminal has gives the value  "80"
  7647. THE TERMINAL CAPABILITIES FILE (TCF)                                Page A-4
  7648. CAPABILITIES                                                       16 Nov 84
  7649.  
  7650.  
  7651.       for the Televideo-970.
  7652.  
  7653.       String valued capabilities,  such  as  "ce"  (clear  to  end  of  line
  7654.       sequence)  are  given  by  the  two character code, an "=", and then a
  7655.       string ending at the next following ":".  A delay in milliseconds  may
  7656.       appear  after  the  "="  in  such  a capability.  The delay must be an
  7657.       integer, e.g.  "20".
  7658.  
  7659.       A number of  escape  sequences  are  provided  in  the  string  valued
  7660.       capabilities for easy encoding of characters there.  A "\E" maps to an
  7661.       ESCAPE character, "^x" maps to a control-x for any appropriate x,  and
  7662.       the  sequences  "\n"  "\r" "\t" "\b" "\f" give a newline, return, tab,
  7663.       backspace and formfeed.  Finally, characters may  be  given  as  three
  7664.       octal  digits after a "\", and the characters "^" and "\" may be given
  7665.       as "\^" and "\\".  If it is necessary to place a ":" in  a  capability
  7666.       it must be escaped in octal as "\072".
  7667.  
  7668.       We now outline how to prepare descriptions  of  terminals.   The  most
  7669.       effective  way  to  prepare a terminal description is by imitating the
  7670.       description of a similar terminal  in  TCF.   Be  aware  that  a  very
  7671.       unusual  terminal  may  expose  deficiencies in the ability of the TCF
  7672.       file to describe it or bugs in the virtual terminal.  To easily test a
  7673.       new  terminal description, you can set the environment variable TCF to
  7674.       a pathname of a file containing the description you are working on and
  7675.       the  virtual  terminal  will  look  there  rather  than  the  standard
  7676.       location.
  7677.  
  7678.       A.2.1  Basic Capabilities
  7679.  
  7680.       The number of columns on each line for the terminal is  given  by  the
  7681.       "co" numeric capability.  If the terminal is a CRT, then the number of
  7682.       lines on the screen is given by the "li" capability.  If the  terminal
  7683.       scrolls  at  the  right edge of the screen, use ":wr:" to signal this.
  7684.       If the terminal scrolls up at the bottom of the screen, use ":su:"  to
  7685.       signal this.
  7686.  
  7687.       These  capabilities  suffice  to  describe  hardcopy  and  "glass-tty"
  7688.       terminals.  Thus the model 33 teletype is described as
  7689.  
  7690.       t3|33|tty33:co#72
  7691.  
  7692.       while the Lear Siegler ADM-3 is described as
  7693.  
  7694.       cl|adm3|3|lsi:\
  7695.            :wr:li#24:co#80
  7696.  
  7697.  
  7698.       A.2.2  Cursor Addressing
  7699.  
  7700.       Cursor addressing in the  terminal  is  described  by  a  "cm"  string
  7701.       capability.   These  substitute  to  encodings  of the current line or
  7702.       column position, while other characters are passed through  unchanged.
  7703.       If  the  "cm"  string  is  thought  of  as  being a function, then its
  7704.       arguments are the line and then the column to which motion is desired,
  7705. THE TERMINAL CAPABILITIES FILE (TCF)                                Page A-5
  7706. Cursor Addressing                                                  16 Nov 84
  7707.  
  7708.  
  7709.       and the "%" encodings have the following meanings:
  7710.  
  7711.                 %d   use as many digits as necessary
  7712.                 %2   use 2 digits
  7713.                 %3   use 3 digits
  7714.                 %.   encode binary value into a character (7 bits)
  7715.                 %+x  adds x to value, then %.
  7716.                 %<xy if value < x adds y; then in any case %.
  7717.                 %r   reverses order of line and column, no output
  7718.                 %i   increments line/column (for 1 origin)
  7719.                 %%   gives a single %
  7720.  
  7721.       Consider the HP2645, which, to get to row 3 and column 12, needs to be
  7722.       sent  "\E&a12c03Y"  padded for 6 milliseconds.  Note that the order of
  7723.       the rows and columns is inverted here, and that the row and column are
  7724.       printed as two digits.  Thus its "cm" capability is "cm=6\E&%r%2c%2Y".
  7725.       The Microterm ACT-IV needs the current row and column sent preceded by
  7726.       a "^T", with the row and column simply encoded in binary, "cm=^T%.%.".
  7727.  
  7728.       A final example is the LSI ADM-3a, which uses row and column offset by
  7729.       a blank character, thus "cm=\E=%+ %+ ".
  7730.  
  7731.       A.2.3  Area Clears
  7732.  
  7733.       If the terminal can clear from the current position to the end of  the
  7734.       line,  leaving  the  cursor where it is, this should be given as "ce".
  7735.       If the terminal can clear from the current position to the end of  the
  7736.       display, then this should be given as "cd".
  7737.  
  7738.       A.2.4  Insert/Delete Line
  7739.  
  7740.       If the terminal can open a new blank line before the  line  where  the
  7741.       cursor  is,  this should be given as "al";  this is done only from the
  7742.       first position of a line.  The cursor must then appear  on  the  newly
  7743.       blank  line.   If the terminal can delete the line which the cursor is
  7744.       on, then this should be given as "dl";  this is  done  only  from  the
  7745.       first  position on the line to be deleted.  If the terminal can scroll
  7746.       the screen backwards, then this can be given as "sb",  but  just  "al"
  7747.       suffices.  Think about it.
  7748.  
  7749.       A.2.5  Insert/Delete Character
  7750.  
  7751.       There are two basic kinds of intelligent  terminals  with  respect  to
  7752.       insert/delete  character  which  can  be described using the TCF.  The
  7753.       most  common  insert/delete  character  operations  affect  only   the
  7754.       characters on the current line and shift characters off the end of the
  7755.       line rigidly.  Other terminals, such as the Concept 100 and the Perkin
  7756.       Elmer  Owl, make a distinction between typed and untyped blanks on the
  7757.       screen, shifting upon an insert or delete only to an untyped blank  on
  7758.       the  screen  which  is  either  eliminated, or expanded to two untyped
  7759.       blanks.  You can find out which kind of terminal you have by  clearing
  7760.       the  screen  and  then  typing text separated by cursor motions.  Type
  7761.       "abc def" using local cursor motions (not spaces)  between  the  "abc"
  7762.       and  the "def".  Then position the cursor before the "abc" and put the
  7763. THE TERMINAL CAPABILITIES FILE (TCF)                                Page A-6
  7764. Insert/Delete Character                                            16 Nov 84
  7765.  
  7766.  
  7767.       terminal in insert mode.  If typing characters causes the rest of  the
  7768.       line  to  shift  rigidly and characters to fall off the end, then your
  7769.       terminal does not distinguish between blanks  and  untyped  positions.
  7770.       If  the "abc" shifts over to the "def" which then move together around
  7771.       the end of the current line and onto the next as you insert, you  have
  7772.       the  second  type  of  terminal.   If  you  have  this  second type of
  7773.       terminal, you will get no support from the virtual terminal.  This may
  7774.       be changed in further versions.
  7775.  
  7776.       Give as "im" the sequence to get into insert character mode.  Give  as
  7777.       "ei" the sequence to leave insert mode.
  7778.  
  7779.       A.2.6  Highlighting, Underlining, And Visible Bells
  7780.  
  7781.       If your terminal has sequences to enter and exit standout  mode  these
  7782.       can  be  given  as  "so"  and "se" respectively.  If there are several
  7783.       flavors  of  standout  mode  (such  as  inverse  video,  blinking,  or
  7784.       underlining  -  half bright is not considered "standout") the prefered
  7785.       mode is inverse video by itself.
  7786.  
  7787.       If the terminal has a way of flashing the screen to indicate an  error
  7788.       quietly  (a bell replacement) then this can be given as "be";  it must
  7789.       not move the cursor.
  7790.  
  7791.       A.2.7  Function Keys
  7792.  
  7793.       If the terminal has function keys that transmits codes when  the  keys
  7794.       are  pressed,  this  information  can  be  given.  Note that it is not
  7795.       possible to handle terminals where the  keypad  only  works  in  local
  7796.       (this applies, for example, to the unshifted HP 2621 keys).  The codes
  7797.       sent by the left arrow, right arrow, up arrow, down  arrow,  and  home
  7798.       keys  can  be  given as "kl", "kr", "ku", "kd", and "kh" respectively.
  7799.       If there are function keys such as "f1", "f2", ...,  "f9",  the  codes
  7800.       they  send  can  be  given  as "k1", "k2", ..., "k9", "x0", "x1", ...,
  7801.       "x6", etc.  If these keys have labels, the  labels  can  be  given  as
  7802.       "l1", ..., "l9", "y0", "y1", ..., "y6", etc.
  7803.  
  7804.       A.2.8  Initialization
  7805.  
  7806.       An initialization string can be specified to setup the characteristics
  7807.       of a terminal.  If the terminal must have its function keys defined or
  7808.       turn on the keypad mode this can be done with is.
  7809.  
  7810.       Using the Televideo-970 example again:
  7811. THE TERMINAL CAPABILITIES FILE (TCF)                                Page A-7
  7812. Initialization                                                     16 Nov 84
  7813.  
  7814.  
  7815.  
  7816.       t1|tv970|tv-970|televideo 970:\
  7817.               :al=1\E[1L:cd=\E[J:ce=\E[K:cm=\E[%i%2;%2H:co#80:\
  7818.               :dc=\E[1P:dl=1*\E[1M:ei=\E[4l:im=\E[4h:li#24:\
  7819.               :se=\E[0m:so=\E[7m:\
  7820.               :kb=^h:ku=\E[A:kd=\E[B:kl=\E[D:kr=\E[C:\
  7821.               :k1=\E?a\014:l1=F1:k2=\E?b\014:l2=F2:\
  7822.               :k3=\E?c\014:l3=F3:k4=\E?d\014:l4=F4:k5=\E?e\014:l5=F5:\
  7823.               :k6=\E?f\014:l6=F6:k7=\E?g\014:l7=F7:k8=\E?h\014:l7=F7:\
  7824.               :k9=\E?i\014:l9=F9:x0=\E?j\014:y0=F10:x1=\E?k\014:y1=F11:\
  7825.               :x2=\E?l\014:y2=F12:x3=\E?m\014:y3=F13:x4=\E?n\014:y4=F14:\
  7826.               :x5=\E?o\014:y5=F15:x6=\E?p\014:y6=F16:\
  7827.               :sr=\EM:is=\E<\E[>1;2;3;4;5;6;7;8;9l\E[0m\E[11m\E[?7h:\
  7828.               :be=\E[?5h\E[?5l:
  7829.  
  7830.       The               initialization               string               is
  7831.       ":is=\E<\E[>1;2;3;4;5;6;7;8;9l\E[0m\E[11m\E[?7h".  This string will be
  7832.       sent to the terminal when the VT initializes.
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838.  
  7839.  
  7840.  
  7841.  
  7842.  
  7843.  
  7844.                                  APPENDIX B
  7845.  
  7846.                     THE RECOGNIZED ANSI X3.64 SEQUENCES
  7847.  
  7848.  
  7849.  
  7850.       The interpreter procedure within the package driver will  interpret  a
  7851.       subset of the ANSI X3.64 standard sequences.  This includes all of the
  7852.       seven bit ASCII characters as well as certain special sequences.   The
  7853.       valid  ANSI  X3.64  sequences  that  will  recognize  are given below.
  7854.       Please refer to the ANSI Standard [ANSI79] for a complete  description
  7855.       of these control sequences.
  7856.  
  7857.       ANSI         Desription                         Character       
  7858.       Designation                                     Codes
  7859.  
  7860.       CSI     Control Sequence Introducer             ESC [
  7861.       DCH     Delete CHaracter                        ESC [ Pn P
  7862.       DL      Delete Line                             ESC [ Pn M
  7863.       IL      Insert Line                             ESC [ Pn L
  7864.       ED      Erase in Display
  7865.               from active position to end             ESC [ 0 J
  7866.               from start to active position           ESC [ 1 J
  7867.               all of display                          ESC [ 2 J
  7868.       EL      Erase in Line
  7869.               from active position to end             ESC [ 0 K
  7870.               from start to active position           ESC [ 1 K
  7871.               all of display                          ESC [ 2 K
  7872.       SGR     Select Graphic Rendition
  7873.               primary rendition                       ESC [ 0 m
  7874.               reverse image                           ESC [ 7 m
  7875.       CUP     Cursor Position                         ESC [ Pl ; Pc H
  7876.       SM      Set Mode
  7877.               IRM     insertion-replacement mode      ESC [ 4 h
  7878.       RM      Reset Mode
  7879.               IRM     insertion-replacement mode      ESC [ 4 l
  7880.  
  7881.  
  7882.  
  7883.  
  7884.  
  7885.  
  7886.  
  7887.  
  7888.  
  7889.  
  7890.  
  7891.  
  7892.                                  APPENDIX C
  7893.  
  7894.                              APSE DEPENDENCIES
  7895.  
  7896.  
  7897.  
  7898.       C.1  INTEROPERABILITY AND TRANSPORTABILITY
  7899.  
  7900.       C.1.1  Terminal Communications
  7901.  
  7902.       The system dependent terminal operations including:
  7903.  
  7904.        *  opening,
  7905.  
  7906.        *  closing,
  7907.  
  7908.        *  reading,
  7909.  
  7910.        *  writing
  7911.  
  7912.       will be isolated in the package SYSDEP.  Only SYSDEP will need  to  be
  7913.       modified when rehosting this virtual terminal.
  7914.  
  7915.       The TCF package will use standard Ada text I/O to  read  the  terminal
  7916.       capabilities  file.   The interoperability of this file depends solely
  7917.       on the host system.
  7918.  
  7919.  
  7920.  
  7921.  
  7922.  
  7923.  
  7924.  
  7925.  
  7926.  
  7927.  
  7928.  
  7929.                                  APPENDIX D
  7930.  
  7931.                                   GLOSSARY
  7932.  
  7933.  
  7934.  
  7935.  
  7936.       Actual display      ______ _______
  7937.            The user's physical terminal display.
  7938.       Form      ____
  7939.            A way of representing  the  virtual  display  that  supports  the
  7940.            partitioning of the display into separate qualified areas.
  7941.       Form-mode terminal      _________ ________
  7942.            A form  mode  terminal  is  a  terminal  that  has  form  fill-in
  7943.            capabilities  (i.e.  IBM 3278).  That is, the application program
  7944.            presents the user with a form to fill in on his  display  screen.
  7945.            The  user  fills  in  the  form  by  interacting  with some local
  7946.            intelligence and transmits the data  to  the  host  through  some
  7947.            special keystroke(s) (i.e.  ENTER key).
  7948.       Page-mode terminal      _________ ________
  7949.            A page mode terminal is a terminal  that  has  a  two-dimensional
  7950.            display  screen that can be directly addressed and may or may not
  7951.            have  any   local   intelligence   (i.e.    VT100,   Concept-100,
  7952.            Visual-50).
  7953.       Qualified area      _________ ____
  7954.            A set of adjacent character positions on the  same  line  of  the
  7955.            form-mode   terminal  virtual  display.   A  qualified  area  has
  7956.            attributes such  as:   intensity,  protection,  format  (numeric,
  7957.            alphabetic, etc), and defaults.
  7958.       Scroll-mode terminal      ___________ ________
  7959.            A scroll mode terminal is a terminal that operates like  hardcopy
  7960.            terminal.  That is, when a carriage return (or any terminator) is
  7961.            typed the terminal scrolls one line upward.  The functionality of
  7962.            this  terminal  class  is  severely limited and therefore, is the
  7963.            simplest of the terminal classes.
  7964.       Terminal capabilities file      ________ ____________ ____
  7965.            A  file  that  contains  specific   information   about   various
  7966.            terminals.   Such  information  as what ASCII sequences should be
  7967.            sent to move the cursor, the width and length of the screen, what
  7968.            ASCII sequences should be sent to insert a line, etc
  7969.       Transportability      ________________
  7970.            Transportability of an APSE tool is the ability of the tool to be
  7971.            installed  on  a different KAPSE;  the tool must perform with the
  7972.            same functionality in both APSEs.  Transportability  is  measured
  7973.            in  the  degree  to  which  this installation can be accomplished
  7974.            without reprogramming.
  7975. GLOSSARY                                                            Page D-2
  7976.                                                                    16 Nov 84
  7977.  
  7978.  
  7979.       Virtual display      _______ _______
  7980.            A representation of the actual display using Ada data structures.
  7981.