* BASE -ULTLY-KERM -SFM-A2703 - 08/01/90 WJH HEADER SFMKERM 0001.000 C KERMIT1.F 0001.100 INTEGER FUNCTION MATCH (TABLE, TABLEN, NELOK) 0002.000 IMPLICIT NONE 0003.000 CHARACTER*(*) TABLE(*) !table of commands 0004.000 INTEGER TABLEN !number of elements 0005.000 LOGICAL NELOK 0006.000 C 0007.000 C= Decides which input came in, handles ? help 0008.000 C 0009.000 INCLUDE K.KERMD 0010.000 INCLUDE K.PROTC 0011.000 C 0012.000 CHARACTER*40 WORD !word to input 0013.000 INTEGER ASTR(41) !ascii string 0014.000 INTEGER LEN !length of word 0015.000 INTEGER T1, T2 !internal indexes 0016.000 INTEGER CHP !character pointer 0017.000 C 0018.000 INTEGER GETWORD !get word from input 0019.000 C 0020.000 LEN = GETWORD(INPUTFD, ASTR, 40) 0021.000 IF (LEN .EQ. 0 .OR. LEN .EQ. EOF) THEN 0022.000 MATCH = LEN 0023.000 IF (LEN .EQ. 0 .AND. .NOT. NELOK) THEN 0024.000 MATCH = ERROR 0025.000 CALL PRINTL(STDOUT, '? Null switch or keyword given') 0026.000 ENDIF 0027.000 RETURN 0028.000 ENDIF 0029.000 CALL AS2DPC(ASTR, WORD) 0030.000 C 0031.000 C begin matching 0032.000 C 0033.000 T1 = 1 0034.000 T2 = TABLEN 0035.000 CHP = 1 0036.000 DO WHILE (CHP .LE. LEN) 0037.000 C 0038.000 C if we find a ?, the give the possiblities 0039.000 C 0040.000 IF (WORD(CHP:CHP) .EQ. '?') THEN 0041.000 CALL PRINTL(STDOUT, 'One of the following:') 0042.000 CALL OUTTBL(TABLE, T1, T2) 0043.000 MATCH = ERROR 0044.000 RETURN 0045.000 ENDIF 0046.000 C 0047.000 C while word is less than lower table entry 0048.000 C 0049.000 DO WHILE (WORD(CHP:CHP) .GT. TABLE(T1)(CHP:CHP) .AND. 0050.000 $ T1 .LE. T2) 0051.000 T1 = T1 + 1 0052.000 ENDDO 0053.000 C 0054.000 C while word is greater than upper table entry 0055.000 DO WHILE (WORD(CHP:CHP) .LT. TABLE(T2)(CHP:CHP) .AND. 0056.000 $ T2 .GE. T1) 0057.000 T2 = T2 - 1 0058.000 ENDDO 0059.000 C 0060.000 C if we know we have a mismatch 0061.000 C 0062.000 IF (T2 .LT. T1) THEN 0063.000 CALL PRINTL(STDOUT, '? Does not match switch or keyword - '// 0064.000 $ WORD) 0065.000 MATCH = ERROR 0066.000 RETURN 0067.000 ENDIF 0068.000 CHP = CHP + 1 0069.000 ENDDO 0070.000 C 0071.000 C after looking at the whole word, is it still ambiguous 0072.000 C 0073.000 IF (T1 .NE. T2) THEN 0074.000 CALL PRINTL(STDOUT, '? Ambigious - '//WORD) 0075.000 MATCH = ERROR 0076.000 ELSE 0077.000 MATCH = T1 0078.000 ENDIF 0079.000 RETURN 0080.000 END 0081.000 SUBROUTINE OUTTBL(TABLE, START, FIN) 0082.000 IMPLICIT NONE 0083.000 CHARACTER*(*) TABLE (*) !table to output 0084.000 INTEGER START !start of table 0085.000 INTEGER FIN !end of table 0086.000 C 0087.000 C= Outputs table in table format 0088.000 C 0089.000 INCLUDE K.KERMD 0090.000 C 0091.000 INTEGER ICOL !column 0092.000 CHARACTER*80 LINE !output line 0093.000 INTEGER NCOLS !number of columns 0094.000 INTEGER IPOS 0095.000 INTEGER I 0096.000 INTEGER COLWID !width of column 0097.000 INTEGER NL !last character in line 0098.000 INTEGER LINECNT !count of lines output 0099.000 C 0100.000 INTEGER LASTCHR !last non-blank character in line 0101.000 LOGICAL MORE !continue on 0102.000 INTRINSIC LEN 0102.100 C 0103.000 LINECNT = 0 0104.000 COLWID = LEN(TABLE) + 2 0105.000 NCOLS = 80 / COLWID 0106.000 LINE = ' ' 0107.000 ICOL = 1 0108.000 DO I=START, FIN 0109.000 IPOS = (ICOL - 1) * COLWID + 1 0110.000 LINE (IPOS:) = TABLE(I) 0111.000 ICOL = ICOL + 1 0112.000 IF (ICOL .GT. NCOLS .OR. I .EQ. FIN) THEN 0113.000 NL = LASTCHR(LINE) 0114.000 IF (NL .LE. 0) NL = 1 0115.000 LINECNT = LINECNT + 1 0116.000 IF (LINECNT .GE. 23) THEN 0117.000 IF (.NOT. MORE()) RETURN 0118.000 LINECNT = 0 0119.000 ENDIF 0120.000 CALL PRINTL(STDOUT, LINE(:NL)) 0121.000 LINE = ' ' 0122.000 ICOL = 1 0123.000 ENDIF 0124.000 ENDDO 0125.000 RETURN 0126.000 END 0127.000 LOGICAL FUNCTION CONFIRM (FD) 0128.000 IMPLICIT NONE 0129.000 INTEGER FD !file device 0130.000 C 0131.000 C= Looks for a newline to confirm command 0132.000 C 0133.000 C Confirm will expect that the next token of input be a 0134.000 C newline for confirmation to be true. If the next token 0135.000 C is a question mark, then confirmation is false and a 0136.000 C "confirm with a carriage return" message will be displayed' 0137.000 C any other text will cause a 'not confirmed text message 0138.000 C to be displayed and confirm will return false 0139.000 C 0140.000 INCLUDE K.KERMD 0141.000 C 0142.000 INTEGER CH !character input 0143.000 C 0144.000 INTEGER GETC !get character 0145.000 C 0146.000 CONFIRM = .FALSE. 0147.000 10 CONTINUE 0148.000 IF (GETC(FD, CH) .EQ. NEL) THEN 0149.000 CONFIRM = .TRUE. 0150.000 ELSE IF (CH .EQ. EOF) THEN 0151.000 RETURN 0152.000 ELSE IF (CH .EQ. BLANK .OR. CH .EQ. TAB) THEN 0153.000 GOTO 10 0154.000 ELSE IF (CH .EQ. QMARK) THEN 0155.000 CALL PRINTL(STDOUT, 'Confirm with a carriage return') 0156.000 ELSE 0157.000 CALL PRINTL(STDOUT, '? Not confirmed - ') 0158.000 20 CONTINUE 0159.000 CALL PUTC(STDOUT, CH) 0160.000 CH = GETC(FD, CH) 0161.000 IF (CH .NE. NEL .AND. CH .NE. EOF) GOTO 20 0162.000 CALL PUTC(STDOUT, NEL) 0163.000 ENDIF 0164.000 RETURN 0165.000 END 0166.000 SUBROUTINE SETVAL(VAR, VTYP, MN1, MX1, MN2, MX2, HLPMSG, 0167.000 $ CONFRM) 0168.000 IMPLICIT NONE 0169.000 INTEGER VAR(41) !string to fill 0170.000 CHARACTER*1 VTYP !type of input (s, i) 0171.000 INTEGER MN1 !error code minimum value 0172.000 INTEGER MX1 !length of string maximum value 0173.000 INTEGER MN2 ! minimum value 0174.000 INTEGER MX2 ! maximum value 0175.000 CHARACTER*(*) HLPMSG !help message to output 0176.000 LOGICAL CONFRM !must confirm 0177.000 C 0178.000 C= Reads input of specified type within range of parameters for int. 0179.000 C 0180.000 INCLUDE K.KERMD 0181.000 INCLUDE K.PROTC 0182.000 C 0183.000 INTEGER STR(41) !input string 0184.000 INTEGER LEN 0185.000 INTEGER I 0186.000 C 0187.000 LOGICAL CONFIRM !confirm input 0188.000 INTEGER CTOI !character to integer 0189.000 INTEGER GETWORD !get a word from input 0190.000 C 0191.000 LEN = GETWORD(INPUTFD, STR, 40) 0192.000 IF (LEN .EQ. 0 .OR. LEN .EQ. EOF) THEN 0193.000 IF (VTYP .EQ. 'I') THEN 0194.000 CALL PRINTL(STDOUT,'First nonspace character is not a digit') 0195.000 ELSE 0196.000 CALL PRINTL(STDOUT,'Invalid, Missing parameter') 0197.000 MN1 = ERROR 0198.000 ENDIF 0199.000 RETURN 0200.000 ENDIF 0201.000 IF (STR(1) .EQ. QMARK) THEN 0202.000 CALL PRINTL(STDOUT, HLPMSG) 0203.000 CALL FLUSH(INPUTFD) 0204.000 IF (VTYP .EQ. 'S') MN1 = ERROR 0205.000 RETURN 0206.000 ENDIF 0207.000 C 0208.000 C confirm the request if necessary 0209.000 C 0210.000 IF (CONFRM) THEN 0211.000 IF (.NOT. CONFIRM(INPUTFD)) THEN 0212.000 IF (VTYP .EQ. 'S') MN1 = ERROR 0213.000 RETURN 0214.000 ENDIF 0215.000 ENDIF 0216.000 C 0217.000 C go ahead and set variable 0218.000 C 0219.000 IF (VTYP .EQ. 'I') THEN 0220.000 I = CTOI(STR) 0221.000 IF (I .GE. MN1 .AND. I .LE. MX1) THEN 0222.000 VAR(1) = I 0223.000 ELSE IF (I .GE. MN2 .AND. I .LE. MX2) THEN 0224.000 VAR(2) = I 0225.000 ELSE 0226.000 CALL PRINTL(STDOUT, '? Value is not within range of ') 0227.000 CALL PUTINT(STDOUT, MN1, 1) 0228.000 CALL PRINT(STDOUT, '-') 0229.000 CALL PUTINT(STDOUT, MX1, 1) 0230.000 CALL PRINT(STDOUT, ', or ') 0231.000 CALL PUTINT(STDOUT, MN2, 1) 0232.000 CALL PRINT(STDOUT, '-') 0233.000 CALL PUTINT(STDOUT, MX2, 1) 0234.000 ENDIF 0235.000 ELSE 0236.000 DO I=1, LEN 0237.000 VAR(I) = STR(I) 0238.000 ENDDO 0239.000 VAR(LEN+1) = 0 0240.000 MN1 = OK 0241.000 ENDIF 0242.000 RETURN 0243.000 END 0244.000 SUBROUTINE HELP 0245.000 IMPLICIT NONE 0246.000 C 0247.000 C= Prints help messages 0248.000 C 0249.000 INCLUDE K.KERMV 0250.000 INCLUDE K.KERMD 0251.000 C 0252.000 INTEGER MAXHLPS ;PARAMETER (MAXHLPS = 16) 0253.000 CHARACTER*10 HLPCMDS(MAXHLPS) 0254.000 $ /'BYE','CONNECT','EXIT','FINISH','GET','HELP','KERMIT','QUIT', 0255.000 $ 'RECEIVE','SEND','SERVER','SET','SHOW','STATUS','TAKE','X'/ 0256.000 C 0257.000 C help send 0258.000 C 0259.000 INTEGER LMES10 ;PARAMETER (LMES10 = 5) 0260.000 CHARACTER*63 MES10 (LMES10) 0261.000 $ /' ' , 0262.000 $ 'SEND local-filename', 0263.000 $ ' ', 0264.000 $ 'Sends file to remote KERMIT.', 0265.000 $ ' '/ 0266.000 C 0267.000 C help get 0268.000 C 0269.000 INTEGER LMES20 ;PARAMETER (LMES20 = 5) 0270.000 CHARACTER*63 MES20 (LMES20) 0271.000 $ /' ', 0272.000 $ 'GET remote-filename', 0273.000 $ ' ', 0274.000 $ 'Tells a user Kermit to send a file.', 0275.000 $ ' '/ 0276.000 C 0277.000 C help receive 0278.000 C 0279.000 INTEGER LMES30 ;PARAMETER (LMES30 = 5) 0280.000 CHARACTER*63 MES30(LMES30) 0281.000 $ /' ', 0282.000 $ 'RECEIVE', 0283.000 $ ' ', 0284.000 $ 'Expects one or more files to arrive.', 0285.000 $ ' '/ 0286.000 C 0287.000 C help connect 0288.000 C 0289.000 INTEGER LMES40 ;PARAMETER (LMES40 = 17) 0290.000 CHARACTER*63 MES40 (LMES40) 0291.000 $ /' ', 0292.000 $ 'CONNECT', 0293.000 $ ' ', 0294.000 $ 'Enter terminal emulation mode; presents the illusion of', 0295.000 $ 'being directly connected as a terminal to the remote', 0296.000 $ 'system. When escape character is typed, interprets next', 0297.000 $ 'character as follows:', 0298.000 $ ' 0 (zero) Transmits a NUL', 0299.000 $ ' B Transmits a BREAK', 0300.000 $ ' C Close a connection, return to local KERMIT', 0301.000 $ ' Q Quit logging (if logging is being done)', 0302.000 $ ' R Resume logging', 0303.000 $ ' ? Show available arguments to the escape character', 0304.000 $ ' (escape character again): Transmit the escape character', 0305.000 $ ' itself', 0306.000 $ 'Invalid arguements are beeped and reenters connect mode.', 0307.000 $ ' '/ 0308.000 C 0309.000 C help kermit 0310.000 C 0311.000 INTEGER LMES50 ;PARAMETER (LMES50 = 19) 0312.000 CHARACTER*63 MES50(LMES50) 0313.000 $ /' ', 0314.000 $ 'Kermit is a file transfer protocol for use over an', 0315.000 $ 'asynchronous serial telecommunication line. Files are', 0316.000 $ 'broken up into ""packets"" with checksums and other control', 0317.000 $ 'information to ensure (with high probability) error-free', 0318.000 $ 'and complete transmission.', 0319.000 $ ' ', 0320.000 $ 'This implementation of Kermit is for the GOULD 32-77 ', 0321.000 $ 'computers using the MPX 1.5E operating system. It may ', 0322.000 $ 'be run remotely using a PC that can run as a ', 0323.000 $ 'terminal emulator', 0324.000 $ ' ', 0325.000 $ 'Commands Implemented are: SERVER, RECEIVE, EXIT, X, QUIT,', 0326.000 $ ' HELP, SET, SHOW, STATUS', 0327.000 $ ' ', 0328.000 $ 'For further information, type ""HELP"" for any of the above', 0329.000 $ 'e.g. ""HELP RECEIVE"" or see the Kermit Users Guide and', 0330.000 $ 'Kermit Protocol manual.', 0331.000 $ ' '/ 0332.000 C 0333.000 C help exit, quit, x 0334.000 C 0335.000 INTEGER LMES60 ;PARAMETER (LMES60 = 3) 0336.000 CHARACTER*63 MES60 (LMES60) 0337.000 $ /' ', 0338.000 $ 'Exit from Kermit.', 0339.000 $ ' '/ 0340.000 C 0341.000 C help take 0342.000 C 0343.000 INTEGER LMES70 ;PARAMETER (LMES70 = 5) 0344.000 CHARACTER*63 MES70 (LMES70) 0345.000 $ /' ', 0346.000 $ 'TAKE local-filename', 0347.000 $ ' ', 0348.000 $ 'Read and execute Kermit commands from a local file.', 0349.000 $ ' '/ 0350.000 C 0351.000 C help server 0352.000 C 0353.000 INTEGER LMES90 ;PARAMETER (LMES90=16) 0354.000 CHARACTER*63 MES90 (LMES90) 0355.000 $ /' ', 0356.000 $ 'SERVER', 0357.000 $ ' ', 0358.000 $ 'Act as a server for another Kermit. Take all further', 0359.000 $ 'commands only from the other Kermit. After issuing', 0360.000 $ 'this command, escape back to your local system and issue', 0361.000 $ 'SEND or GET, FINISH, LOG OUT, or other server-oriented', 0362.000 $ 'commands from there. If your local Kermit does not have', 0363.000 $ 'a BYE or FINISH command, it does not have the full ability to', 0364.000 $ 'communicate with a Kermit server (in which case you can', 0365.000 $ 'only use the SEND command). If your local Kermit does', 0366.000 $ 'have a BYE command, use it to shut down and log out', 0367.000 $ 'the Kermit server when you are done with it; otherwise,', 0368.000 $ 'connect back to the Gould, type several Control-C''s to', 0369.000 $ 'stop the server, and logout.', 0370.000 $ ' '/ 0371.000 C 0372.000 C help set 0373.000 C 0374.000 INTEGER LMES100 ;PARAMETER (LMES100=122) 0375.000 CHARACTER*63 MES100(LMES100) 0376.000 $/' ', 0377.000 $ 'SET', 0378.000 $ ' ', 0379.000 $ ' Establish system-dependent parameters. You can examine', 0380.000 $ 'their values with the SHOW command. Numeric values may be', 0381.000 $ 'decimal, octal (postfixed with a O), or hexadecimal (post-', 0382.000 $ 'fixed with an H). The following may be SET:', 0383.000 $ ' ', 0384.000 $ ' DEBUG options', 0385.000 $ ' Show packet traffic explicitly. Options are:', 0386.000 $ ' ALL Set all debug options.', 0387.000 $ ' LOG-FILE Log states and packets to the specified file.', 0388.000 $ ' The default log-file is file L.KERMLOG', 0389.000 $ ' OFF Don''t display debugging information. (this is', 0390.000 $ ' the default). If debugging was in effect, turn', 0391.000 $ ' it off and close any log file.', 0392.000 $ ' PACKETS Display each incoming and outgoing packet', 0393.000 $ ' (lengthy)', 0394.000 $ ' STATES Show kermit state transitions and packet numbers', 0395.000 $ ' (brief).', 0396.000 $ ' ', 0397.000 $ ' LOG options', 0398.000 $ ' Log all inputs from remote port during connection.', 0399.000 $ ' Options are:', 0400.000 $ ' LOG-FILE Log inputs to specified file. The default', 0401.000 $ ' log-file is file L.SESSION', 0402.000 $ ' OFF Turn off the session logging', 0403.000 $ ' ON Turn on the session logging', 0404.000 $ ' ', 0405.000 $ ' PORT terminal-address', 0406.000 $ ' Sets the communicaton port; to which connect, send,', 0407.000 $ ' receive and server interact with. Any MPX terminal ', 0408.000 $ ' address may be used. Examples: TY7EC0, U17CC4, or UT.', 0409.000 $ ' Default is UT', 0410.000 $ ' ', 0411.000 $ ' ESCAPE decimal-number', 0412.000 $ ' Control character used to escape from connect mode.', 0413.000 $ ' Default is 29, (^])', 0414.000 $ ' ', 0415.000 $ ' ECHO on/off', 0416.000 $ ' Turns on or off the echo by kermit during connect mode.', 0417.000 $ ' ', 0418.000 $ ' DELAY decimal-number', 0419.000 $ ' How many seconds to wait before sending the first', 0420.000 $ ' packet. This gives you time to ""escape"" back and', 0421.000 $ ' issue a RECEIVE command.', 0422.000 $ ' ', 0423.000 $ ' INIT-RETRY decimal-number', 0424.000 $ ' Set the maximum number of retries allowed for the', 0425.000 $ ' initial connection before giving up.', 0426.000 $ ' ', 0427.000 $ ' RETRY decimal-number', 0428.000 $ ' Set the maximum number of retries allowed for sending', 0429.000 $ ' a particular packet.', 0430.000 $ ' ', 0431.000 $ ' SEND parameter', 0432.000 $ ' Parameters for outgoing packets as follows:', 0433.000 $ ' ', 0434.000 $ ' EOLCHR octal-number', 0435.000 $ ' The octal value of the ASCII character to be used', 0436.000 $ ' as a line terminator for packets, if one is required', 0437.000 $ ' by the other system. Carriage return (15B) by default.', 0438.000 $ ' ', 0439.000 $ ' PACKLEN decimal-number', 0440.000 $ ' Maximum packet length to send, decimal number, between', 0441.000 $ ' 20 and 1000, 1000 by default.', 0442.000 $ ' ', 0443.000 $ ' PADCHR octal-number', 0444.000 $ ' Character to use for padding. Default is NUL.', 0445.000 $ ' ', 0446.000 $ ' PADLEN decimal-number', 0447.000 $ ' How much padding to send before a packet. Default', 0448.000 $ ' is no padding.', 0449.000 $ ' ', 0450.000 $ ' QUOTECHR octal-number', 0451.000 $ ' What printable character to use for quoting of control', 0452.000 $ ' characters. The default is ''#'' (43B). There should', 0453.000 $ ' be no reason to change this.', 0454.000 $ ' ', 0455.000 $ ' SYNCCHR octal-number', 0456.000 $ ' The control character that marks the beginning of the', 0457.000 $ ' packet. Normally SOH (Control-A, ASCII 1). There', 0458.000 $ ' should be no reason to change this.', 0459.000 $ ' ', 0460.000 $ ' TIMEOUT decimal-number', 0461.000 $ ' How many seconds the other Kermit wants before being', 0462.000 $ ' asked for retransmission.', 0463.000 $ ' ', 0464.000 $ ' RECEIVE parameter', 0465.000 $ ' Parameters to request or expect for incoming packets,', 0466.000 $ ' as follows:', 0467.000 $ ' ', 0468.000 $ ' EOLCHR octal-number', 0469.000 $ ' The octal value of the ASCII character to be used', 0470.000 $ ' as a line terminator for packets, if one is required', 0471.000 $ ' by the other system. Carriage return (15B) by default.', 0472.000 $ ' ', 0473.000 $ ' PACKLEN decimal-number', 0474.000 $ ' Maximum packet length to send, decimal number, between', 0475.000 $ ' 20 and 1000, 1000 by default.', 0476.000 $ ' ', 0477.000 $ ' PADCHR octal-number', 0478.000 $ ' Character to use for padding. Default is NUL.', 0479.000 $ ' ', 0480.000 $ ' PADLEN decimal-number', 0481.000 $ ' How much padding to send before a packet. Default', 0482.000 $ ' is no padding.', 0483.000 $ ' ', 0484.000 $ ' QUOTECHR octal-number', 0485.000 $ ' What printable character to use for quoting of control', 0486.000 $ ' characters. The default is ''#'' (43B). There should', 0487.000 $ ' be no reason to change this.', 0488.000 $ ' ', 0489.000 $ ' SYNCCHR octal-number', 0490.000 $ ' The control character that marks the beginning of the', 0491.000 $ ' packet. Normally SOH (Control-A, ASCII 1). There', 0492.000 $ ' should be no reason to change this.', 0493.000 $ ' ', 0494.000 $ ' TIMEOUT decimal-number', 0495.000 $ ' How many seconds the other Kermit wants before being', 0496.000 $ ' asked for retransmission.', 0497.000 $ ' '/ 0498.000 C 0499.000 C help show 0500.000 C 0501.000 INTEGER LMES110 ;PARAMETER (LMES110= 4 ) 0502.000 CHARACTER*63 MES110(LMES110) !show help 0503.000 $/' ', 0504.000 $ 'Display current SET parameters, version of Kermit, and', 0505.000 $ 'other info.', 0506.000 $ ' '/ 0507.000 C 0508.000 C help status 0509.000 C 0510.000 INTEGER LMES120 ;PARAMETER (LMES120= 3) 0511.000 CHARACTER*63 MES120(LMES120) 0512.000 $/' ', 0513.000 $ 'Give statistics about the most recent file transfer.', 0514.000 $ ' '/ 0515.000 C 0516.000 C help help 0517.000 C 0518.000 INTEGER LMES130 ;PARAMETER (LMES130=16) 0519.000 CHARACTER*63 MES130 (LMES130) 0520.000 $/' ', 0521.000 $ 'HELP [topic]', 0522.000 $ ' ', 0523.000 $ 'Typing HELP alone prints a brief summary of Kermit', 0524.000 $ 'and its commands. You can also type', 0525.000 $ ' ', 0526.000 $ ' HELP command', 0527.000 $ ' ', 0528.000 $ 'for any Kermit command, e.g. ""HELP SEND"", to get more', 0529.000 $ 'detailed information about a specific command. Type', 0530.000 $ ' ', 0531.000 $ ' HELP ?', 0532.000 $ ' ', 0533.000 $ 'to see a list of all the available help commands, or', 0534.000 $ 'consult the Kermit Users Guide.', 0535.000 $ ' '/ 0536.000 INTEGER LMES140 ;PARAMETER (LMES140 = 6 ) 0537.000 CHARACTER*63 MES140(LMES140) 0538.000 $ /' ', 0539.000 $ 'BYE', 0540.000 $ ' ', 0541.000 $ 'This command sends a message to the remote server to log', 0542.000 $ 'itself out', 0543.000 $ ' '/ 0544.000 INTEGER LMES150 ;PARAMETER (LMES150 = 6 ) 0545.000 CHARACTER*63 MES150 (LMES150) 0546.000 $/' ', 0547.000 $ 'FINISH', 0548.000 $ ' ', 0549.000 $ 'This command causes the remote server to shut itself down', 0550.000 $ 'leaving the local KERMIT at KERMIT command level.', 0551.000 $ ' '/ 0552.000 INTEGER LMES160 ;PARAMETER (LMES160 =3 ) 0553.000 CHARACTER*63 MES160 (LMES160) 0554.000 $/' ', 0555.000 $ 'This command is cannot be used on this version of KERMIT.', 0556.000 $ ' '/ 0557.000 INTEGER IDX !index of code 0558.000 C 0559.000 INTEGER MATCH !command parser 0560.000 C 0561.000 IDX = MATCH(HLPCMDS,MAXHLPS,.TRUE.) 0562.000 IF (IDX .EQ. EOF .OR. IDX .EQ. ERROR) RETURN 0563.000 IF (IDX .EQ. 0) GOTO 50 0564.000 GOTO ( 140,40, 60, 150,20, 130, 50, 60, 30, 10, 90, 0565.000 $ 100, 110, 120, 70, 60) IDX 0566.000 10 CONTINUE !send 0567.000 CALL OUTTBL(MES10, 1, LMES10) 0568.000 GOTO 200 0569.000 20 CONTINUE !get 0570.000 IF (.NOT. LOCALON) GOTO 160 0571.000 CALL OUTTBL(MES20, 1, LMES20) 0572.000 GOTO 200 0573.000 30 CONTINUE !receive 0574.000 CALL OUTTBL(MES30, 1, LMES30) 0575.000 GOTO 200 0576.000 40 CONTINUE !connect 0577.000 IF (.NOT. LOCALON) GOTO 160 0578.000 CALL OUTTBL(MES40, 1, LMES40) 0579.000 GOTO 200 0580.000 50 CONTINUE !kermit 0581.000 CALL OUTTBL(MES50, 1, LMES50) 0582.000 GOTO 200 0583.000 60 CONTINUE !exit 0584.000 CALL OUTTBL(MES60, 1, LMES60) 0585.000 GOTO 200 0586.000 70 CONTINUE !take 0587.000 CALL OUTTBL(MES70, 1, LMES70) 0588.000 GOTO 200 0589.000 90 CONTINUE !server 0590.000 CALL OUTTBL(MES90, 1, LMES90) 0591.000 GOTO 200 0592.000 100 CONTINUE !set 0593.000 CALL OUTTBL(MES100, 1, LMES100) 0594.000 GOTO 200 0595.000 110 CONTINUE !show 0596.000 CALL OUTTBL(MES110, 1, LMES110) 0597.000 GOTO 200 0598.000 120 CONTINUE !status 0599.000 CALL OUTTBL(MES120, 1, LMES120) 0600.000 GOTO 200 0601.000 130 CONTINUE !help 0602.000 CALL OUTTBL(MES130, 1, LMES130) 0603.000 GOTO 200 0604.000 140 CONTINUE !bye 0605.000 IF (.NOT. LOCALON) GOTO 160 0606.000 CALL OUTTBL(MES140, 1, LMES140) 0607.000 GOTO 200 0608.000 150 CONTINUE !finish 0609.000 IF (.NOT. LOCALON) GOTO 160 0610.000 CALL OUTTBL(MES150, 1, LMES150) 0611.000 GOTO 200 0612.000 160 CONTINUE !no local 0613.000 CALL OUTTBL(MES160, 1, LMES160) 0614.000 GOTO 200 0615.000 200 CONTINUE 0616.000 RETURN 0617.000 END 0618.000 LOGICAL FUNCTION MORE() 0619.000 IMPLICIT NONE 0620.000 C 0621.000 C= Returns true if continue, else false 0622.000 C 0623.000 INCLUDE K.KERMD 0624.000 C 0625.000 INTEGER INCHR 0626.000 C 0627.000 INTEGER GETC 0628.000 LOGICAL MORE 0628.100 C 0629.000 CALL FLUSH(STDIN) 0630.000 CALL STTY(STDIN, 'READSIZE', 1) 0631.000 CALL PRINTL(STDOUT, 'Enter CR for more') 0632.000 MORE = GETC(STDIN, INCHR) .EQ. NEL 0633.000 CALL STTY(STDIN, 'READSIZE', 80) 0634.000 RETURN 0635.000 END 0636.000