User Tools

Site Tools


cdc:nos2.source:nam5871:ndlwncf

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
  1. *DECK NDLWNCF
  2. USETEXT NDLFETT
  3. USETEXT NDLTBLT
  4. PROC NDLWNCF(TABLE$ID,WSA,LENGTH);
  5. BEGIN
  6. *IF,DEF,IMS
  7. #
  8. ** NDL$WNF - WRITE RECORD TO NCF
  9. *
  10. * D.K. ENDO 81/11/10
  11. *
  12. * THIS PROCEDURE MAKES AN ENTRY IN NCF INDEX OR LINE RECORD INDEX
  13. * AND WRITES RECORD TO NCF.
  14. *
  15. * PROC NDL$WNF(TABLE$ID,WSA,LENGTH)
  16. *
  17. * ENTRY TABLE$ID = NUMBER IDENTIFYING TABLE.
  18. * WSA = FIRST WORD ADDRESS OF TABLE OR RECORD.
  19. * IF A BASED ARRAY, THE POINTER WORD ITSELF
  20. * MUST BE PASSED.
  21. * LENGTH = LENGTH IN CP WORDS OF TABLE OR RECORD.
  22. *
  23. * EXIT NONE.
  24. *
  25. * METHOD
  26. *
  27. * SELECT CASE THAT APPLIES:
  28. * CASE1(LINE RECORD)
  29. * MAKE ENTRY IN LINE RECORD INDEX.
  30. * WRITE LINE RECORD TO NCF.
  31. * CASE 2(ALL TABLES EXCEPT NCF INDEX AND LINE RECORDS):
  32. * MAKE ENTRY IN NCF INDEX.
  33. * WRITE TABLE/RECORD TO NCF.
  34. * CASE 3(NCF INDEX):
  35. * WRITE INDEX TO NCF WITH EOF.
  36. *
  37. #
  38. *ENDIF
  39. ITEM TABLE$ID; # TABLE/RECORD I.D. #
  40. ITEM WSA; # FIRST WORD ADDRESS OF TABLE/RECORD #
  41. # IF A BASED ARRAY, WSA IS THE ACTUAL #
  42. # POINTER WORD #
  43. ITEM LENGTH; # LENGTH IN CP WORDS OF TABLE/RECORD #
  44. #
  45. **** PROC NDLWNCF - XREF LIST BEGINS.
  46. #
  47. XREF
  48. BEGIN
  49. PROC SSTATS; # ALLOCATES MORE TABLE SPACE ON REQUEST #
  50. PROC RECALL; # RETURNS CONTROL WHEN RECALL BIT CLEARED #
  51. PROC WRITEF; # FLUSH BUFFER, WRITE EOF MARKER #
  52. PROC WRITER; # FLUSH BUFFER, WRITE EOR MARKER #
  53. END
  54. #
  55. ****
  56. #
  57. DEF MAXRT # 12 #; # NUMBER OF ENTRIES IN RECORD-TYPE TABLE #
  58. ARRAY RECORD$TYPE [0:MAXRT] S(1);
  59. BEGIN
  60. ITEM REC$TYPE (0,0,60) = [ , # UNKNOWN #
  61. O"7700", # FILE HEADER RECORD #
  62. , # LINE RECORD #
  63. O"1603", # NCB #
  64. O"1630", # NPU XREF TABLE #
  65. O"2010", # PHYSICAL LINK XREF #
  66. O"1414", # LOGICAL LINK XREF #
  67. O"1430", # LINE XREF TABLE #
  68. O"0430", # DEVICE XREF TABLE #
  69. O"1411", # LINE RECORD INDEX #
  70. , # NCF INDEX #
  71. ];
  72. END
  73. SWITCH TBLJUMP , # UNKNOWN #
  74. NCF$ENTRY, # FILE HEADER RECORD #
  75. LI$ENTRY , # LINE RECORD #
  76. , # NCB #
  77. NCF$ENTRY, # NPU XREF TABLE #
  78. NCF$ENTRY, # PHYSICAL LINK XREF TABLE #
  79. NCF$ENTRY, # LOGICAL LINK XREF TABLE #
  80. NCF$ENTRY, # LINE XREF TABLE #
  81. NCF$ENTRY, # DEVICE XREF TABLE #
  82. NCF$ENTRY, # LINE RECORD INDEX #
  83. WRITE$EOF; # NCF INDEX #
  84. CONTROL EJECT;
  85. # #
  86. # CODE BEGINS HERE #
  87. # #
  88. GOTO TBLJUMP[TABLE$ID];
  89. # #
  90. LI$ENTRY:
  91. LIWC[1] = LIWC[1] + 1; # INCREMENT INDEX WORD COUNT #
  92. IF LIWC[1] GQ LI$LENG
  93. THEN # IF NEED MORE TABLE SPACE FOR ENTRY #
  94. BEGIN
  95. SSTATS(P<LIN$REC$INDX>,20); # ALLOCATE MORE SPACE #
  96. END
  97. LIWORD[LIWC[1]] = 0; # CLEAR ENTRY WORD #
  98. LINID[LIWC[1]] = LRNID[2]; # PUT NPU NODE I.D. IN KEY #
  99. LIPORT[LIWC[1]] = LRPORT[2]; # PUT PORT NUMBER VALUE IN KEY #
  100. LIGC[LIWC[1]] = LRGC[1]; # PUT GROUP COUNT IN KEY #
  101. LIRPA[LIWC[1]] = NCFCRI[0]; # PUT SECTOR ADDRESS IN ENTRY #
  102. GOTO WRITE$EOR;
  103. NCF$ENTRY:
  104. NCFWC[0] = NCFWC[0] + 1; # INCREMENT INDEX WORD COUNT #
  105. IF NCF$LENG LS (NCFWC[0] * NCFENTSZ) + 1
  106. THEN # IF NEED MORE TABLE SPACE FOR ENTRY #
  107. BEGIN
  108. SSTATS(P<NCF$INDEX>,20); # ALLOCATE MORE SPACE #
  109. END
  110. NCFWORD[NCFWC[0]] = 0; # FIRST WORD IN ENTRY #
  111. NCFRT[NCFWC[0]] = REC$TYPE[TABLE$ID]; # PUT RECORD TYPE IN KEY #
  112. NCFRL[NCFWC[0]] = LENGTH; # PUT RECORD LENGTH IN ENTRY #
  113. NCFRANINDX[NCFWC[0]] = NCFCRI[0];# PUT SECTOR ADDRESS IN ENTRY #
  114. GOTO WRITE$EOR;
  115. WRITE$EOR:
  116. NCFFIRST[0] = WSA; # POINT FET TO TABLE/RECORD #
  117. NCFIN[0] = WSA + LENGTH;
  118. NCFOUT[0] = WSA;
  119. NCFLIMIT[0] = NCFIN[0] + 1;
  120. WRITER(NCFFET,0); # WRITE TABLE/RECORD TO NCF FILE#
  121. RECALL(NCFFET);
  122. GOTO EXIT;
  123. WRITE$EOF:
  124. NCFFIRST[0] = WSA; # POINT FET TO TABLE #
  125. NCFIN[0] = WSA + LENGTH;
  126. NCFOUT[0] = WSA;
  127. NCFLIMIT[0] = NCFIN[0] + 1;
  128. WRITEF(NCFFET); # WRITE TABLE TO FILE WITH EOF #
  129. RECALL(NCFFET);
  130. EXIT:
  131. RETURN; # **** RETURN **** #
  132. END # NDLWNCF #
  133. TERM
cdc/nos2.source/nam5871/ndlwncf.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator