home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
modcomp
/
recsw.
< prev
next >
Wrap
Text File
|
2020-01-01
|
6KB
|
169 lines
INTEGER FUNCTION RECSW (X)
C
C ****************************************************************
C
C KERMIT for the MODCOMP MAXIV operating system
C
C Compliments of:
C
C SETPOINT, Inc.
C 10245 Brecksville Rd.
C Brecksville, Ohio 44141
C
C
C KERMIT is a copyrighted protocol of Columbia Univ. The authors
C of this version hereby grant permission to copy this software
C provided that it is not used for an explicitly commercial
C purpose and that proper credit be given. SETPOINT, Inc. makes
C no warranty whatsoever regarding the accuracy of this package
C and will assume no liability resulting from it's use.
C
C ****************************************************************
C
C Abstract: Receive a file or group of files from the
C other Kermit.
C
C MODIFICATION HISTORY
C
C BY DATE REASON PROGRAMS AFFECTED
C
C
C ****************************************************************
C
C Author: BOB BORGESON Version: A.0 Date: Oct-86
C
C Calling Parameters:
C
C X - REQUIRED BY FORTRAN
C
C ****************************************************************
C
C Messages generated by this module : None
C
C ****************************************************************
C
C Subroutines called directly : RINIT , RDATA , RFILE , PUTLIN
C SPACK , BKFILE , AVFILE
C
C ****************************************************************
C
C Files referenced : None
C
C ****************************************************************
C
C Local variable definitions :
C
C UFTFIL UFT# FOR THE FILE NAMES SCRATCH
C UFTDAT UFT# FOR THE FILE DATA SCRATCH
C
C ****************************************************************
C
C Commons referenced : KERCOM, KERPMC, UFTTBL, XBYTE local commons
C
C ****************************************************************
C
C (*$END.DOCUMENT*)
C
C ****************************************************************
C * *
C * D I M E N S I O N S T A T E M E N T S *
C * *
C ****************************************************************
C
IMPLICIT INTEGER (A-Z)
C
INTEGER*2 FILNM(50)
C
C ****************************************************************
C * *
C * T Y P E S T A T E M E N T S *
C * *
C ****************************************************************
C
C
C ****************************************************************
C * *
C * C O M M O N S T A T E M E N T S *
C * *
C ****************************************************************
C
INCLUDE USL/KERCOM
INCLUDE USL/KERPMC
INCLUDE USL/UFTTBC
COMMON /XBYTE/ XNEW,XCOUNT,XLIN(132),XEOF
C
C ****************************************************************
C * *
C * E Q U I V A L E N C E S T A T E M E N T S *
C * *
C ****************************************************************
C
C
C ****************************************************************
C * *
C * D A T A S T A T E M E N T S *
C * *
C ****************************************************************
C
DATA UFTFIL / 5 /
DATA UFTDAT / 8 /
C
C ****************************************************************
C
C Code starts here :
C
STATUS=YES
STATE=BIGR
XNEW=YES
XCOUNT=1
N=0
NUMTRY=0
C
100 CONTINUE
C
IF(STATUS.NE.YES)GO TO 9000
C !READ A DATA PACKET
IF(STATE.NE.BIGD)GO TO 200
STATE=RDATA(X)
GO TO 1000
200 CONTINUE
C !READ A SINIT PACKET
IF(STATE.NE.BIGR)GO TO 300
STATE=RINIT(X)
GO TO 1000
300 CONTINUE
C !READ A FILE HEADER
IF(STATE.NE.BIGF)GO TO 400
STATE=RFILE(FILNM)
IF (STATE .EQ. BIGD) CALL CMWI4 (IUFT(2,UFTDAT),40)
GO TO 1000
400 CONTINUE
C !FILE TRANSFER DONE
IF(STATE.NE.BIGC)GO TO 500
RECSW=YES
C
IF (HOSTON .EQ. YES) CALL TERMIN (IUFT(1,4),.FALSE.)
RETURN
500 CONTINUE
C !WE GOT AN ERROR
IF(STATE.NE.BIGA)GO TO 1000
RECSW=NO
TV1=BIGE
TV2=N
TV3=0
TV4=0
C !SEND AN ERROR PACKET
CALL SPACK(TV1,TV2,TV3,TV4)
C BACK UP SCRATCH TO GET
C RID OF JUNK
CALL BKFILE(IUFT(1,UFTDAT))
CALL AVFILE(IUFT(1,UFTDAT))
RETURN
1000 CONTINUE
C
GO TO 100
C
9000 CONTINUE
RETURN
END