cdc:nos2.source:nam5871:ndlwncf
Table of Contents
NDLWNCF
Table Of Contents
- [00004] PROC NDLWNCF(TABLE$ID,WSA,LENGTH)
- [00008] NDL$WNF - WRITE RECORD TO NCF
- [00049] PROC SSTATS
- [00050] PROC RECALL
- [00051] PROC WRITEF
- [00052] PROC WRITER
Source Code
- NDLWNCF.txt
- *DECK NDLWNCF
- USETEXT NDLFETT
- USETEXT NDLTBLT
- PROC NDLWNCF(TABLE$ID,WSA,LENGTH);
- BEGIN
- *IF,DEF,IMS
- #
- ** NDL$WNF - WRITE RECORD TO NCF
- *
- * D.K. ENDO 81/11/10
- *
- * THIS PROCEDURE MAKES AN ENTRY IN NCF INDEX OR LINE RECORD INDEX
- * AND WRITES RECORD TO NCF.
- *
- * PROC NDL$WNF(TABLE$ID,WSA,LENGTH)
- *
- * ENTRY TABLE$ID = NUMBER IDENTIFYING TABLE.
- * WSA = FIRST WORD ADDRESS OF TABLE OR RECORD.
- * IF A BASED ARRAY, THE POINTER WORD ITSELF
- * MUST BE PASSED.
- * LENGTH = LENGTH IN CP WORDS OF TABLE OR RECORD.
- *
- * EXIT NONE.
- *
- * METHOD
- *
- * SELECT CASE THAT APPLIES:
- * CASE1(LINE RECORD)
- * MAKE ENTRY IN LINE RECORD INDEX.
- * WRITE LINE RECORD TO NCF.
- * CASE 2(ALL TABLES EXCEPT NCF INDEX AND LINE RECORDS):
- * MAKE ENTRY IN NCF INDEX.
- * WRITE TABLE/RECORD TO NCF.
- * CASE 3(NCF INDEX):
- * WRITE INDEX TO NCF WITH EOF.
- *
- #
- *ENDIF
- ITEM TABLE$ID; # TABLE/RECORD I.D. #
- ITEM WSA; # FIRST WORD ADDRESS OF TABLE/RECORD #
- # IF A BASED ARRAY, WSA IS THE ACTUAL #
- # POINTER WORD #
- ITEM LENGTH; # LENGTH IN CP WORDS OF TABLE/RECORD #
- #
- **** PROC NDLWNCF - XREF LIST BEGINS.
- #
- XREF
- BEGIN
- PROC SSTATS; # ALLOCATES MORE TABLE SPACE ON REQUEST #
- PROC RECALL; # RETURNS CONTROL WHEN RECALL BIT CLEARED #
- PROC WRITEF; # FLUSH BUFFER, WRITE EOF MARKER #
- PROC WRITER; # FLUSH BUFFER, WRITE EOR MARKER #
- END
- #
- ****
- #
- DEF MAXRT # 12 #; # NUMBER OF ENTRIES IN RECORD-TYPE TABLE #
- ARRAY RECORD$TYPE [0:MAXRT] S(1);
- BEGIN
- ITEM REC$TYPE (0,0,60) = [ , # UNKNOWN #
- O"7700", # FILE HEADER RECORD #
- , # LINE RECORD #
- O"1603", # NCB #
- O"1630", # NPU XREF TABLE #
- O"2010", # PHYSICAL LINK XREF #
- O"1414", # LOGICAL LINK XREF #
- O"1430", # LINE XREF TABLE #
- O"0430", # DEVICE XREF TABLE #
- O"1411", # LINE RECORD INDEX #
- , # NCF INDEX #
- ];
- END
- SWITCH TBLJUMP , # UNKNOWN #
- NCF$ENTRY, # FILE HEADER RECORD #
- LI$ENTRY , # LINE RECORD #
- , # NCB #
- NCF$ENTRY, # NPU XREF TABLE #
- NCF$ENTRY, # PHYSICAL LINK XREF TABLE #
- NCF$ENTRY, # LOGICAL LINK XREF TABLE #
- NCF$ENTRY, # LINE XREF TABLE #
- NCF$ENTRY, # DEVICE XREF TABLE #
- NCF$ENTRY, # LINE RECORD INDEX #
- WRITE$EOF; # NCF INDEX #
- CONTROL EJECT;
- # #
- # CODE BEGINS HERE #
- # #
- GOTO TBLJUMP[TABLE$ID];
- # #
- LI$ENTRY:
- LIWC[1] = LIWC[1] + 1; # INCREMENT INDEX WORD COUNT #
- IF LIWC[1] GQ LI$LENG
- THEN # IF NEED MORE TABLE SPACE FOR ENTRY #
- BEGIN
- SSTATS(P<LIN$REC$INDX>,20); # ALLOCATE MORE SPACE #
- END
- LIWORD[LIWC[1]] = 0; # CLEAR ENTRY WORD #
- LINID[LIWC[1]] = LRNID[2]; # PUT NPU NODE I.D. IN KEY #
- LIPORT[LIWC[1]] = LRPORT[2]; # PUT PORT NUMBER VALUE IN KEY #
- LIGC[LIWC[1]] = LRGC[1]; # PUT GROUP COUNT IN KEY #
- LIRPA[LIWC[1]] = NCFCRI[0]; # PUT SECTOR ADDRESS IN ENTRY #
- GOTO WRITE$EOR;
- NCF$ENTRY:
- NCFWC[0] = NCFWC[0] + 1; # INCREMENT INDEX WORD COUNT #
- IF NCF$LENG LS (NCFWC[0] * NCFENTSZ) + 1
- THEN # IF NEED MORE TABLE SPACE FOR ENTRY #
- BEGIN
- SSTATS(P<NCF$INDEX>,20); # ALLOCATE MORE SPACE #
- END
- NCFWORD[NCFWC[0]] = 0; # FIRST WORD IN ENTRY #
- NCFRT[NCFWC[0]] = REC$TYPE[TABLE$ID]; # PUT RECORD TYPE IN KEY #
- NCFRL[NCFWC[0]] = LENGTH; # PUT RECORD LENGTH IN ENTRY #
- NCFRANINDX[NCFWC[0]] = NCFCRI[0];# PUT SECTOR ADDRESS IN ENTRY #
- GOTO WRITE$EOR;
- WRITE$EOR:
- NCFFIRST[0] = WSA; # POINT FET TO TABLE/RECORD #
- NCFIN[0] = WSA + LENGTH;
- NCFOUT[0] = WSA;
- NCFLIMIT[0] = NCFIN[0] + 1;
- WRITER(NCFFET,0); # WRITE TABLE/RECORD TO NCF FILE#
- RECALL(NCFFET);
- GOTO EXIT;
- WRITE$EOF:
- NCFFIRST[0] = WSA; # POINT FET TO TABLE #
- NCFIN[0] = WSA + LENGTH;
- NCFOUT[0] = WSA;
- NCFLIMIT[0] = NCFIN[0] + 1;
- WRITEF(NCFFET); # WRITE TABLE TO FILE WITH EOF #
- RECALL(NCFFET);
- EXIT:
- RETURN; # **** RETURN **** #
- END # NDLWNCF #
- TERM
cdc/nos2.source/nam5871/ndlwncf.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator