.title fdbset get free lun and fdb ; ; Copyright (C) 1984, The Associated Press, NY ; .ident /AP1.1/ ; ;+ ; ; Index Return IOV pointer with fdb file name set up. ; ; Usage ; ; FILE * ; fdbset(name, mode); ; char *name; /* File to open */ ; char *mode; /* Open modes */ ; ; Description ; ; ; Internal ; ; The following routines/globals are for use by fopen/fwild. ; If any of these routines detect an error, they return to the ; fopen() caller with an appropriate error code in $$ferr. ; ; $$fcsi Parse file name and setup fdb ; $$fopt Scan options word. ; $$flun Get free Lun slot ; $$falo Get memory for fopen ; $$fopa RT11 open with Ascii name ; $$fope Error exit from fopen ; $$fopn Normal open, hack append ; $$fopr RT11 open with Rad50 block ; $$fopx Normal exit from fopen ; $$csib Work block for the mighty csi ; $$dfnb Default file name block ; ; Bugs ; ;- ; ; Edit history ; ; 00001 9/12/84 hjj created from V1.0 sources for FOPEN.MAC ; .MCALL FDBDF$, FDAT$R, FDOP$R, CSI$, CSI$1, CSI$2 .MCALL FDBK$R, FDRC$R, FSRSZ$, NMBLK$, FDOF$L .MCALL OFNB$A, OFNB$R, OFNB$W FDOF$L ; RMODE = 1. ;Must be 1 WMODE = 2. AMODE = 4. UMODE = 8. NMODE = 16. $$RMOD == 0 ;Open for read Do $$WMOD == 1 ;Open for write not $$AMOD == 2 ;Open for append change ; .PSECT C$CODE ; FDBSET:: JSR R5,CSV$ ;C save sequence CLR R4 ;Clear IOV pointer, too CALL $$FLUN ;Get a Lun CALL $$FOPT ;Scan options string CALL $$FCSI ;Parse the CSI string, setup the FDB ; jmp $$FOPX ;return IOV .end