home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / archives / gould3.tar.gz / gould3.tar / kermit1 < prev    next >
Text File  |  2011-08-09  |  52KB  |  640 lines

  1. *     BASE -ULTLY-KERM -SFM-A2703 - 08/01/90  WJH     HEADER  SFMKERM   0001.000
  2. C        KERMIT1.F                                                      0001.100
  3.       INTEGER FUNCTION MATCH (TABLE, TABLEN, NELOK)                     0002.000
  4.            IMPLICIT NONE                                                0003.000
  5.            CHARACTER*(*) TABLE(*)  !table of commands                   0004.000
  6.            INTEGER       TABLEN    !number of elements                  0005.000
  7.            LOGICAL       NELOK                                          0006.000
  8. C                                                                       0007.000
  9. C= Decides which input came in, handles ? help                          0008.000
  10. C                                                                       0009.000
  11.       INCLUDE      K.KERMD                                              0010.000
  12.       INCLUDE      K.PROTC                                              0011.000
  13. C                                                                       0012.000
  14.       CHARACTER*40  WORD           !word to input                       0013.000
  15.       INTEGER       ASTR(41)       !ascii string                        0014.000
  16.       INTEGER      LEN             !length of word                      0015.000
  17.       INTEGER      T1, T2          !internal indexes                    0016.000
  18.       INTEGER      CHP             !character pointer                   0017.000
  19. C                                                                       0018.000
  20.       INTEGER      GETWORD         !get word from input                 0019.000
  21. C                                                                       0020.000
  22.       LEN = GETWORD(INPUTFD, ASTR, 40)                                  0021.000
  23.       IF (LEN .EQ. 0 .OR. LEN .EQ. EOF) THEN                            0022.000
  24.         MATCH = LEN                                                     0023.000
  25.         IF (LEN .EQ. 0 .AND. .NOT. NELOK) THEN                          0024.000
  26.           MATCH = ERROR                                                 0025.000
  27.           CALL PRINTL(STDOUT, '? Null switch or keyword given')         0026.000
  28.         ENDIF                                                           0027.000
  29.         RETURN                                                          0028.000
  30.       ENDIF                                                             0029.000
  31.       CALL AS2DPC(ASTR, WORD)                                           0030.000
  32. C                                                                       0031.000
  33. C begin matching                                                        0032.000
  34. C                                                                       0033.000
  35.       T1 = 1                                                            0034.000
  36.       T2 = TABLEN                                                       0035.000
  37.       CHP = 1                                                           0036.000
  38.       DO WHILE (CHP .LE. LEN)                                           0037.000
  39. C                                                                       0038.000
  40. C if we find a ?, the give the possiblities                             0039.000
  41. C                                                                       0040.000
  42.         IF (WORD(CHP:CHP) .EQ. '?') THEN                                0041.000
  43.           CALL PRINTL(STDOUT, 'One of the following:')                  0042.000
  44.           CALL OUTTBL(TABLE, T1, T2)                                    0043.000
  45.           MATCH = ERROR                                                 0044.000
  46.           RETURN                                                        0045.000
  47.         ENDIF                                                           0046.000
  48. C                                                                       0047.000
  49. C while word is less than lower table entry                             0048.000
  50. C                                                                       0049.000
  51.         DO WHILE (WORD(CHP:CHP) .GT. TABLE(T1)(CHP:CHP) .AND.           0050.000
  52.      $            T1 .LE. T2)                                           0051.000
  53.           T1 = T1 + 1                                                   0052.000
  54.         ENDDO                                                           0053.000
  55. C                                                                       0054.000
  56. C while word is greater than upper table entry                          0055.000
  57.         DO WHILE (WORD(CHP:CHP) .LT. TABLE(T2)(CHP:CHP) .AND.           0056.000
  58.      $           T2 .GE. T1)                                            0057.000
  59.           T2 = T2 - 1                                                   0058.000
  60.         ENDDO                                                           0059.000
  61. C                                                                       0060.000
  62. C if we know we have a mismatch                                         0061.000
  63. C                                                                       0062.000
  64.         IF (T2 .LT. T1) THEN                                            0063.000
  65.           CALL PRINTL(STDOUT, '? Does not match switch or keyword - '// 0064.000
  66.      $                WORD)                                             0065.000
  67.           MATCH = ERROR                                                 0066.000
  68.           RETURN                                                        0067.000
  69.         ENDIF                                                           0068.000
  70.         CHP = CHP + 1                                                   0069.000
  71.       ENDDO                                                             0070.000
  72. C                                                                       0071.000
  73. C after looking at the whole word, is it still ambiguous                0072.000
  74. C                                                                       0073.000
  75.       IF (T1 .NE. T2) THEN                                              0074.000
  76.         CALL PRINTL(STDOUT, '? Ambigious - '//WORD)                     0075.000
  77.         MATCH = ERROR                                                   0076.000
  78.       ELSE                                                              0077.000
  79.         MATCH = T1                                                      0078.000
  80.       ENDIF                                                             0079.000
  81.       RETURN                                                            0080.000
  82.       END                                                               0081.000
  83.       SUBROUTINE OUTTBL(TABLE, START, FIN)                              0082.000
  84.            IMPLICIT NONE                                                0083.000
  85.            CHARACTER*(*) TABLE (*)  !table to output                    0084.000
  86.            INTEGER  START          !start of table                      0085.000
  87.            INTEGER FIN             !end of table                        0086.000
  88. C                                                                       0087.000
  89. C= Outputs table in table format                                        0088.000
  90. C                                                                       0089.000
  91.       INCLUDE      K.KERMD                                              0090.000
  92. C                                                                       0091.000
  93.       INTEGER      ICOL            !column                              0092.000
  94.       CHARACTER*80 LINE            !output line                         0093.000
  95.       INTEGER      NCOLS           !number of columns                   0094.000
  96.       INTEGER      IPOS                                                 0095.000
  97.       INTEGER      I                                                    0096.000
  98.       INTEGER      COLWID          !width of column                     0097.000
  99.       INTEGER      NL              !last character in line              0098.000
  100.       INTEGER      LINECNT         !count of lines output               0099.000
  101. C                                                                       0100.000
  102.       INTEGER      LASTCHR         !last non-blank character in line    0101.000
  103.       LOGICAL      MORE            !continue on                         0102.000
  104.       INTRINSIC    LEN                                                  0102.100
  105. C                                                                       0103.000
  106.       LINECNT = 0                                                       0104.000
  107.       COLWID = LEN(TABLE) + 2                                           0105.000
  108.       NCOLS = 80 / COLWID                                               0106.000
  109.       LINE = ' '                                                        0107.000
  110.       ICOL = 1                                                          0108.000
  111.       DO I=START, FIN                                                   0109.000
  112.         IPOS = (ICOL - 1) * COLWID + 1                                  0110.000
  113.         LINE (IPOS:) = TABLE(I)                                         0111.000
  114.         ICOL = ICOL + 1                                                 0112.000
  115.         IF (ICOL .GT. NCOLS .OR. I .EQ. FIN) THEN                       0113.000
  116.           NL = LASTCHR(LINE)                                            0114.000
  117.           IF (NL .LE. 0) NL = 1                                         0115.000
  118.           LINECNT = LINECNT + 1                                         0116.000
  119.           IF (LINECNT .GE. 23) THEN                                     0117.000
  120.             IF (.NOT. MORE()) RETURN                                    0118.000
  121.             LINECNT = 0                                                 0119.000
  122.           ENDIF                                                         0120.000
  123.           CALL PRINTL(STDOUT, LINE(:NL))                                0121.000
  124.           LINE = ' '                                                    0122.000
  125.           ICOL = 1                                                      0123.000
  126.         ENDIF                                                           0124.000
  127.       ENDDO                                                             0125.000
  128.       RETURN                                                            0126.000
  129.       END                                                               0127.000
  130.       LOGICAL FUNCTION CONFIRM (FD)                                     0128.000
  131.            IMPLICIT NONE                                                0129.000
  132.            INTEGER    FD   !file device                                 0130.000
  133. C                                                                       0131.000
  134. C= Looks for a newline to confirm command                               0132.000
  135. C                                                                       0133.000
  136. C  Confirm will expect that the next token of input be a                0134.000
  137. C  newline for confirmation to be true.  If the next token              0135.000
  138. C  is a question mark, then confirmation is false and a                 0136.000
  139. C  "confirm with a carriage return" message will be displayed'          0137.000
  140. C  any other text will cause a 'not confirmed text message              0138.000
  141. C  to be displayed and confirm will return false                        0139.000
  142. C                                                                       0140.000
  143.       INCLUDE      K.KERMD                                              0141.000
  144. C                                                                       0142.000
  145.       INTEGER      CH              !character input                     0143.000
  146. C                                                                       0144.000
  147.       INTEGER      GETC            !get character                       0145.000
  148. C                                                                       0146.000
  149.       CONFIRM = .FALSE.                                                 0147.000
  150.  10   CONTINUE                                                          0148.000
  151.       IF (GETC(FD, CH) .EQ. NEL) THEN                                   0149.000
  152.         CONFIRM = .TRUE.                                                0150.000
  153.       ELSE IF (CH .EQ. EOF) THEN                                        0151.000
  154.         RETURN                                                          0152.000
  155.       ELSE IF (CH .EQ. BLANK .OR. CH .EQ. TAB) THEN                     0153.000
  156.         GOTO 10                                                         0154.000
  157.       ELSE IF (CH .EQ. QMARK) THEN                                      0155.000
  158.         CALL PRINTL(STDOUT, 'Confirm with a carriage return')           0156.000
  159.       ELSE                                                              0157.000
  160.         CALL PRINTL(STDOUT, '? Not confirmed - ')                       0158.000
  161.  20     CONTINUE                                                        0159.000
  162.         CALL PUTC(STDOUT, CH)                                           0160.000
  163.         CH = GETC(FD, CH)                                               0161.000
  164.         IF (CH .NE. NEL .AND. CH .NE. EOF) GOTO 20                      0162.000
  165.         CALL PUTC(STDOUT, NEL)                                          0163.000
  166.       ENDIF                                                             0164.000
  167.       RETURN                                                            0165.000
  168.       END                                                               0166.000
  169.       SUBROUTINE SETVAL(VAR, VTYP, MN1, MX1, MN2, MX2, HLPMSG,          0167.000
  170.      $                   CONFRM)                                        0168.000
  171.            IMPLICIT NONE                                                0169.000
  172.            INTEGER    VAR(41)  !string to fill                          0170.000
  173.            CHARACTER*1  VTYP    !type of input (s, i)                   0171.000
  174.            INTEGER      MN1     !error code         minimum value       0172.000
  175.            INTEGER      MX1     !length of string   maximum value       0173.000
  176.            INTEGER      MN2     !                   minimum value       0174.000
  177.            INTEGER      MX2     !                   maximum value       0175.000
  178.            CHARACTER*(*) HLPMSG    !help message to output              0176.000
  179.            LOGICAL      CONFRM     !must confirm                        0177.000
  180. C                                                                       0178.000
  181. C= Reads input of specified type within range of parameters for int.    0179.000
  182. C                                                                       0180.000
  183.       INCLUDE      K.KERMD                                              0181.000
  184.       INCLUDE      K.PROTC                                              0182.000
  185. C                                                                       0183.000
  186.       INTEGER      STR(41)         !input string                        0184.000
  187.       INTEGER      LEN                                                  0185.000
  188.       INTEGER      I                                                    0186.000
  189. C                                                                       0187.000
  190.       LOGICAL      CONFIRM         !confirm input                       0188.000
  191.       INTEGER      CTOI            !character to integer                0189.000
  192.       INTEGER      GETWORD         !get a word from input               0190.000
  193. C                                                                       0191.000
  194.       LEN = GETWORD(INPUTFD, STR, 40)                                   0192.000
  195.       IF (LEN .EQ. 0 .OR. LEN .EQ. EOF) THEN                            0193.000
  196.         IF (VTYP .EQ. 'I') THEN                                         0194.000
  197.           CALL PRINTL(STDOUT,'First nonspace character is not a digit') 0195.000
  198.         ELSE                                                            0196.000
  199.           CALL PRINTL(STDOUT,'Invalid, Missing parameter')              0197.000
  200.           MN1 = ERROR                                                   0198.000
  201.         ENDIF                                                           0199.000
  202.         RETURN                                                          0200.000
  203.       ENDIF                                                             0201.000
  204.       IF (STR(1) .EQ. QMARK) THEN                                       0202.000
  205.         CALL PRINTL(STDOUT, HLPMSG)                                     0203.000
  206.         CALL FLUSH(INPUTFD)                                             0204.000
  207.         IF (VTYP .EQ. 'S') MN1 = ERROR                                  0205.000
  208.         RETURN                                                          0206.000
  209.       ENDIF                                                             0207.000
  210. C                                                                       0208.000
  211. C confirm the request if necessary                                      0209.000
  212. C                                                                       0210.000
  213.       IF (CONFRM) THEN                                                  0211.000
  214.         IF (.NOT. CONFIRM(INPUTFD)) THEN                                0212.000
  215.           IF (VTYP .EQ. 'S') MN1 = ERROR                                0213.000
  216.           RETURN                                                        0214.000
  217.         ENDIF                                                           0215.000
  218.       ENDIF                                                             0216.000
  219. C                                                                       0217.000
  220. C go ahead and set variable                                             0218.000
  221. C                                                                       0219.000
  222.       IF (VTYP .EQ. 'I') THEN                                           0220.000
  223.         I = CTOI(STR)                                                   0221.000
  224.         IF (I .GE. MN1 .AND. I .LE. MX1) THEN                           0222.000
  225.           VAR(1) = I                                                    0223.000
  226.         ELSE IF (I .GE. MN2 .AND. I .LE. MX2) THEN                      0224.000
  227.           VAR(2) = I                                                    0225.000
  228.         ELSE                                                            0226.000
  229.           CALL PRINTL(STDOUT, '? Value is not within range of ')        0227.000
  230.           CALL PUTINT(STDOUT, MN1, 1)                                   0228.000
  231.           CALL PRINT(STDOUT, '-')                                       0229.000
  232.           CALL PUTINT(STDOUT, MX1, 1)                                   0230.000
  233.           CALL PRINT(STDOUT, ', or ')                                   0231.000
  234.           CALL PUTINT(STDOUT, MN2, 1)                                   0232.000
  235.           CALL PRINT(STDOUT, '-')                                       0233.000
  236.           CALL PUTINT(STDOUT, MX2, 1)                                   0234.000
  237.         ENDIF                                                           0235.000
  238.       ELSE                                                              0236.000
  239.         DO I=1, LEN                                                     0237.000
  240.           VAR(I) = STR(I)                                               0238.000
  241.         ENDDO                                                           0239.000
  242.         VAR(LEN+1) = 0                                                  0240.000
  243.         MN1 = OK                                                        0241.000
  244.       ENDIF                                                             0242.000
  245.       RETURN                                                            0243.000
  246.       END                                                               0244.000
  247.       SUBROUTINE HELP                                                   0245.000
  248.            IMPLICIT NONE                                                0246.000
  249. C                                                                       0247.000
  250. C= Prints help messages                                                 0248.000
  251. C                                                                       0249.000
  252.       INCLUDE      K.KERMV                                              0250.000
  253.       INCLUDE      K.KERMD                                              0251.000
  254. C                                                                       0252.000
  255.       INTEGER      MAXHLPS         ;PARAMETER   (MAXHLPS = 16)          0253.000
  256.       CHARACTER*10 HLPCMDS(MAXHLPS)                                     0254.000
  257.      $ /'BYE','CONNECT','EXIT','FINISH','GET','HELP','KERMIT','QUIT',   0255.000
  258.      $  'RECEIVE','SEND','SERVER','SET','SHOW','STATUS','TAKE','X'/     0256.000
  259. C                                                                       0257.000
  260. C help send                                                             0258.000
  261. C                                                                       0259.000
  262.       INTEGER      LMES10          ;PARAMETER (LMES10 = 5)              0260.000
  263.       CHARACTER*63 MES10  (LMES10)                                      0261.000
  264.      $ /' ' ,                                                           0262.000
  265.      $ 'SEND local-filename',                                           0263.000
  266.      $ ' ',                                                             0264.000
  267.      $ 'Sends file to remote KERMIT.',                                  0265.000
  268.      $ ' '/                                                             0266.000
  269. C                                                                       0267.000
  270. C help get                                                              0268.000
  271. C                                                                       0269.000
  272.       INTEGER      LMES20          ;PARAMETER (LMES20 = 5)              0270.000
  273.       CHARACTER*63 MES20 (LMES20)                                       0271.000
  274.      $ /' ',                                                            0272.000
  275.      $ 'GET remote-filename',                                           0273.000
  276.      $ ' ',                                                             0274.000
  277.      $ 'Tells a user Kermit to send a file.',                           0275.000
  278.      $ ' '/                                                             0276.000
  279. C                                                                       0277.000
  280. C help receive                                                          0278.000
  281. C                                                                       0279.000
  282.       INTEGER      LMES30          ;PARAMETER (LMES30 = 5)              0280.000
  283.       CHARACTER*63 MES30(LMES30)                                        0281.000
  284.      $ /' ',                                                            0282.000
  285.      $ 'RECEIVE',                                                       0283.000
  286.      $ ' ',                                                             0284.000
  287.      $ 'Expects one or more files to arrive.',                          0285.000
  288.      $ ' '/                                                             0286.000
  289. C                                                                       0287.000
  290. C help connect                                                          0288.000
  291. C                                                                       0289.000
  292.       INTEGER      LMES40          ;PARAMETER (LMES40 = 17)             0290.000
  293.       CHARACTER*63 MES40 (LMES40)                                       0291.000
  294.      $ /' ',                                                            0292.000
  295.      $ 'CONNECT',                                                       0293.000
  296.      $ ' ',                                                             0294.000
  297.      $ 'Enter terminal emulation mode; presents the illusion of',       0295.000
  298.      $ 'being directly connected as a terminal to the remote',          0296.000
  299.      $ 'system.  When escape character is typed, interprets next',      0297.000
  300.      $ 'character as follows:',                                         0298.000
  301.      $ '  0        (zero) Transmits a NUL',                             0299.000
  302.      $ '  B        Transmits a BREAK',                                  0300.000
  303.      $ '  C        Close a connection, return to local KERMIT',         0301.000
  304.      $ '  Q        Quit logging (if logging is being done)',            0302.000
  305.      $ '  R        Resume logging',                                     0303.000
  306.      $ '  ?        Show available arguments to the escape character',   0304.000
  307.      $ '  (escape character again):  Transmit the escape character',    0305.000
  308.      $ '           itself',                                             0306.000
  309.      $ 'Invalid arguements are beeped and reenters connect mode.',      0307.000
  310.      $ ' '/                                                             0308.000
  311. C                                                                       0309.000
  312. C help kermit                                                           0310.000
  313. C                                                                       0311.000
  314.       INTEGER      LMES50          ;PARAMETER (LMES50 = 19)             0312.000
  315.       CHARACTER*63 MES50(LMES50)                                        0313.000
  316.      $ /' ',                                                            0314.000
  317.      $ 'Kermit is a file transfer protocol for use over an',            0315.000
  318.      $ 'asynchronous serial telecommunication line.  Files are',        0316.000
  319.      $ 'broken up into ""packets"" with checksums and other control',   0317.000
  320.      $ 'information to ensure (with high probability) error-free',      0318.000
  321.      $ 'and complete transmission.',                                    0319.000
  322.      $ ' ',                                                             0320.000
  323.      $ 'This implementation of Kermit is for the GOULD 32-77    ',      0321.000
  324.      $ 'computers using the MPX 1.5E operating system. It may ',        0322.000
  325.      $ 'be run remotely using a PC that can run as a         ',         0323.000
  326.      $ 'terminal emulator',                                             0324.000
  327.      $ ' ',                                                             0325.000
  328.      $ 'Commands Implemented are: SERVER, RECEIVE, EXIT, X, QUIT,',     0326.000
  329.      $ '               HELP, SET, SHOW, STATUS',                        0327.000
  330.      $ ' ',                                                             0328.000
  331.      $ 'For further information, type ""HELP"" for any of the above',   0329.000
  332.      $ 'e.g.  ""HELP RECEIVE"" or see the Kermit Users Guide and',      0330.000
  333.      $ 'Kermit Protocol manual.',                                       0331.000
  334.      $ ' '/                                                             0332.000
  335. C                                                                       0333.000
  336. C help exit, quit, x                                                    0334.000
  337. C                                                                       0335.000
  338.       INTEGER      LMES60          ;PARAMETER (LMES60 = 3)              0336.000
  339.       CHARACTER*63 MES60  (LMES60)                                      0337.000
  340.      $ /' ',                                                            0338.000
  341.      $  'Exit from Kermit.',                                            0339.000
  342.      $  ' '/                                                            0340.000
  343. C                                                                       0341.000
  344. C help take                                                             0342.000
  345. C                                                                       0343.000
  346.       INTEGER      LMES70          ;PARAMETER (LMES70 = 5)              0344.000
  347.       CHARACTER*63 MES70 (LMES70)                                       0345.000
  348.      $ /' ',                                                            0346.000
  349.      $ 'TAKE local-filename',                                           0347.000
  350.      $ ' ',                                                             0348.000
  351.      $ 'Read and execute Kermit commands from a local file.',           0349.000
  352.      $ ' '/                                                             0350.000
  353. C                                                                       0351.000
  354. C help server                                                           0352.000
  355. C                                                                       0353.000
  356.       INTEGER      LMES90          ;PARAMETER (LMES90=16)               0354.000
  357.       CHARACTER*63 MES90 (LMES90)                                       0355.000
  358.      $ /' ',                                                            0356.000
  359.      $ 'SERVER',                                                        0357.000
  360.      $ ' ',                                                             0358.000
  361.      $ 'Act as a server for another Kermit.  Take all further',         0359.000
  362.      $ 'commands only from the other Kermit.  After issuing',           0360.000
  363.      $ 'this command, escape back to your local system and issue',      0361.000
  364.      $ 'SEND or GET, FINISH, LOG OUT, or other server-oriented',        0362.000
  365.      $ 'commands from there.  If your local Kermit does not have',      0363.000
  366.      $ 'a BYE or FINISH command, it does not have the full ability to', 0364.000
  367.      $ 'communicate with a Kermit server (in which case you can',       0365.000
  368.      $ 'only use the SEND command).  If your local Kermit does',        0366.000
  369.      $ 'have a BYE command, use it to shut down and log out',           0367.000
  370.      $ 'the Kermit server when you are done with it; otherwise,',       0368.000
  371.      $ 'connect back to the Gould, type several Control-C''s to',       0369.000
  372.      $ 'stop the server, and logout.',                                  0370.000
  373.      $ ' '/                                                             0371.000
  374. C                                                                       0372.000
  375. C help set                                                              0373.000
  376. C                                                                       0374.000
  377.       INTEGER      LMES100         ;PARAMETER (LMES100=122)             0375.000
  378.       CHARACTER*63 MES100(LMES100)                                      0376.000
  379.      $/' ',                                                             0377.000
  380.      $ 'SET',                                                           0378.000
  381.      $ ' ',                                                             0379.000
  382.      $ '  Establish system-dependent parameters.  You can examine',     0380.000
  383.      $ 'their values with the SHOW command.  Numeric values may be',    0381.000
  384.      $ 'decimal, octal (postfixed with a O), or hexadecimal (post-',    0382.000
  385.      $ 'fixed with an H).  The following may be SET:',                  0383.000
  386.      $ ' ',                                                             0384.000
  387.      $ ' DEBUG options',                                                0385.000
  388.      $ '   Show packet traffic explicitly.  Options are:',              0386.000
  389.      $ '   ALL      Set all debug options.',                            0387.000
  390.      $ '   LOG-FILE Log states and packets to the specified file.',     0388.000
  391.      $ '            The default log-file is file L.KERMLOG',            0389.000
  392.      $ '   OFF      Don''t display debugging information. (this is',    0390.000
  393.      $ '            the default).  If debugging was in effect, turn',   0391.000
  394.      $ '            it off and close any log file.',                    0392.000
  395.      $ '   PACKETS  Display each incoming and outgoing packet',         0393.000
  396.      $ '            (lengthy)',                                         0394.000
  397.      $ '   STATES   Show kermit state transitions and packet numbers',  0395.000
  398.      $ '            (brief).',                                          0396.000
  399.      $ ' ',                                                             0397.000
  400.      $ ' LOG options',                                                  0398.000
  401.      $ '   Log all inputs from remote port during connection.',         0399.000
  402.      $ '   Options are:',                                               0400.000
  403.      $ '   LOG-FILE Log inputs to specified file.  The default',        0401.000
  404.      $ '            log-file is file L.SESSION',                        0402.000
  405.      $ '   OFF      Turn off the session logging',                      0403.000
  406.      $ '   ON       Turn on the session logging',                       0404.000
  407.      $ ' ',                                                             0405.000
  408.      $ ' PORT terminal-address',                                        0406.000
  409.      $ '   Sets the communicaton port; to which connect, send,',        0407.000
  410.      $ '   receive and server interact with.  Any MPX terminal ',       0408.000
  411.      $ '   address may be used.  Examples: TY7EC0, U17CC4, or UT.',     0409.000
  412.      $ '   Default is UT',                                              0410.000
  413.      $ ' ',                                                             0411.000
  414.      $ ' ESCAPE decimal-number',                                        0412.000
  415.      $ '   Control character used to escape from connect mode.',        0413.000
  416.      $ '   Default is 29, (^])',                                        0414.000
  417.      $ ' ',                                                             0415.000
  418.      $ ' ECHO on/off',                                                  0416.000
  419.      $ '   Turns on or off the echo by kermit during connect mode.',    0417.000
  420.      $ ' ',                                                             0418.000
  421.      $ ' DELAY decimal-number',                                         0419.000
  422.      $ '   How many seconds to wait before sending the first',          0420.000
  423.      $ '   packet.  This gives you time to ""escape"" back and',        0421.000
  424.      $ '   issue a RECEIVE command.',                                   0422.000
  425.      $ ' ',                                                             0423.000
  426.      $ ' INIT-RETRY decimal-number',                                    0424.000
  427.      $ '   Set the maximum number of retries allowed for the',          0425.000
  428.      $ '   initial connection before giving up.',                       0426.000
  429.      $ ' ',                                                             0427.000
  430.      $ ' RETRY decimal-number',                                         0428.000
  431.      $ '   Set the maximum number of retries allowed for sending',      0429.000
  432.      $ '   a particular packet.',                                       0430.000
  433.      $ ' ',                                                             0431.000
  434.      $ ' SEND parameter',                                               0432.000
  435.      $ '   Parameters for outgoing packets as follows:',                0433.000
  436.      $ ' ',                                                             0434.000
  437.      $ '   EOLCHR  octal-number',                                       0435.000
  438.      $ '     The octal value of the ASCII character to be used',        0436.000
  439.      $ '     as a line terminator for packets, if one is required',     0437.000
  440.      $ '     by the other system.  Carriage return (15B) by default.',  0438.000
  441.      $ ' ',                                                             0439.000
  442.      $ '   PACKLEN decimal-number',                                     0440.000
  443.      $ '     Maximum packet length to send, decimal number, between',   0441.000
  444.      $ '     20 and 1000, 1000 by default.',                            0442.000
  445.      $ ' ',                                                             0443.000
  446.      $ '   PADCHR octal-number',                                        0444.000
  447.      $ '     Character to use for padding.  Default is NUL.',           0445.000
  448.      $ ' ',                                                             0446.000
  449.      $ '   PADLEN decimal-number',                                      0447.000
  450.      $ '     How much padding to send before a packet.  Default',       0448.000
  451.      $ '     is no padding.',                                           0449.000
  452.      $ ' ',                                                             0450.000
  453.      $ '   QUOTECHR octal-number',                                      0451.000
  454.      $ '     What printable character to use for quoting of control',   0452.000
  455.      $ '     characters.  The default is ''#'' (43B).  There should',   0453.000
  456.      $ '     be no reason to change this.',                             0454.000
  457.      $ ' ',                                                             0455.000
  458.      $ '   SYNCCHR octal-number',                                       0456.000
  459.      $ '     The control character that marks the beginning of the',    0457.000
  460.      $ '     packet.  Normally SOH (Control-A, ASCII 1).  There',       0458.000
  461.      $ '     should be no reason to change this.',                      0459.000
  462.      $ ' ',                                                             0460.000
  463.      $ '   TIMEOUT decimal-number',                                     0461.000
  464.      $ '     How many seconds the other Kermit wants before being',     0462.000
  465.      $ '     asked for retransmission.',                                0463.000
  466.      $ ' ',                                                             0464.000
  467.      $ ' RECEIVE parameter',                                            0465.000
  468.      $ '   Parameters to request or expect for incoming packets,',      0466.000
  469.      $ '   as follows:',                                                0467.000
  470.      $ ' ',                                                             0468.000
  471.      $ '   EOLCHR  octal-number',                                       0469.000
  472.      $ '     The octal value of the ASCII character to be used',        0470.000
  473.      $ '     as a line terminator for packets, if one is required',     0471.000
  474.      $ '     by the other system.  Carriage return (15B) by default.',  0472.000
  475.      $ ' ',                                                             0473.000
  476.      $ '   PACKLEN decimal-number',                                     0474.000
  477.      $ '     Maximum packet length to send, decimal number, between',   0475.000
  478.      $ '     20 and 1000, 1000 by default.',                            0476.000
  479.      $ ' ',                                                             0477.000
  480.      $ '   PADCHR octal-number',                                        0478.000
  481.      $ '     Character to use for padding.  Default is NUL.',           0479.000
  482.      $ ' ',                                                             0480.000
  483.      $ '   PADLEN decimal-number',                                      0481.000
  484.      $ '     How much padding to send before a packet.  Default',       0482.000
  485.      $ '     is no padding.',                                           0483.000
  486.      $ ' ',                                                             0484.000
  487.      $ '   QUOTECHR octal-number',                                      0485.000
  488.      $ '     What printable character to use for quoting of control',   0486.000
  489.      $ '     characters.  The default is ''#'' (43B).  There should',   0487.000
  490.      $ '     be no reason to change this.',                             0488.000
  491.      $ ' ',                                                             0489.000
  492.      $ '   SYNCCHR octal-number',                                       0490.000
  493.      $ '     The control character that marks the beginning of the',    0491.000
  494.      $ '     packet.  Normally SOH (Control-A, ASCII 1).  There',       0492.000
  495.      $ '     should be no reason to change this.',                      0493.000
  496.      $ ' ',                                                             0494.000
  497.      $ '   TIMEOUT decimal-number',                                     0495.000
  498.      $ '     How many seconds the other Kermit wants before being',     0496.000
  499.      $ '     asked for retransmission.',                                0497.000
  500.      $ ' '/                                                             0498.000
  501. C                                                                       0499.000
  502. C help show                                                             0500.000
  503. C                                                                       0501.000
  504.       INTEGER LMES110              ;PARAMETER (LMES110= 4 )             0502.000
  505.       CHARACTER*63 MES110(LMES110) !show help                           0503.000
  506.      $/' ',                                                             0504.000
  507.      $ 'Display current SET parameters, version of Kermit, and',        0505.000
  508.      $ 'other info.',                                                   0506.000
  509.      $ ' '/                                                             0507.000
  510. C                                                                       0508.000
  511. C help status                                                           0509.000
  512. C                                                                       0510.000
  513.       INTEGER      LMES120         ;PARAMETER (LMES120= 3)              0511.000
  514.       CHARACTER*63 MES120(LMES120)                                      0512.000
  515.      $/' ',                                                             0513.000
  516.      $ 'Give statistics about the most recent file transfer.',          0514.000
  517.      $ ' '/                                                             0515.000
  518. C                                                                       0516.000
  519. C help help                                                             0517.000
  520. C                                                                       0518.000
  521.       INTEGER      LMES130         ;PARAMETER (LMES130=16)              0519.000
  522.       CHARACTER*63 MES130 (LMES130)                                     0520.000
  523.      $/' ',                                                             0521.000
  524.      $ 'HELP [topic]',                                                  0522.000
  525.      $ ' ',                                                             0523.000
  526.      $ 'Typing HELP alone prints a brief summary of Kermit',            0524.000
  527.      $ 'and its commands.  You can also type',                          0525.000
  528.      $ ' ',                                                             0526.000
  529.      $ '   HELP command',                                               0527.000
  530.      $ ' ',                                                             0528.000
  531.      $ 'for any Kermit command, e.g. ""HELP SEND"", to get more',       0529.000
  532.      $ 'detailed information about a specific command.  Type',          0530.000
  533.      $ ' ',                                                             0531.000
  534.      $ '   HELP ?',                                                     0532.000
  535.      $ ' ',                                                             0533.000
  536.      $ 'to see a list of all the available help commands, or',          0534.000
  537.      $ 'consult the Kermit Users Guide.',                               0535.000
  538.      $ ' '/                                                             0536.000
  539.       INTEGER      LMES140         ;PARAMETER (LMES140 =  6 )           0537.000
  540.       CHARACTER*63 MES140(LMES140)                                      0538.000
  541.      $ /' ',                                                            0539.000
  542.      $  'BYE',                                                          0540.000
  543.      $ ' ',                                                             0541.000
  544.      $ 'This command sends a message to the remote server to log',      0542.000
  545.      $ 'itself out',                                                    0543.000
  546.      $ ' '/                                                             0544.000
  547.       INTEGER      LMES150         ;PARAMETER (LMES150 =  6 )           0545.000
  548.       CHARACTER*63 MES150 (LMES150)                                     0546.000
  549.      $/' ',                                                             0547.000
  550.      $ 'FINISH',                                                        0548.000
  551.      $ ' ',                                                             0549.000
  552.      $ 'This command causes the remote server to shut itself down',     0550.000
  553.      $ 'leaving the local KERMIT at KERMIT command level.',             0551.000
  554.      $ ' '/                                                             0552.000
  555.       INTEGER      LMES160         ;PARAMETER (LMES160 =3 )             0553.000
  556.       CHARACTER*63 MES160 (LMES160)                                     0554.000
  557.      $/' ',                                                             0555.000
  558.      $ 'This command is cannot be used on this version of KERMIT.',     0556.000
  559.      $ ' '/                                                             0557.000
  560.       INTEGER      IDX             !index of code                       0558.000
  561. C                                                                       0559.000
  562.       INTEGER      MATCH           !command parser                      0560.000
  563. C                                                                       0561.000
  564.       IDX = MATCH(HLPCMDS,MAXHLPS,.TRUE.)                               0562.000
  565.       IF (IDX .EQ. EOF .OR. IDX .EQ. ERROR) RETURN                      0563.000
  566.       IF (IDX .EQ. 0) GOTO 50                                           0564.000
  567.       GOTO ( 140,40, 60, 150,20, 130, 50, 60, 30, 10, 90,               0565.000
  568.      $      100, 110, 120, 70, 60) IDX                                  0566.000
  569.  10   CONTINUE                     !send                                0567.000
  570.         CALL OUTTBL(MES10, 1, LMES10)                                   0568.000
  571.         GOTO 200                                                        0569.000
  572.  20   CONTINUE                     !get                                 0570.000
  573.         IF (.NOT. LOCALON) GOTO 160                                     0571.000
  574.         CALL OUTTBL(MES20, 1, LMES20)                                   0572.000
  575.         GOTO 200                                                        0573.000
  576.  30   CONTINUE                     !receive                             0574.000
  577.         CALL OUTTBL(MES30, 1, LMES30)                                   0575.000
  578.         GOTO 200                                                        0576.000
  579.  40   CONTINUE                     !connect                             0577.000
  580.         IF (.NOT. LOCALON) GOTO 160                                     0578.000
  581.         CALL OUTTBL(MES40, 1, LMES40)                                   0579.000
  582.         GOTO 200                                                        0580.000
  583.  50   CONTINUE                     !kermit                              0581.000
  584.         CALL OUTTBL(MES50, 1, LMES50)                                   0582.000
  585.         GOTO 200                                                        0583.000
  586.  60   CONTINUE                     !exit                                0584.000
  587.         CALL OUTTBL(MES60, 1, LMES60)                                   0585.000
  588.         GOTO 200                                                        0586.000
  589.  70   CONTINUE                     !take                                0587.000
  590.         CALL OUTTBL(MES70, 1, LMES70)                                   0588.000
  591.         GOTO 200                                                        0589.000
  592.  90   CONTINUE                     !server                              0590.000
  593.         CALL OUTTBL(MES90, 1, LMES90)                                   0591.000
  594.         GOTO 200                                                        0592.000
  595.  100  CONTINUE                     !set                                 0593.000
  596.         CALL OUTTBL(MES100, 1, LMES100)                                 0594.000
  597.         GOTO 200                                                        0595.000
  598.  110  CONTINUE                     !show                                0596.000
  599.         CALL OUTTBL(MES110, 1, LMES110)                                 0597.000
  600.         GOTO 200                                                        0598.000
  601.  120  CONTINUE                     !status                              0599.000
  602.         CALL OUTTBL(MES120, 1, LMES120)                                 0600.000
  603.         GOTO 200                                                        0601.000
  604.  130  CONTINUE                     !help                                0602.000
  605.         CALL OUTTBL(MES130, 1, LMES130)                                 0603.000
  606.         GOTO 200                                                        0604.000
  607.  140  CONTINUE                     !bye                                 0605.000
  608.         IF (.NOT. LOCALON) GOTO 160                                     0606.000
  609.         CALL OUTTBL(MES140, 1, LMES140)                                 0607.000
  610.         GOTO 200                                                        0608.000
  611.  150  CONTINUE                     !finish                              0609.000
  612.         IF (.NOT. LOCALON) GOTO 160                                     0610.000
  613.         CALL OUTTBL(MES150, 1, LMES150)                                 0611.000
  614.         GOTO 200                                                        0612.000
  615.  160  CONTINUE                     !no local                            0613.000
  616.         CALL OUTTBL(MES160, 1, LMES160)                                 0614.000
  617.         GOTO 200                                                        0615.000
  618.  200  CONTINUE                                                          0616.000
  619.       RETURN                                                            0617.000
  620.       END                                                               0618.000
  621.       LOGICAL FUNCTION MORE()                                           0619.000
  622.            IMPLICIT NONE                                                0620.000
  623. C                                                                       0621.000
  624. C= Returns true if continue, else false                                 0622.000
  625. C                                                                       0623.000
  626.       INCLUDE      K.KERMD                                              0624.000
  627. C                                                                       0625.000
  628.       INTEGER      INCHR                                                0626.000
  629. C                                                                       0627.000
  630.       INTEGER      GETC                                                 0628.000
  631.       LOGICAL      MORE                                                 0628.100
  632. C                                                                       0629.000
  633.       CALL FLUSH(STDIN)                                                 0630.000
  634.       CALL STTY(STDIN, 'READSIZE', 1)                                   0631.000
  635.       CALL PRINTL(STDOUT, 'Enter CR for more')                          0632.000
  636.       MORE = GETC(STDIN, INCHR) .EQ. NEL                                0633.000
  637.       CALL STTY(STDIN, 'READSIZE', 80)                                  0634.000
  638.       RETURN                                                            0635.000
  639.       END                                                               0636.000
  640.