PROCEDURE ,010003 ;+ ; ; Copyright (c) 1976 ; Digital Equipment Corporation, Maynard, Mass. ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the inclu- ; sion of the above copyright notice. This software, or any ; other copies thereof, may not be provided or otherwise made ; available to any other person except for use on such system ; and to one who agrees to these license terms. Title to and ; ownership of the software shall at all times remain in DEC. ; ; The information in this software is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation. ; ; DEC assumes no responsibility for the use or reliability of its ; software on equipment which is not supplied by DEC. ; ; Abstract: This module contains the necessary control blocks ; for all of Runoff's I/O. ; ; Written: 19-Dec-73, -0.0.0-, E. Pollack ; ; Modified: 10-Jan-80, -1.0.0-, Henry R. Tumblin ; Produced Duke supported version ; ; Verified: 10-Jan-80, -1.0.0-, Henry R. Tumblin ; ; Modified: 18-July-80, -1.0.1-, Jon Berntsen .IF DF A$$RAP ; ; Modified: 27-Aug-80, -1.0.2-, John D. Leonard ; Added write-pass-all for Diablo terminal ; ; Modified: 04-Dec-80, -1.0.3-, John D. Leonard ; Added /PITCH:n switch where n is 10 or 12 .ENDC ;- .SBTTL MACRO LIBRARY CALLS ; .MCALL FCSMC$ ; mcall fcs macros .MCALL GCMLB$,FSRSZ$,QIOW$ .MCALL CSI$SW,CSI$ND,CSI$SV FCSMC$ ; RUNOFF GLOBAL DEFINITIONS .GLOBL DIASW ; Super/Subscript switch .GLOBL ERRFDB ; Runoff error message FDB .GLOBL FFDSW ; Form-Feed Switch .GLOBL HGHCHP ; High range of /CH:L:H .GLOBL HGHPAG ; High range of /PA:L:H .GLOBL HYPSW ; Hyphenate switch .GLOBL INSW ; Input file switch table .GLOBL LOWCHP ; Low range of /CH:L:H .GLOBL LOWPAG ; Low range of /PA:L:H .GLOBL LPPG ; Hardware form size .GLOBL LSTBLK ; Output file FDB .GLOBL LSTFIL ; Default output FNB .GLOBL OUSW ; Output file switch table .GLOBL PAUSW ; Pause switch .GLOBL PNLPG ; Number of lines per page .GLOBL PRMRG ; Permanent right margin .GLOBL QISFDB ; QIOSYM error message FDB .GLOBL SPLSW ; Spool Switch .GLOBL RIGSHI ; Right shift .GLOBL TOCSW ; TOC switch table .GLOBL TTIBLK ; Get command line FDB .GLOBL TTIBUF ; Command input buffer .GLOBL TTLDMY ; Source input FDB .GLOBL ULSWT ; Underline switch .GLOBL UPCSW ; Upper case switch .GLOBL $INSW ; Input switches .GLOBL $OUSW ; Output switches .GLOBL $QIO ; Q-I/O DPB .IF DF A$$RAP .GLOBL $QIOD ; Q-I/O DPB with IO.WAL for Diablo .ENDC .GLOBL $TOCSW ; TOC switches ; Local Definitions CMDLUN == 1 ; Command input QISLUN == 2 ; Lun for QIOSYM.MSG ERRLUN == 3 ; Lun for RNOERR.MSG SRCLUN == 4 ; Source input OUTLUN == 5 ; Output listing TOCLUN == 6 ; Table of contents lun MSGLUN == 7 ; LUN for error messages output MSGFLG == 7 ; Event flag TTILIN = 328. .Sbttl Declare FDB's and control blocks DATA RNORSX ; Declare a DATA psect $QIO: QIOW$ IO.WVB!TF.CCO,MSGLUN,MSGFLG,100.,,,<0,0,0> .IF DF A$$RAP $QIOD: QIOW$ IO.WAL,MSGLUN,MSGFLG,100.,,,<0,0,0> ; Diablo QIO .ENDC FSRSZ$ 7,,RNORSX ; Set up the Get Command Line control block. TTIBLK: GCMLB$ 2,RNO,TTIBUF,,,TTILIN ; Allocate an FDB for command input ; Set up the FDB for source input TTLDMY: FDBDF$ ; Allocate a File Descriptor Block FDAT$A R.VAR ; Record Format: ; ...Variable Length records FDOP$A SRCLUN,,TTLFIL ; File Open: ; ...Lun is SRCLUN ; ...Default FNB is TTLFIL FDRC$A FD.PLC ; Record Access: ; ...Use Locate mode by default .IF DF I$$AS!R$$11D FDBF$A ,,2 ; Set multi-buffer count .ENDC .IF DF R$$11M!R$$STS FDBF$A ,,1 ; Set for single buffer .ENDC TTLFIL: NMBLK$ RUNOFF,RNO,,SY,0 ; Default File name Block ; Set up the FDB for the listing file LSTBLK: FDBDF$ ; Allocate a File Descriptor Block FDAT$A R.VAR ; Record Format: ; ...Variable length records FDOP$A 5,,LSTFIL ; File Open: ; ...LUN is LSTLUN ; ...Default FNB is LSTFIL .IF DF I$$AS!R$$11D FDBF$A ,,2 ; Set multi-buffer count .ENDC .IF DF R$$11M!R$$STS FDBF$A ,,1 ; Set for single buffer .ENDC .IF NDF R$$OCK LSTFIL: NMBLK$ RUNOFF,LST,,SY,0 ; Default File Name Block .IFF LSTFIL: NMBLK$ RUNOFF,DOC,,SY,0 ; Default File Name Block .ENDC ; R$$OCK ; Set up the FDB for the Table of Contents file TOCBLK::FDBDF$ ; Allocate a File Descriptor Block FDAT$A R.VAR ; Record Format: ; ...Variable length records FDOP$A TOCLUN,,TOCFIL ; File Open: ; ...LUN is TOCLUN ; ...Default FNB is TOCFIL TOCFIL::NMBLK$ RUNOFF,TOC,,SY,0 ; Default File Name Block .sbttl Error message FDB's ; FDB for RNOERR.MSG ERRFDB: FDBDF$ ; FDOP$A ERRLUN,ERRDSD ; File Open: ; ...Lun is ERRLUN FDRC$A FD.RWM ; Record Access: ; ...Use Read/Write macros ERRDSD: .WORD RDS,RD,RUS,RU,RFS,RF .IF DF R$$11D RD: .ASCII "SY00:" .IFF RD: .ASCII "LB00:" .ENDC RDS=.-RD RU: .ASCII "[1,2]" RUS=.-RU RF: .ASCII "RNOERR.MSG" RFS=.-RF .EVEN ; FDB for QIOSYM.MSG QISFDB: FDBDF$ ; FDOP$A QISLUN,QISDSD ; File Open: ; ...Lun is ERRLUN FDRC$A FD.RWM ; Record Access: ; ...Use Read/Write macros QISDSD: .WORD RDS,RD,RUS,RU,QFS,QF QF: .ASCII "QIOSYM.MSG" QFS=.-QF .EVEN DATA SWTCH ; Declare switch P-sect INSW: CSI$SW UC,UPCSW,$INSW,SET ; force upper case CSI$SW HY,HYPSW,$INSW,SET,NEG ; hyphenation switch CSI$SW UL,,,,,ULCVAL ; underline control CSI$SW PS,,,,,PSVAL ; page size .IF DF R$$OCK CSI$SW DI,DIASW,$INSW,SET,NEG ; Enable Super/Subscript .IFF CSI$SW ES,DIASW,$INSW,SET,NEG ; Enable Super/Subscript .ENDC ; R$$OCK CSI$SW FF,FFDSW,$OUSW,SET,NEG,FFVAL ; kick pages with formfeeds CSI$SW WA,PAUSW,$OUSW,SET ; wait between pages .IF DF A$$RAP CSI$SW CS,,,,,FNTVAL ; Font value 0,1,2 CSI$SW PI,,,,,PITSW ; Pitch switch CSI$SW PA,,,,,PAGVAL CSI$SW CH,,,,,CHPVAL CSI$SW RI,,,,,RIGVAL CSI$SW SP,SPLSW,$OUSW,SET,NEG ; spooling switch .ENDC CSI$ND OUSW: CSI$SW SP,SPLSW,$OUSW,SET,NEG ; spooling switch CSI$SW FF,FFDSW,$OUSW,SET,NEG,FFVAL ; kick pages with formfeeds CSI$SW WA,PAUSW,$OUSW,SET ; wait between pages CSI$SW PA,,,,,PAGVAL ; lower/upper limit to pages CSI$SW RI,,,,,RIGVAL ; right shift switch CSI$SW CH,,,,,CHPVAL ; Chapter range switch .IF DF R$$SWI ; If switches on all files ... CSI$SW UC,UPCSW,$INSW,SET ; Force upper case CSI$SW HY,HYPSW,$INSW,SET,NEG ; Hyphenation switch CSI$SW UL,,,,,ULCVAL ; Underline control CSI$SW PS,,,,,PSVAL ; Page size control .IF DF A$$RAP CSI$SW PI,,,,,PITSW CSI$SW CS,,,,,FNTVAL ; Font selection switch .ENDC .IF DF R$$OCK CSI$SW DI,DIASW,$INSW,SET,NEG ; Enable Super/subscript .IFF CSI$SW ES,DIASW,$INSW,SET,NEG ; Enable Super/subscript .ENDC ; R$$OCK .ENDC ; R$$SWI CSI$ND TOCSW: CSI$SW SP,SPLSW,$TOCSW,SET,NEG ; TOC spooling switch .IF DF R$$SWI ; If switches on all files ... CSI$SW UC,UPCSW,$INSW,SET ; Force upper case CSI$SW HY,HYPSW,$INSW,SET,NEG ; Hyphenation switch CSI$SW UL,,,,,ULCVAL ; Underline control CSI$SW PS,,,,,PSVAL ; Page size control .IF DF R$$OCK CSI$SW DI,DIASW,$INSW,SET,NEG ; Enable Super/subscript .IFF CSI$SW ES,DIASW,$INSW,SET,NEG ; Enable Super/subscript .ENDC ; R$$OCK .ENDC ; R$$SWI CSI$ND RIGVAL: CSI$SV DECIMAL,RIGSHI,2 ; Right shift value CSI$ND .IF DF A$$RAP FNTVAL: CSI$SV DECIMAL,CSVAL,1 ; Character set (font) value CSI$ND PITSW: CSI$SV DECIMAL,PITCH,2 ; Pitch, must be 10 or 12 CSI$ND .ENDC PAGVAL: CSI$SV DECIMAL,LOWPAG,2 ; Low page range CSI$SV DECIMAL,HGHPAG,2 ; High page range CSI$ND CHPVAL: CSI$SV DECIMAL,LOWCHP,2 ; Low chapter range CSI$SV DECIMAL,HGHCHP,2 ; High chapter range CSI$ND ULCVAL: CSI$SV ASCII,ULSWT,2 ; Underline type flag CSI$ND FFVAL: CSI$SV DECIMAL,LPPG,2 ; hardware form size CSI$ND PSVAL: CSI$SV DECIMAL,PNLPG,2 ; page size CSI$SV DECIMAL,PRMRG,2 ; right margin CSI$ND .END