User Tools

Site Tools


cdc:nos2.source:nam5871:ns_hfi

NS$HFI

Table Of Contents

  • [00008] PROC NS$HFI(REASON)
  • [00010] NS$HFI - ALTERNATE LOAD FILE COMMAND PROCESSOR.
  • [00014] ALTERNATE LOAD FILE COMMAND PROCESSOR.
  • [00050] PROC NS$DBG
  • [00056] FUNC ATTACH
  • [00057] PROC NS$TKD
  • [00058] FUNC NS$XZFN C(10)
  • [00059] PROC READ
  • [00060] PROC READW
  • [00061] PROC RECALL
  • [00062] PROC REQTSB
  • [00063] PROC RETERN
  • [00064] PROC RETTSB
  • [00065] PROC SKIPB
  • [00066] PROC SKIPEI

Source Code

NS$HFI.txt
  1. *DECK NS$HFI
  2. USETEXT DEF$NS
  3. USETEXT DIR$NS
  4. USETEXT HOC$NS
  5. USETEXT LIN$NS
  6. USETEXT NPT$NS
  7. USETEXT PRF$NS
  8. PROC NS$HFI(REASON); # ALTERNATE LOAD FILE COMMAND PROCESSOR #
  9.  
  10. # TITLE NS$HFI - ALTERNATE LOAD FILE COMMAND PROCESSOR. #
  11.  
  12. BEGIN # NS$HFI #
  13. #
  14. ** NS$HFI - ALTERNATE LOAD FILE COMMAND PROCESSOR.
  15. *
  16. * J.C. LEE 1981
  17. *
  18. * PROC NS$HFI(REASON)
  19. *
  20. * ENTRY:
  21. * NONE.
  22. *
  23. * EXIT:
  24. * REASON - REASON CODE, POSSIBLE REASONS ARE:
  25. * - NPU NOT SPECIFIED IN COMMAND.
  26. * - SPECIFIED NPU NOT CONFIGURED/NOT FOUND
  27. * - ALTERNATE NLF NOT SPECIFIED IN COMMAND.
  28. * - FILE ATTACH NOT SUCCESSFUL.
  29. * - BAD NLF FILE FORMAT.
  30. * - SPECIFIED NPU ACTIVE, CANNOT ACTION COMMAND.
  31. *
  32. * METHOD:
  33. * SEARCH SPECIFIED NPU IN NPU TABLE.
  34. * ATTACH SPECIFIED ALTERNATE NLF.
  35. * GET CIO BUFFER.
  36. * READ THE ALTERNATE NLF.
  37. * IF SPECIFIED NLF NOT CURRENTLY ACTIVE, SEND ALTERNATE NLF
  38. * VERSION MESSAGE TO *KDB*.
  39. * READ NLF DIRECTORY TO TSB.
  40. * SAVE DIRECTORY TSBN.
  41. * RELEASE CIO BUFFER.
  42. *
  43. #
  44.  
  45. ITEM REASON U; # FILE COMMAND ERROR REASON CODE #
  46.  
  47. $BEGIN
  48. XREF
  49. BEGIN
  50. PROC NS$DBG; # TRACE CALL #
  51. END
  52. $END
  53.  
  54. XREF
  55. BEGIN
  56. FUNC ATTACH; # ATTACH FILE TO CONTROL POINT #
  57. PROC NS$TKD; # TRANSFER DATA TO K DISPLAY BUFFER #
  58. FUNC NS$XZFN C(10); # ZERO-FILLED WORD #
  59. PROC READ; # READ FILE #
  60. PROC READW; # TRANSFER DATA #
  61. PROC RECALL; # WAIT TILL I/O COMPLETES #
  62. PROC REQTSB; # REQUEST TSB #
  63. PROC RETERN; # RETURN FILE #
  64. PROC RETTSB; # RELEASE TSB #
  65. PROC SKIPB; # SKIP FILE BACKWARDS #
  66. PROC SKIPEI; # SKIP TILL EOI #
  67. END
  68.  
  69. DEF L$ALFBUF # O"101" #; # SIZE OF CIO BUFFER #
  70. DEF PRF$7700L # 15 #; # SIZE OF 77 TABLE IN NLF #
  71.  
  72. ITEM DIRTSBN U; # DIRECTORY TSB NUMBER #
  73. ITEM I U; # TEMPORARY #
  74. ITEM NPTINDEX U; # NPU TABLE ENTRY INDEX #
  75. ITEM NPTCOUNT U; # NPU TABLE ENTRY COUNT #
  76. ITEM NPUNAME C(7); # NPU NAME #
  77. ITEM PFN C(7); # PFN OF ALTERNATE LOAD FILE #
  78. ITEM PW C(7); # PASSWORD OF ALTERNATE LOAD FILE #
  79. ITEM STAT U; # RETURN STATUS #
  80. ITEM TSBFWA U; # TSB FWA #
  81. ITEM TSBN U; # TSB NUMBER #
  82. ITEM UN C(7); # USER NAME OF ALTERNATE LOAD FILE #
  83.  
  84. ARRAY ALF$FET[0:0]S(5);
  85. BEGIN # ALTERNATE LOAD FILE FET #
  86. ITEM FET$LFN C(00,00,07); # LOGICAL FILE NAME #
  87. ITEM FET$FM B(00,58,01) = [TRUE]; # BINARY FILE MODE #
  88. ITEM FET$COMP B(00,59,01) = [TRUE]; # COMPLETION BIT #
  89. ITEM FET$RAN B(01,12,01) = [TRUE]; # RANDOM FILE #
  90. ITEM FET$FIRST I(01,42,18); # FIRST POINTER #
  91. ITEM FET$IN I(02,42,18); # IN PONTER #
  92. ITEM FET$OUT I(03,42,18); # OUT POINTER #
  93. ITEM FET$LIMIT I(04,42,18); # LIMIT POINTER #
  94. END
  95.  
  96. DEF L$FVERSION # 5 #; # LENGTH OF FILE VERSION MESSAGE #
  97. ARRAY FILVERSION[0:0]S(L$FVERSION);
  98. BEGIN # ALTERNATE FILE VERSION MESSAGE #
  99. ITEM FVER$LNHDR U(00,00,60); # LINE HEADER WORD #
  100. ITEM FVER$LNID U(00,00,24) = [LIN$IDENT]; # LINE ID #
  101. ITEM FVER$LNSIZ U(00,42,18) = [L$FVERSION]; # SIZE #
  102. ITEM FVER$TEXT C(01,00,38) = # MESSAGE TEXT #
  103. ["FILENAM VERSION - YY/MM/DD, HH.MM.SS."];
  104. ITEM FVER$PFN C(01,00,07); # ALTERNATE NLF PFN #
  105. ITEM FVER$DATE C(02,48,08); # CREATION DATE #
  106. ITEM FVER$TIME C(03,48,08); # CREATION TIME #
  107. ITEM FVER$TERM U(04,48,12) = [0]; # LINE TERMINATOR #
  108. END
  109.  
  110.  
  111. CONTROL EJECT;
  112. $BEGIN
  113. NS$DBG("HFI"); # TRACE CALL #
  114. $END
  115.  
  116. REASON = 0;
  117. NPUNAME = CMD$NPUNAM[PAR$NPU]; # NPU NAME #
  118.  
  119. IF NPUNAME NQ 0
  120. THEN # NPU NAME IS SPECIFIED IN COMMAND #
  121. BEGIN
  122. NPTCOUNT = NPT$EC[0]; # NPU TABLE ENTRY COUNT #
  123. NPTINDEX = 0; # NPU TABLE ENTRY INDEX #
  124.  
  125. FOR I = 1 STEP 1 WHILE I LQ NPTCOUNT
  126. AND NPTINDEX EQ 0
  127. DO # SEARCH NPU TABLE FOR SPECIFIED NPU #
  128. BEGIN
  129. IF NPT$NPNAME[I] EQ NPUNAME
  130. THEN # NPU NAME MATCH, ENTRY FOUND #
  131. NPTINDEX = I; # SAVE NPU ENTRY INDEX #
  132. END
  133.  
  134. IF NPTINDEX NQ 0
  135. THEN # FOUND SPECIFIED NPU #
  136. BEGIN
  137.  
  138. IF CMD$WORD[PAR$NLF] NQ 0
  139. THEN # ALTERNATE NLF MUST BE SPECIFIED #
  140. BEGIN # TRY ATTACHING SPECIFIED FILE #
  141. PFN = NS$XZFN(CMD$NLFPFN[PAR$NLF]); # ZERO-FILLED PFN #
  142. UN = NS$XZFN(CMD$NLFUN[PAR$UN]); # ZERO-FILLED UN #
  143. PW = NS$XZFN(CMD$NLFPW[PAR$PW]); # ZERO-FILLED PASSWORD #
  144. IF CMD$WORD[PAR$PW] EQ 0
  145. THEN # USE DEFAULT PASSWORD FOR ATTACH CALL #
  146. CMD$NLFPW[PAR$PW] = "DEFAULT";
  147. STAT = ATTACH(PFN,PFN,UN,PW,1); # ATTACH SPECIFIED NLF #
  148.  
  149. IF STAT EQ 0
  150. THEN # FILE ATTACH IS SUCCESSFUL #
  151. BEGIN # VALIDATE CCP LOAD FILE #
  152. REQTSB(L$ALFBUF,TSBFWA,TSBN); # GET CIO BUFFER #
  153. FET$LFN[0] = PFN; # SET LFN OF ALTERNATE LOAD FILE #
  154. FET$FIRST[0] = TSBFWA; # SET FET TO READ ALTERNATE NLF #
  155. FET$IN[0] = TSBFWA;
  156. FET$OUT[0] = TSBFWA;
  157. FET$LIMIT[0] = TSBFWA + L$ALFBUF;
  158. SKIPEI(ALF$FET); # SKIP FILE TILL EOI #
  159. SKIPB(ALF$FET,2); # POITION AT DIRECTORY RECORD #
  160. READ(ALF$FET); # READ NLF DIRECTORY RECORD #
  161. RECALL(ALF$FET); # WAIT TILL I/O COMPLETES #
  162.  
  163. P<PRF$TABLE> = TSBFWA; # FWA OF PREFIX TABLE #
  164. P<DIR> = TSBFWA + PRF$7700L; # FWA OF NLF DIRECTORY #
  165. IF PRF$ID[0] EQ PRF$IDENT # PREFIX TABLE ID OK #
  166. AND DIR$FID[0] EQ LFN$NLF # FILE IDENTIFIER OK #
  167. THEN # VALID NLF #
  168. BEGIN
  169. IF NPT$NATTSB[NPTINDEX] EQ 0
  170. THEN # NPU CURRENTLY NOT ACTIVE, PROCEED #
  171. BEGIN
  172. FVER$PFN[0] = CMD$NLFPFN[PAR$NLF]; # FORMAT MESSAGE #
  173. FVER$DATE[0] = PRF$DATE[0]; # SET FILE CREATION DATE #
  174. FVER$TIME[0] = PRF$TIME[0]; # SET FILE CREATION TIME #
  175. NS$TKD(FILVERSION,L$FVERSION,1); # SEND LINE TO KDB #
  176.  
  177. I = DIR$WC[0] + 1; # SIZE OF DIRECTORY RECORD #
  178. REQTSB(I,TSBFWA,DIRTSBN); # GET TSB FOR DIRECTORY #
  179. FET$OUT[0] = P<DIR>; # SET TO FWA OF DIRECTORY #
  180. P<DIR> = TSBFWA; # FWA OF DIRECTORY RECORD #
  181. READW(ALF$FET,DIR,I,STAT); # READ DIRECTORY TO TSB #
  182.  
  183. IF NPT$ALFWD[NPTINDEX] NQ 0
  184. THEN # AN ALTERNATE NLF CURRENTLY EXISTS #
  185. BEGIN # RELEASE CURRENT NLF DIRECTORY TSB #
  186. RETTSB(NPT$DIRTSB[NPTINDEX]);
  187. FET$LFN[0] = NS$XZFN(NPT$ALFPFN[NPTINDEX]);
  188. RETERN(ALF$FET); # RETURN OLD ALTERNATE NLF #
  189. NPT$ALFWD[NPTINDEX] = 0; # CLEAR ALTERNATE NLF WORD#
  190. END
  191.  
  192. NPT$ALFPFN[NPTINDEX] = CMD$NLFPFN[PAR$NLF];
  193. NPT$DIRTSB[NPTINDEX] = DIRTSBN; # SAVE DIR TSBN #
  194. RETTSB(TSBN); # RELEASE CIO BUFFER #
  195. END
  196.  
  197. ELSE # NPU ACTIVE, CANNOT ACTION COMMAND #
  198. REASON = HOPCMDERR"NPUACTIVE";
  199. END
  200.  
  201. ELSE # BAD NLF DIRECTORY RECORD #
  202. REASON = HOPCMDERR"NLFBAD"; # BAD NLF FILE FORMAT #
  203. END
  204.  
  205. ELSE # FILE ATTACH IS NOT SUCCESSFUL #
  206. REASON = HOPCMDERR"NLFNAVAIL"; # NLF NOT AVAILABLE #
  207. END
  208.  
  209. ELSE # ALTERNATE LOAD FILE IS NOT SPECIFIED #
  210. REASON = HOPCMDERR"NLFNSPEC";
  211. END
  212.  
  213. ELSE # NPU NOT FOUND, SPECIFIED NPU NOT CONFIGURED #
  214. REASON = HOPCMDERR"NPUNCNFG";
  215. END
  216.  
  217. ELSE # NPU MUST BE SPECIFIED IN COMMAND #
  218. REASON = HOPCMDERR"NPUNSPEC";
  219.  
  220. RETURN;
  221. END # NS$HFI #
  222. TERM
cdc/nos2.source/nam5871/ns_hfi.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator