*DECK NS$IDN
USETEXT COM$NS
USETEXT DEF$NS
USETEXT LTSB$NS
PROC NS$IDN; # INITIATE NPU DUMP FILE INDEX #
# TITLE NS$IDN - INITIATE NPU DUMP FILE INDEX. #
BEGIN # NS$IDN #
#
** NS$IDN - INITIATE NPU DUMP FILE INDEX.
*
* J.C. LEE 1981
*
* THIS ROUTINE INITIATES NPU DUMP FILE INDEX.
*
* PROC NS$IDN
*
* ENTRY:
* NONE.
*
* EXIT:
* NONE.
*
* METHOD:
* DETERMINE IF A CATLIST ENTRY IS AN NPU DUMP FILE, I.E.
* NP(NIN)XX. IF AN NPU DUMP FILE IS FOUND, FLAG THE DUMP
* FILE INDEX IN THE NPU DUMP FILE INDEX BIT-MAP TO
* INDICATE THE INDEX IS IN USE. CATLIST THE DUMP FILE.
* IF DUMP INDEX FULL, DAYFILE MESSAGE AND ABORT NS.
*
#
XREF
BEGIN
PROC NS$CAT; # ISSUE CATLIST MACRO CALL #
PROC NS$MSG; # DISPATCH MESSAGE #
END
DEF CATESIZE # 16 #; # CATLIST ENTRY SIZE #
DEF CHAR$F # 06 #; # DISPLAY-CODED ALPHA F #
ITEM DONE B = FALSE; # DUMP FILE INDEX FOUND FLAG #
ITEM HEXCHAR1 U; # HEX CHARACTER 1 #
ITEM HEXCHAR2 U; # HEX CHARACTER 2 #
ITEM I I; # TEMPORARY #
ITEM J I; # TEMPORARY #
ITEM K I; # TEMPORARY #
DEF L$DNERR # 2 #;
DEF DM$DNERR # DM$ABORT+DM$SYSLOC #;
ARRAY MSG$DNERR [0:0] S(L$DNERR);
BEGIN
ITEM DNERR$TEXT C(00,00,17) = # MESSAGE TEXT #
["DUMP INDEX FULL."];
ITEM DNERR$END U(01,42,18) = [0]; # END OF TEXT #
END
ARRAY FBUFFER [0:PRUSIZE] S(1) ;
BEGIN # CIO BUFFER FOR USER CATALOG DATA #
ITEM PFNAME C(0,0,7) ; # PERM. FILE NAME #
ITEM PFNAME1 C(0,0,2) ; # FIRST 2 CHARS #
ITEM PFNIN C(0,12,3) ; # NEXT 3 CHARS ( NIN) #
ITEM DUMPID U(0,30,12); # DUMP INDEX #
ITEM ID1 U(0,30,6) ; # FIRST HEX CHARACTER #
ITEM ID2 U(0,36,6) ; # SECOND HEX CHARACTER #
ITEM FILETYPE B(0,48,1) ;
END
ARRAY FET [1:L$LFET] S(1) ;
BEGIN # FET FOR CATLIST MACRO CALL #
ITEM WORD1 U(0,0,60) = [L$LFET(0)] ;
END
ARRAY BITDUMP [0:4] S(1) ;
BEGIN # BIT MAP FOR ACTIVE NPU DUMP FILE INDEX #
ITEM WORDX U(0,0,60) = [5(0)] ;
END
CONTROL EJECT;
#
SET UP FET FOR CATLIST CALL
#
P<LTSB$FET> = LOC(FET); # FET ADDRESS #
LFET$LFN[0] = "ZZZZZZZ" ;
LFET$FM[0] = TRUE ;
LFET$COMP[0] = TRUE ;
LFET$LEN[0] = L$LFET - 5 ;
LFET$FIRST[0] = LOC(FBUFFER) ;
LFET$LIMIT[0] = LOC(FBUFFER) + PRUSIZE + 1 ;
#
DETERMINE IF A CATLIST ENTRY IS AN NPU DUMP FILE IE. NP(NIN)XX
WHERE XX ARE DISPLAY-CODED HEXADECIMAL CHARACTERS.
IF AN NPU DUMP FILE IS FOUND, FLAG THE DUMP FILE INDEX IN THE
NPU DUMP FILE INDEX BIT MAP TO INDICATE THE INDEX IS IN USE.
#
FOR J = J WHILE LFET$CODE[0] NQ O"1033"
DO # PROCESS USER CATALOG UNTIL EOI REACHED #
BEGIN
NS$CAT(FET) ; # DO THE CATLIST #
FOR I = 0 STEP CATESIZE WHILE I LS (LFET$IN[0] - LFET$OUT[0])
DO
BEGIN
IF FILETYPE[I+1] # DIRECT ACCRESS FILE #
AND PFNAME1[I] EQ "NP" # IT IS NPU DUMP FILE #
AND PFNIN[I] EQ NIN # SAME NIN #
THEN
BEGIN # AN ACTIVE NPU DUMP FILE FOUND #
HEXCHAR1 = ID1[I]; # FIRST HEX CHARACTER OF DUMP INDEX #
HEXCHAR2 = ID2[I]; # NEXT HEX CHARACTER OF DUMP INDEX #
IF HEXCHAR1 LQ CHAR$F
THEN # ITS A HEX CHARACTER A THROUGH F #
HEXCHAR1 = HEXCHAR1 + 9;
ELSE # ITS A HEX CHARACTER 0 THROUGH 9 #
HEXCHAR1 = HEXCHAR1 - O"33";
IF HEXCHAR2 LQ CHAR$F
THEN
HEXCHAR2 = HEXCHAR2 + 9;
ELSE
HEXCHAR2 = HEXCHAR2 - O"33";
K = HEXCHAR1*16 + HEXCHAR2; # DUMP INDEX VALUE #
J = K / 60 ;
K = K - ( J * 60 ) ;
B<K,1>WORDX[J] = 1 ;
END
END
END
#
FIND THE FIRST FREE DUMP FILE INDEX FROM THE BIT MAP
#
FOR I=0 STEP 1 WHILE NOT DONE
AND I LQ MAX$NDFDN
DO # SCAN THROUGH THE BIT MAP #
BEGIN # TO LOCATE THE FIRST FREE DUMP INDEX #
J = I/60; # BIT MAP WORD INDEX #
K = I - (J*60); # BIT POSITION IN WORD #
IF B<K,1>WORDX[J] EQ 0
THEN # FOUND FREE DUMP INDEX #
BEGIN # SET DUMP NUMBER FOR NEXT NPU DUMP #
DN = I;
DONE = TRUE;
END
END # END FOR LOOP #
IF NOT DONE
THEN # DUMP INDEX FULL, ABORT NS #
NS$MSG(MSG$DNERR,L$DNERR,DM$DNERR); # DAYFILE AND ABORT #
RETURN;
END # NS$IND #
TERM