User Tools

Site Tools


cdc:nos2.source:nam5871:ns_cra

NS$CRA

Table Of Contents

  • [00005] PROC NS$CRA
  • [00007] NS$CRA - CONTROL CARD CRACKER.
  • [00011] CONTROL CARD CRACKER.
  • [00052] PROC ABORT
  • [00053] PROC NS$MSG
  • [00054] PROC NS$CVD
  • [00055] PROC NS$CVH

Source Code

NS$CRA.txt
  1. *DECK NS$CRA
  2. USETEXT CYB$NS
  3. USETEXT COM$NS
  4. USETEXT DEF$NS
  5. PROC NS$CRA; # CONTROL CARD CRACKER #
  6.  
  7. # TITLE NS$CRA - CONTROL CARD CRACKER. #
  8.  
  9. BEGIN # NS$CRA #
  10. #
  11. ** NS$CRA - CONTROL CARD CRACKER.
  12. *
  13. * J.C. LEE 1981
  14. *
  15. * THIS ROUTINE IS PART OF THE INITIALIZATIN PROCESS FOR NS.
  16. * ITS FUNCTION IS TO CRACK THE NS CONTROL CARD, SAVE VALID
  17. * VALUES, AND FLAG ERRORS IF FOUND.
  18. *
  19. * PROC NS$CRA
  20. *
  21. * ENTRY:
  22. * ARGUMENT LIST IN COMMUNICATION AREA.
  23. *
  24. * EXIT:
  25. * 1. NIN, NDFCT, NSM, MC, AND RT VALUES
  26. * 2. ERROR MESSAGE(S) SENT IF FOUND.
  27. *
  28. * METHOD:
  29. * LOOP THROUGH THE ARGUMENT LIST. FOR EACH OPTION, SEARCH THE
  30. * PARAMETER TABLE FOR VALID OPTION. IF FOUND, JUMP TO THE
  31. * APPROPRIATE PARAGRAPH TO CONVERT AND SAVE VALUE, ELSE FLAG
  32. * AS ILLEGAL OPTION.
  33. *
  34. #
  35.  
  36. XREF
  37. BEGIN # RA COMMUNICATION AREA #
  38. ARRAY ARG[1:22] S(1);
  39. BEGIN # RA.ARGR #
  40. ITEM ARG$SYMBO U(00,00,NL); # ARGUMENT VALUE #
  41. ITEM ARG$SEPAR U(00,NL,AL); # ARGUMENT SEPARATOR #
  42. ITEM ARG$WORD U(00,00,WL);
  43. END
  44. ARRAY ACT[0:0] S(1);
  45. BEGIN
  46. ITEM ACT$COUNT U(00,NL,AL); # ARGUMENT COUNT #
  47. END
  48. END
  49.  
  50. XREF
  51. BEGIN
  52. PROC ABORT; # ABORT NS #
  53. PROC NS$MSG; # DISPATCH MESSAGE #
  54. PROC NS$CVD; # CONVERT DECIMAL DC TO BINARY #
  55. PROC NS$CVH; # CONVERT HEX DC TO BINARY #
  56. END
  57. #
  58.   DEFINITIONS FOR PARAMETER INDEXES
  59. #
  60. DEF PAR$COUNT #05#; # NUMBER OF VALID NS PARAMETERS #
  61. DEF PAR$NIN #01#; # NIN INDEX #
  62. DEF PAR$NDFCT #02#; # NDFCT INDEX #
  63. DEF PAR$FDP #03#; # NSM INDEX #
  64. DEF PAR$MC #04#; # MC INDEX #
  65. DEF PAR$RT #05#; # RT INDEX #
  66. #
  67.   MISCELLANEOUS DEFINITIONS
  68. #
  69. DEF COMMA # O"56" #;
  70. DEF EQUAL # O"54" #;
  71. DEF PERIOD # O"57" #;
  72. DEF YES #O"31052300000000"#;
  73. DEF NO #O"16170000000000"#;
  74. DEF CT$P #O"20000000000000"#; # FILE CATEGORY = PRIVATE #
  75. DEF CT$S #O"23000000000000"#; # FILE CATEGORY = SEMIPRIVATE#
  76. DEF CT$PU #O"20250000000000"#; # FILE CATEGORY = PUBLIC #
  77. #
  78.   REASON CODES FOR CONTROL CARD ERRORS
  79. #
  80. DEF RC$PARILL #01#; # ILLEGAL PARAMETER #
  81. DEF RC$PARFMT #02#; # PARAMETER FORMAT ERROR #
  82. DEF RC$PARVAL #03#; # BAD PARAMETER VALUE #
  83. DEF RC$PARDUP #04#; # DUPLICATE PARAMETER #
  84. DEF RC$PARMIS #05#; # MISSING REQUIRED PARAMETER #
  85. #
  86.   LOCAL VARIABLES
  87. #
  88. ITEM ARGPTR I = 0; # ARGUMENT POINTER #
  89. ITEM ERR B; # ERROR INDICATOR #
  90. ITEM ERRCODE I = 0; # ERROR CODE #
  91. ITEM I I; # TEMPORARY VARIABLE #
  92. ITEM J U; # TEMPORARY VARIABLE #
  93. ITEM K U; # TEMPORARY VARIABLE #
  94. ITEM MATCH B; # FOUND VALID PARAMETER FLAG #
  95. ITEM NARGS U; # NO OF ARGUMENTS #
  96. ARRAY PAR [1:PAR$COUNT] S(1);
  97. BEGIN # VALID PARAMETER LIST #
  98. ITEM PAR$KEY U(00,00,42) = [ # KEYWORDS #
  99. O"16111600000000", # NIN #
  100. O"16040603240000", # NDFCT #
  101. O"06042000000000", # FDP #
  102. O"15030000000000", # MC #
  103. O"22240000000000", # RT #
  104. ];
  105. ITEM PAR$NCV U(00,42,12) = [ # CHARS ALLOWED FOR PARAM VALUE#
  106. 3, # UP TO 3 DEC CHARS FOR NIN #
  107. 2, # UP TO 2 CHARS FOR NDFCT #
  108. 3, # UP TO 3 CHARS FOR FDP #
  109. 7, # UP TO 7 DEC CHARS FOR MC #
  110. 3, # UP TO 3 CHARS FOR RT #
  111. ];
  112. ITEM PAR$PRC B(00,54,06) = [ # PARAMETER PROCESSED FLAG #
  113. FALSE,
  114. FALSE,
  115. FALSE,
  116. FALSE,
  117. FALSE,
  118. ];
  119. END
  120. DEF L$PARERR # 5 #;
  121. DEF DM$PARERR # DM$SYSLOC+DM$ABORT #;
  122. ARRAY MSG$PARERR [RC$PARILL:RC$PARMIS] S(L$PARERR);
  123. BEGIN # CONTROL CARD ERROR DIAGNOSTICS #
  124. ITEM PEM$TEXT C(00,00,40) = [ # MESSAGE TEXT #
  125. "NS/UNRECOGNIZED CONTROL CARD PARAMETER.",
  126. "NS/CONTROL CARD PARAMETER SYNTAX ERROR.",
  127. "NS/ILLEGAL CONTROL CARD PARAMETER VALUE.",
  128. "NS/DUPLICATE CONTROL CARD PARAMETER.",
  129. "NS/NIN IS NOT SPECIFIED.",
  130. ];
  131. ITEM PEM$END U(04,00,60) = [ RC$PARMIS(0) ];
  132. END
  133.  
  134. BASED ARRAY DUMMY [1:PAR$COUNT] S(1);
  135. BEGIN
  136. ITEM PARAMWORD U(00,00,60);
  137. END
  138. SWITCH PARTYPE , # SWITCHES FOR PARAMETERS #
  139. TYPE$NIN,
  140. TYPE$NDFCT,
  141. TYPE$FDP,
  142. TYPE$MC,
  143. TYPE$RT;
  144. CONTROL EJECT;
  145. #
  146.   LOOP TO PROCESS ALL SPECIFIED PARAMETERS
  147. #
  148. NARGS = ACT$COUNT[0]; # NO OF ARGUMENTS #
  149. FOR ARGPTR=ARGPTR WHILE ARGPTR LS NARGS
  150. AND ERRCODE EQ 0
  151. DO # SCAN RA+2 THRU RA+22 FOR ARGUMENTS #
  152. BEGIN
  153. ARGPTR = ARGPTR + 1; # MOVE POINTER TO NEXT ARGUMENT #
  154. MATCH = FALSE;
  155.  
  156. FOR I=1 STEP 1 WHILE I LQ PAR$COUNT
  157. AND NOT MATCH
  158. DO
  159. BEGIN
  160. IF ARG$SYMBO[ARGPTR] EQ PAR$KEY[I]
  161. THEN # FOUND VALID KEYWORD #
  162. BEGIN
  163. MATCH = TRUE;
  164. K = I; # SET TO KEYWORD INDEX #
  165. END
  166. END
  167.  
  168. IF MATCH
  169. THEN # FOUND VALID PARAMETER #
  170. BEGIN
  171. I = ARGPTR + 1; # POINTER TO PARAMETER VALUE #
  172.  
  173. IF (ARG$SEPAR[ARGPTR] EQ EQUAL)
  174. AND (I LQ NARGS)
  175. THEN # PARAMETER FORMAT OK #
  176. BEGIN
  177. ARGPTR = I; # UPDATE POINTER TO NEXT ARG #
  178. J = PAR$NCV[K]; # CHARS ALLOWED FOR VALUE #
  179.  
  180. IF J EQ NC
  181. OR C<J,NC-J>ARG$SYMBO[ARGPTR] EQ 0
  182. THEN # PARAMETER VALUE NOT EXCEEDING #
  183. BEGIN # MAX NUMBER OF CHARS ALLOWED #
  184. #
  185.   SWITCH TO PARAMETER PROCESSING CASES
  186. #
  187. GOTO PARTYPE[K];
  188. TYPE$NIN:
  189. I = PAR$NIN;
  190. NS$CVD(ARG$WORD[ARGPTR],K,J,ERR); # CONVERT DEC TO BIN #
  191. ZDMBID$NIN[0] = K; # SET NETWORK INVOCATION NUMBER #
  192. B<0,18>K = J + O"333333";# SET TO DISPLAY-CODED DEC #
  193. GOTO ENDPRC;
  194. TYPE$NDFCT:
  195. I = PAR$NDFCT;
  196. IF ARG$SYMBO[ARGPTR] EQ CT$P
  197. THEN # FILE CATEGORY IS PRIVATE #
  198. K = 0;
  199. ELSE
  200. BEGIN
  201. IF ARG$SYMBO[ARGPTR] EQ CT$S
  202. THEN # FILE CATEGORY IS SEMIPRIVATE #
  203. K = 1;
  204. ELSE
  205. BEGIN
  206. IF ARG$SYMBO[ARGPTR] EQ CT$PU
  207. THEN # FILE CATEGORY IS PUBLIC #
  208. K = 2;
  209. ELSE # UNRECOGNIZED PARAMETER VALUE #
  210. ERR = TRUE;
  211. END
  212. END
  213. GOTO ENDPRC;
  214. TYPE$FDP:
  215. I = PAR$FDP;
  216. GOTO CHECKYN;
  217. TYPE$MC:
  218. I = PAR$MC;
  219. NS$CVD(ARG$WORD[ARGPTR],K,J,ERR) ; # CONVERT DEC TO BIN #
  220. GOTO ENDPRC;
  221. TYPE$RT:
  222. I = PAR$RT;
  223. CHECKYN:
  224. IF ARG$SYMBO[ARGPTR] EQ YES
  225. THEN
  226. K = ASC$YY; # PARAMETER VALUE IS -YES- #
  227.  
  228. ELSE
  229. BEGIN
  230. IF ARG$SYMBO[ARGPTR] EQ NO
  231. THEN
  232. K = ASC$NN; # PARAMETER VALUE IS -NO- #
  233.  
  234. ELSE
  235. ERR = TRUE; # BAD PARAMETER VALUE #
  236. END
  237. ENDPRC:
  238. IF NOT ERR
  239. THEN # NO ERROR FOUND #
  240. BEGIN
  241. IF NOT PAR$PRC[I]
  242. THEN # PARAMETER NOT PROCESSED #
  243. BEGIN
  244. PAR$PRC[I] = TRUE; # SET PARAMETER PROCESSED FLAG #
  245. P<DUMMY> = LOC(NIN);
  246. PARAMWORD[I] = K; # STORE PARAM VALUE IN COMMON #
  247. END
  248.  
  249. ELSE # DUPLICATE PARAMETER #
  250. ERRCODE = RC$PARDUP;
  251. END
  252.  
  253. ELSE # BAD PARAMETER VALUE #
  254. ERRCODE = RC$PARVAL;
  255. END
  256.  
  257. ELSE # CHARS EXCEED ALLOWED VALUE #
  258. ERRCODE = RC$PARVAL;
  259. END
  260.  
  261. ELSE # PARAMETER FORMAT ERROR #
  262. ERRCODE = RC$PARFMT;
  263. END
  264.  
  265. ELSE # ILLEGAL PARAMETER #
  266. ERRCODE = RC$PARILL;
  267. END
  268.  
  269. IF ERRCODE EQ 0
  270. AND NOT PAR$PRC[PAR$NIN]
  271. THEN # NIN MUST BE SPECIFIED #
  272. ERRCODE = RC$PARMIS;
  273.  
  274. IF ERRCODE NQ 0
  275. THEN # ERROR FOUND #
  276. NS$MSG(MSG$PARERR[ERRCODE],L$PARERR,DM$PARERR);
  277. RETURN;
  278. END
  279. TERM
cdc/nos2.source/nam5871/ns_cra.txt · Last modified: 2023/08/05 17:22 by Site Administrator