User Tools

Site Tools


cdc:nos2.source:nam5871:nvficsc

NVFICSC

Table Of Contents

  • [00004] PROC NVFICSC
  • [00005] CONTROL STATEMENT CRACKER
  • [00009] CONTROL STATEMENT CRACKER.
  • [00037] PROC NVFIIAP
  • [00038] PROC NVFUCDB
  • [00039] PROC MESSAGE

Source Code

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