.TITLE WLDCRD---WILD CARD FILE LOOKUP, INCLUDING UIC ; HERE WHEN EDIT NEXT SETUP IS REQUESTED BY CALLER ; EDIT # 0025 11 Apr 1980 20:51:04 DR1:[300,3]WLDCRD.MAC;37 ; PREVIOUS EDIT 11 Apr 1980 11:05:00 DR1:[300,3]WLDCRD.MAC;36 ; ; 5-Aug-85 CJD ; Put into PIP-compatible RO and RW PSECTS. ; Make default filename block, DN, .GLOBL, so user can set defaults. ; Correct bug that with wild directories, ENEXT goes into an infinite ; loop, after the last file, which it always returns. Presumably, ; something has changed in PIP or FCS since the original was written ; (if it ever worked??). Without the sources of the PIP modules ; called, all I can do is to put in a trap for a repeated FID. ; Note that wild directories don't work under VAX RSX-11 AME (not even ; in PIP). .MCALL FCSMC$,FCSBT$ FCSMC$ FCSBT$ ; ON INPUT: ; R0 = ADDR OF USERS FDB ; OUTPUT: ; THE F.FNB AND F.DSPT (UIC DESCRIPTOR) OF THE ORIGINAL FDB ; ARE FILLED IN ; CARRY ON IF ERROR, ELSE OTHERWISE .PSECT PURE$I,RO,I ENOPEN:: MOV R0,USRFDB CLR F.ERR(R0) MOV F.DSPT(R0),R1 MOV #6,R0 MOV #ENDATS,R2 ; POINT TO EN DATASET 10$: MOV (R1)+,(R2)+ ; COPY CSI OUTPUT TO EN DATASET SOB R0,10$ MOV ENDATS+N.DIRD,R0 ; GET LENGTH OF DIRECTORY STRING BEQ 30$ ; BRANCH IF NULL MOV ENDATS+N.DIRD+2,R1 ; GET ADDRESS OF DIRECTORY MOV #ENAFNB+N.WNM2,R2 ; ADDRESS OF DIRECTORY STRING STORAGE MOV R2,ENDATS+N.DIRD+2 ; SET NEW STRING ADDRESS 20$: MOVB (R1)+,(R2)+ ; COPY DIRECTORY STRING INTO SCRATCH STORAGE SOB R0,20$ ; FOR FUTURE USE 30$: MOV #ENFDB,R0 ; GET FDB MOV #ENFDB+F.FNB,R1 ; AND FNB MOV F.DSPT(R0),R2 ; DATASET DESCRIPTOR MOV F.DFNB(R0),R3 ; DEFAULT NAME BLOCK MOV #ENAFNB,R4 ; AND AUX NAME BLOCK CALL .WPARS ; PARSE THE CONTROLLING STRING BCS ENERR INCB ENFLAG MOV N.FVER(R1),ENVER ; SAVE ORIGINAL VERSION NUMBER CLR LASTFI ; No last FID BR T70 ;; ; ; ; ; ; ; ; HERE WHEN THE NEXT OCCURRANCE OF A WILD CARD CLASS IS REQUESTED. ; ; INPUT: ; ENOPEN MUST HAVE BEEN CALLED ; OUTPUT: ; THE F.FNB AND F.DSPT (UIC DESCRIPTOR) OF THE ORIGINAL FDB ; ARE FILLED IN ; CARRY SET IF ERROR ENEXT:: TSTB ENFLAG ; SEE IF CONTEXT IS VALID BNE 40$ ; IF NOT, IOT 40$: MOV #ENFDB,R0 ; GET FDB MOV #ENFDB+F.FNB,R1 ; AND FNB MOV #ENAFNB,R2 ; AUX FNB FOR WILD CARD DIRECTORIES BIT #NB.SFL,N.STAT(R1) ; SEE IF ANY WILD CARDS AT ALL BNE 50$ ; BRANCH IF YES CLRB ENFLAG ; ELSE MAKE THE CALL A SINGLE SHOT AFFAIR 50$: MOV N.FVER(R1),N.FID+4(R1) ; COPY OLD VERSION NUMBER BIS #NB.WLV,N.STAT(R1) ; AND SET WILD VERSION INPUT FLAG MOV ENVER,N.FVER(R1) ; RESTORE ORIGINAL VERSION NUMBER CALL .FNDNX ; FIND NEXT FILE ENERR: MOV USRFDB,R2 MOV F.ERR(R0),F.ERR(R2) BCC 70$ 60$: CLRB ENFLAG ; CONTEXT NO LONGER VALID ; NO-FIND (OR MAYBE ERROR) SEC RETURN ; 70$: MOV #LASTFI,R0 ; Address previous FID CMP (R1)+,(R0)+ ; Make sure new one isn't the same BNE 80$ ; No, OK CMP (R1),(R0) ; 2 words BNE 80$ ; OK if either is different MOV #IE.NSF&377,F.ERR(R2) ; Both identical means cycling detected BR 60$ ; Return all found error 80$: MOV (R1),(R0) ; Different, save this FID MOV -(R1),-(R0) ; for next time T70: MOV #ENFDB+F.FNB,R1 MOV USRFDB,R2 MOV #ENDATS,F.DSPT(R2) ADD #F.FNB,R2 MOV #/2,R0 1$: MOV (R1)+,(R2)+ SOB R0,1$ CLC RETURN ; ; .PSECT IMPURE,RW,D ENFDB:: FDBDF$ FDOP$A 1,ENDATS,DN NB.SFL == NB.SD1!NB.SD2!NB.SNM!NB.STP!NB.SVR NB.WLV = 10000 ; WILD CARD VERSION PRESENT FLAG S.WUIC=16. N.WNM2=42 ENAFNB: .BLKB S.FNB+S.WUIC+64. ;AUX NAME BLOCK FOR W/C DIR ENDATS::.BLKW 6 ENVER: .BLKW 1 DN:: NMBLK$ ,,,SY,0 ENFLAG::.WORD 0 USRFDB: .WORD 0 LASTFI: .WORD 0,0 .END