Google
 

Trailing-Edge - PDP-10 Archives - BB-L014E-BM - autopatch/foropn.c05
There are no other files named foropn.c05 in the archive.
 REP 1/1	;05C1
		SEARCH	FORPRM
		TV	FOROPN	OPEN & CLOSE ,6(2033)

	;COPYRIGHT (C) 1981  BY  DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
 WIT
	SEARCH	FORPRM
		TV	FOROPN	OPEN & CLOSE ,6(2126)

	;COPYRIGHT (C) 1981,1982  BY  DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
 INS 523/2	;05C2
	***** End V6 Development *****

	2041	DAW	2-Feb-82
		Correct deficiency in TOPS-20 logical name handling that
		caused unexpected "?File not found" errors for OPEN/READ
		sequence.

	2042	TGS	2-Feb-82	20-17208
		Change NREC(D) to NREC(U) at end-of-file routines so record
		counts get correctly updated. 

	2043	ERD	9-Feb-82	10-32099
		Change in DPRFN1 to allow leading spaces in file names on
		TOPS-10.

	2050	ERD	20-Apr-82	10-32326
		Code addition in %LSTBF so that DUMP mode output on magtape
		will skip over the initial output.

	2062	EDS	7-Jun-82
		Files with extension of "DAT" when sent to the printer via
		DISPOSE = 'LIST' or 'PRINT' do not have the first character
		of each line used for carriage control.

	2064	EDS	10-Jun-82
		Create files for STATUS='SCRATCH' using the standard naming
		convention for TOPS-10.  File names will now be nnnccc.TMP,
		where nnn is the job number and ccc are random letters.

	2065	EDS	25-Jun-82
		Replace the use of D.TTY with U.TTY and rework logic for UDB.

	2071	RJD	5-Aug-82
		Store the controlling terminal's CCOC words in its DDB.  Restore
		CCOC words for terminals during close and for the controlling
		terminal during EXIT.

	2072	RJD	16-Aug-82
		This edit has been superseded by edit 2115.
		If OPEN statement contains DEVICE=' ', use the default device.

	2074	MRB	19-Aug-82	20-17792
		Impossible JSYS error when memory is full. When opening a file
		when memory is full causes routine %GTPGS to take the error 
		return, the error processing displays the error message "?Memory
		full" then procedes to cleanup the open files. But, in this case
		the monitor status shows the file open and FOROTS thinks it has
		not been open yet and calls SETJFN to release the JFN and dies 
		there. Change Routine DSKSET not to bother to clean-up open files
		when a "?Memory full" error is detected, Just %HALT.
		Modules:
			FOROTS		FOROPN

	2075	RJD	23-Aug-82
		Search QSRMC2 to resolve symbol definitions for V2 GALAXY code.
		QSRMC2 is a renamed copy of the version 2 GALAXY's QSRMAC.

	2100	MRB	3-Sep-82	none.
		Remove edit 2074.

	2101	MRB	7-Sep-82	20-17792
		In routine SETJFN when releasing JFN's and an error occurs
		check to see if error is "file not closed". If it is then
		close the file and continue processing.

	2102	RJD	9-Sep-82	10-32721
		When a file is READ then the pointer is repositioned to the
		beginning of the file before execution of a WRITE or ENDFILE,
		write a null file to supersede the existing file rather than
		deleting the file.

	2107	MRB	17-Sep-82	20-18041
		When unmapping file pages (at file closing time) use the 
		proper arguments for the FFUFP% call. To make sure that 
		unused pages are not written to the file.

	2112	TGS	29-Sep-82	10-32830
		Set up the path pointer in the RENAME block before executing the
		rename FILOP. so CLOSE/DISPOSE=RENAME can rename a file to a 
		different SFD or directory.

	2115	RJD	05-Oct-82	10-33130
		This edit supersedes edit 2072.  If an OPEN statement contains
		DEVICE=' ', then the default device is used.  Also, the  ATMBUF
		is zeroed out before entering the loop to get the device name.

	2124	TGS	11-Nov-82	10-33170
		This edit supersedes edit 2063.  Ensure that calls to FRSISW errors
		always pass SIXBIT strings for keywords and key values on TOPS10 only.

	2125	RJD	15-Nov-82	10-33237
		This edit corrects edit 2102.  Both edits should be installed
		together.  This edit adds an instruction for the error return
		of the FILOP. in OSWCRE.

	2126	MRB	18-NOV-82	20-17953
		Added code to set the tape mode (TAPM(D)) in the DDB.
		It will be referenced in the I/O code to determine the 
		byte size.

 REP 3/3	;05C3
		SEARCH QSRMAC
	IF20,<	SEARCH GLXMAC >
 WIT
	IF10,<	SEARCH QSRMC2 >		;[2075] To resolve symbols for V2 GALAXY code
	IF20,<	SEARCH GLXMAC,QSRMAC >  ;[2075]
 REP 24/3	;05C4
		EXTERN	D.TTY,U.ERR,U.ACS,U.PDL
	IF10,<	EXTERN	G.PPN,%RANWR,I.MVER,%CLRBC,%BACKB,%BAKEF,%ISET   >
 WIT
		EXTERN	U.TTY,U.ERR,U.ACS,U.PDL	;[2065]
	IF10,<	EXTERN	G.PPN,%RANWR,I.MVER,%CLRBC,%BACKB,%BAKEF,%ISET,I.JOB   > ;[2064]
 INS 32/3	;05C5
	IF20,<	EXTERN	I.CCOC  >	;[2071] CONTROLLING TERMINAL'S CCOC WORDS
 REP 16/24	;05C6
		 SOS	NREC(D)		;YES. DECR THE RECORD COUNT
 WIT
		 SOS	NREC(U)		;[2042] YES. DECR THE RECORD COUNT
 REP 94/24	;05C7
		 PUSHJ	P,OSWDEL	;YES. DELETE FILE
 WIT
		 PUSHJ	P,OSWCRE	;[2102] YES. SUPERSEDE FILE
 REP 112/24	;05C8
		  PUSHJ	P,OSWDEL	;DELETE FILE IF NO BLOCKS
 WIT
		  PUSHJ	P,OSWCRE	;[2102] SUPERSEDE FILE IF NO BLOCKS
 REP 129/24	;05C9
		MOVEM	T1,NREC(D)
 WIT
		MOVEM	T1,NREC(U)	;[2042] SET RECORD COUNT
 REP 133/24	;05C10
		SOS	NREC(D)		;DECR THE RECORD COUNT
 WIT
		SOS	NREC(U)		;[2042] DECR THE RECORD COUNT
 REP 172/24	;05C11
	OSWDEL:	LOAD	T1,INDX(D)	;GET DEVICE INDEX
		CAIE	T1,DI.DSK	;DISK?
		 POPJ	P,		;NO. DON'T DELETE THE MAGTAPE
		MOVEI	T1,.FODLT	;DELETE THE FILE
 WIT
	OSWCRE:	LOAD	T1,INDX(D)	;[2102] GET DEVICE INDEX
		CAIE	T1,DI.DSK	;DISK?
		 POPJ	P,		;NO. DON'T DELETE THE MAGTAPE
		MOVE	T2,FBLK(D)	;[2102] GET CHANNEL INFO
		HRRI	T2,.FOCLS	;[2102] CLOSE THE FILE
		MOVE	T1,[1,,T2]	;[2102]
		FILOP.	T1,		;[2102]
		 PUSHJ	P,CLSERR	;[2125]
		SETZM	LKPB+.RBALC(D)	;[2102] MAKE THE FILE NULL
		MOVEI	T1,.FOWRT	;[2102] SUPERSEDE THE FILE
 INS 301/24	;05C12
		LOAD	T1,MODE(D)	;[2050] GET MODE
		CAIN	T1,MD.DMP	;[2050] IS MODE = DUMP?
		 POPJ	P,		;[2050] OUTPUT NOT NECESSARY
 REP 75/25	;05C13
		MOVEM	T1,NREC(D)
 WIT
		MOVEM	T1,NREC(U)	;[2042] SET IT
 REP 7/29	;05C14
		MOVE	T1,ATMBUF	;Put in DEV(D)
		MOVEM	T1,DEV(D)
	>
	IF20,<
 WIT
		SKIPE	T1,ATMBUF	;[2115] Use default device
		MOVEM	T1,DEV(D)
		POPJ	P,		;[2115]  if blank device name specified
	>
	IF20,<
		SKIPN	ATMBUF		;[2115] Use default device
		POPJ	P,		;[2115]  if blank device name specified
 REP 16/29	;05C15
	>
		TXO	F,F%DSS		;Remember device specified
		POPJ	P,		;Return
 WIT
		POPJ	P,		;[2115] Return
	>
 INS 37/29	;05C16
		SETZM	ATMBUF		;[2115] Clear previous device
 REP 58/30	;05C17
	DPRFN1:	PUSHJ	P,DPRCHS	;Get char
 WIT
	DPRFN1:	PUSHJ	P,DPRCHR	;[2043] Get char
 INS 23/57	;05C18
		MOVX	T1,G1%SLN	;[2041] Don't expand logical names either
		IORM	T1,JFNBLK+.GJF2	;[2041] . .
 REP 78/70	;05C19
		 MOVEM	D,D.TTY		;Yes, store the TTY's DDB address
 WIT
		 MOVEM	U,U.TTY		;[2065] Yes, store the TTY's UDB address
 REP 6/72	;05C20
		RFCOC%			;SAVE CCOC WORDS FOR USE DURING TEXTI
		DMOVEM	T2,CCOC(D)
 WIT
		DMOVE	T2,I.CCOC	;[2071] CONTROLLING TERMINAL'S CCOC WORDS
		CAIE	T1,.PRIIN	;[2071] IF CONTROLLING TERMINAL, STORE IN DDB
		RFCOC%			;SAVE CCOC WORDS FOR USE DURING TEXTI
		DMOVEM	T2,CCOC(D)
		CAIN	T1,.PRIIN	;[2071] IF CONTROLLING TERMINAL
		 JRST	TTYST1		;[2071]  ALREADY MASKED
 REP 13/72	;05C21
		MOVE	T1,RSIZE(D)	;RECORD SIZE SPECIFIED?
 WIT
	TTYST1:	MOVE	T1,RSIZE(D)	;[2071] RECORD SIZE SPECIFIED?
 REP 34/73	;05C22
		 $ECALL	MFU,%ABORT	;?Can't, memory full
 WIT
		 $ECALL	MFU,%ABORT	;[2074][2100]?Can't, memory full
 INS 69/74	;05C23
		MOVEI	T2,.MORDM	;[2126]RETURN HARDWARE TAPE
		MTOPR%			;[2126] MODE.
		CAIE	T3,.SJDMC	;[2126]IF DUMP MODE OR
		 CAIN	T3,.SJDMH	;[2126] OR IF HI-DENSITY
		  MOVEI	T3,TM.DMP	;[2126]  THEN DUMP MODE.
		CAIN	T3,.SJDM8	;[2126]IF INDUSTRY COMPAT
		 MOVEI	T3,TM.IND	;[2126] THEN CONVERT FOR TAPM
		STORE	T3,TAPM(D)	;[2126]AND STORE IN THE DDB.
 REP 15/75	;05C24
		RLJFN%
		  JSHALT		;SHOULD NOT FAIL
 WIT
		RLJFN%			;[2101]Release this JFN
		JRST	SETJF1		;[2101]Error releasing JFN!
		JRST	SETJF0		;[2101]JFN released OK, Continue...
	;[2101]
	;[2101]	If an error occurs while releasing a jfn the file
	;[2101]	may actually be open (in some strange cases) see
	;[2101]	if the file is actually open, then close it and 
	;[2101]	continue.
	;[2101]
	SETJF1:	CAIE	1,RJFNX1	;[2101]is it a 'File not closed' error
		JSHALT			;[2101] no, shouldnt ever get here!
		MOVE	T1,T2		;[2101] yep, get the JFN number,
		CLOSF%			;[2101]      and close the file,
		 JSHALT			;[2101]	       [can't close file, shouldnt 
					;[2101]		ever happen]
					;[2101]	      and continue normally.

 REP 16/79	;05C25
		 MOVEM	D,D.TTY		;Yes, store its DDB address.
 WIT
		 MOVEM	U,U.TTY		;[2065] Yes, store its UDB address.
 REP 17/88	;05C26
	GTMWR1:	SETZ	T1,		;Start with nothing
		DMOVEM	T3,GTMSV3	;Save acs
		MOVEI	T4,6		;# chars to get
 WIT
	GTMWR1:	MOVE	T1,I.JOB	;[2064] Get SIXBIT job number in RH
		DMOVEM	T3,GTMSV3	;Save acs
		MOVEI	T4,3		;[2064] # chars to get
 REP 11/118	;05C27
		CAMN	D,D.TTY		;Is this the TTY DDB?
		 SETZM	D.TTY		;Yes, no more.
 WIT
		SKIPE	T1,U.TTY	;[2065] Get TTY UDB
		CAMN	D,DDBAD(T1)	;[2065] Is this the TTY DDB?
		 SETZM	U.TTY		;[2065] Yes, no more.
 REP 18/123	;05C28
	CKCCN2:	PUSH	P,T2		;Save DISPOSE value
		XMOVEI	T3,[ASCIZ/STATUS:/]
		MOVEM	T3,%OPNK1	;Save string address of first switch
		XMOVEI	T3,[ASCIZ/DISPOSE:/]
 WIT
	IF10,<DEFINE X(STR) <SIXBIT/STR/>> ;[2124]
	IF20,<DEFINE X(STR) <ASCIZ/STR/>>  ;[2124]
	CKCCN2:	PUSH	P,T2		;Save DISPOSE value
		XMOVEI	T3,[X STATUS:]	;[2124]
		MOVEM	T3,%OPNK1	;Save string address of first switch
		XMOVEI	T3,[X DISPOSE:]	;[2124]
 REP 25/124	;05C29
	DSSCNF:	XMOVEI	T1,[ASCIZ/DISPOSE:/]
		LOAD	T2,DISP(D)	;Was it really STATUS?
		SKIPN	T2
		 XMOVEI	T1,[ASCIZ/STATUS:/] ;Yes, say conflict there
		MOVEM	T1,%OPNK1
		XMOVEI	T1,[ASCIZ/SAVE/]
		MOVEM	T1,%OPNV1
		XMOVEI	T1,[ASCIZ/STATUS:/]
		MOVEM	T1,%OPNK2
		XMOVEI	T1,[ASCIZ/SCRATCH/]
 WIT
	DSSCNF:	XMOVEI	T1,[X DISPOSE:]	;[2124]
		LOAD	T2,DISP(D)	;Was it really STATUS?
		SKIPN	T2
		 XMOVEI	T1,[X STATUS:]	;[2124] Yes, say conflict there
		MOVEM	T1,%OPNK1
		XMOVEI	T1,[X SAVE]	;[2124]
		MOVEM	T1,%OPNV1
		XMOVEI	T1,[X STATUS:]	;[2124]
		MOVEM	T1,%OPNK2
		XMOVEI	T1,[X SCRATCH]	;[2124]
 INS 15/127	;05C30
		DMOVE	T2,CCOC(D)	;[2071] RESET THE CCOC WORDS
		SFCOC%			;[2071]  BACK TO ORIGINAL STATE
 REP 49/131	;05C31
		HRRI	T1,(T2)		;GET PAGE # OF EOFN
 WIT
		HRLI	T1,(T1)		;[2107]get JFN in left half
		HRRI	T1,1(T2)	;[2107]GET PAGE # OF EOFN
 INS 17/134	;05C32
		PUSH	P,D		;[2112] SAVE OLD DDB POINTER VERY TEMPORARILY
		MOVE	D,RENAMD	;[2112] POINT TO NEW DDB
		PUSHJ	P,SETPPB	;[2112] RESET THE PATH BLOCK
		POP	P,D		;[2112] RESTORE D
 INS 48/137	;05C33
		HLRZ	T1,EXT(D)	;[2062] GET EXTENSION
		CAIE	T1,'DAT'	;[2062] IS IT ".DAT"
		  JRST	Q1NDAT		;[2062] NO
		PUSH	P2,[QA.IMM+.QBPTP] ;[2062] ARG IS FILE FORMAT
		PUSH	P2,[.QBPFR]	;[2062] SET /FILE:FORTRAN
	Q1NDAT:				;[2062]

 INS 43/139	;05C34
		HRROI	T1,.FDFIL(P2)	;[2062] POINT TO DESTINATION (OVERWRITTEN)
		LOAD	T2,IJFN(D)	;[2062] GET JFN
		MOVX	T3,FLD(.JSAOF,JS%TYP) ;[2062] FILE TYPE ONLY
		JFNS%			;[2062] MAKE TYPE STRING
		  JSHALT		;[2062] SHOULD NEVER FAIL
		MOVE	T1,.FDFIL(P2)	;[2062] GET 1ST WORD OF TYPE
		CAME	T1,[ASCIZ /DAT/] ;[2062] IS TYPE "DAT"
		  JRST	QNDAT		;[2062] NO
		AOS	.OARGC(P1)	;[2062] COUNT ARG
		PUSH	P2,[2,,.QCPTP]	;[2062] ARG IS FILE FORMAT
		PUSH	P2,[.FPFFO]	;[2062] SET /FILE:FORTRAN
	QNDAT:				;[2062]

 INS 75/140	;05C35
		HLRZ	T3,EXT(D)	;[2062] GET FILE EXTENSION
		CAIN	T3,'DAT'	;[2062] IS EXTENSION "DAT"
		MOVEI	T1,.FPFFO	;[2062] YES, SET /FILE:FORTRAN
 INS 18/147	;05C36
		MOVEI	T1,.PRIIN	;[2071] RESET CCOC WORDS
		DMOVE	T2,I.CCOC	;[2071]  FOR CONTROLLING TERMINAL
		SFCOC%			;[2071]
 SUM 28920