home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / vos / set_terminal_type.txt < prev    next >
Text File  |  2000-03-21  |  4KB  |  79 lines

  1. There is this program on the Stratus FTP site called set_terminal_type.cobol.
  2. It actually queried the terminal that you were connected to and tried to
  3. determine what terminal you were on, based upon the response.  It had a few
  4. problems: (1) it only had a few types that it knew/cared about and these were
  5. all Stratus terminals, (2) it didn't even have all the Stratus types (or at
  6. least the version I had didn't) (3) it was written in COBOL (yuk).
  7.  
  8. set_terminal_type.pl1 tries to remedy there problems.  Firstly, it is written
  9. in wonderful VOS pl/1 and most importantly, it uses a tin/table file to
  10. specify the terminals, the inquiry strings, and the expected responses.
  11.  
  12. The program has the display form:
  13.  
  14.  ------------------------------ set_terminal_type -----------------------------
  15.  stt:         stt.table
  16.  -wait_timer: 3
  17.  
  18. where:
  19.  
  20. stt is the path of the stt table.  The default is stt.table in the current dir.
  21.  
  22. -wait_timer is the expected time to wait for a response
  23.  
  24. In addition,
  25.  
  26. -raw is a secret switch that displays the response from the terminal.
  27.  
  28. The format of the tin file is:
  29.  
  30. declare  1  stt                    based,
  31.             2  inq                 char(32), /* query character string     */
  32.             2  pref                char(32) varying,
  33.                                              /* identifiying prefix        */
  34.             2  default             char(32) varying,
  35.                                              /* default term type          */
  36.             2  type_off            bin(15),  /* type location              */
  37.             2  type_len            bin(15),  /* type length                */
  38.             2  parms(5),
  39.                3  name             char(32) varying,
  40.                                              /* parameter to display       */
  41.                3  offset           bin(15),  /* parm location              */
  42.                3  len              bin(15),  /* parm length                */
  43.             2  cmd                 char(300) varying;
  44.                                              /* cmd to execute for this trm*/
  45.  
  46. where 
  47.  
  48. inq is the string that is sent to the terminal.
  49.  
  50. pref is the initial substring that is looked for in the response.  This may
  51. not be the name or type of the terminal, but just something to identify the
  52. response.
  53.  
  54. default is the default to use for the terminal.
  55.  
  56. type_off is the location in the response where the actual type to be used is.
  57. If this is -1, then the default is used.
  58.  
  59. type_len is the length of the terminal type in the response.
  60.  
  61. parms are informational fields that are extracted from the response and
  62. printed on the terminal after the terminal type has been established.
  63.  
  64. cmd is a command to execute once set_terminal_type has set the terminal type
  65.  
  66. The stt.table file is indexed based on the content of inq.  This groups
  67. together all the terminals with a common inquiry.  That inquiry is only sent
  68. once.  Then the common terminals that use that inquiry are searched based upon
  69. a match of the response to the pref.  The order that they are searched is the
  70. order they are in the file, even though they would have the same key (what is
  71. in inq).  Thus, if two terminal share an initial substring in the pref, then
  72. always put the longest one first in the tin file.
  73.  
  74. See the example stt.tin file for example of how to use the parms.  The purpose
  75. of the cmd field is to execute a command after the terminal type has been set.
  76. For example, I utilize the kermit ttp and K95.  If I detect that I am logging
  77. in to a kermit terminal, I will call 'set_terminal_parameters -setup 132x42'
  78. to resize the terminal.
  79.