User Tools

Site Tools


cdc:nos2.source:nam5871:nvfopac

NVFOPAC

Table Of Contents

  • [00008] PROC NVFOPAC
  • [00013] PERFORM APPLICATION COMMAND.
  • [00046] PROC NVFOFAD
  • [00047] PROC NVFOPSS
  • [00048] PROC NVFUMQE
  • [00049] PROC SSTAQE
  • [00050] PROC SSTETS
  • [00051] PROC SSTRTS

Source Code

NVFOPAC.txt
  1. *DECK NVFOPAC
  2. USETEXT TEXTNVF
  3. USETEXT TEXTSS
  4. USETEXT TXCMDNV
  5. USETEXT TXSMNVF
  6. USETEXT TXTAPSS
  7.  
  8. PROC NVFOPAC;
  9. # TITLE NVFOPAC - PERFORM APPLICATION COMMAND. #
  10.  
  11. BEGIN # NVFOPAC #
  12. #
  13. ** NVFOPAC - PERFORM APPLICATION COMMAND.
  14. *
  15. * A. LIM. 82/03/24.
  16. * C. BRION 83/04/26. 83/12/22.
  17. *
  18. * THIS PROCEDURE-S MAIN FUNCTION IS TO PERFORM APPLICATION COMMANDS.
  19. * IT PUTS THE ORGINAL COMMAND INTO UNSOLICITED-STATUS-QUEUE *USQ*.
  20. * IN THE EVENT OF AN ILLEGAL COMMAND, IT SENDS A TERMINAL-TEXT TO
  21. * CONNECTION-TRAFFIC-QUEUE *CTQ*. IT IS CALLED INTO EXECUTION BY:
  22. * *NVFODHC*
  23. *
  24. * PROC NVFOPAC
  25. *
  26. * ENTRY APPLICATION TYPE OF HOP COMMAND IN *WCBUF[1]*,
  27. * *HDRCMD[1]* AND *PARMS*. *WCBUF* IS DEFINED IN
  28. * TEXTSS, AND *HDRCMD* AND *PARMS* DEFINED IN TXCMDNV.
  29. *
  30. * EXIT THE COMMAND IS SENT TO *USQ* AND/OR
  31. * A SH/ISD IS SENT TO *OTQ*, OR
  32. * A TERMINAL-TEXT IS SENT TO *CTQ*.
  33. *
  34. * METHOD IF APPLICATION FOUND IN *AST*, SEND THE COMMAND TO *USQ*,
  35. * AND IF COMMAND IS ENABLING APPLICATION SET STATE IN *AST*
  36. * TO ENABLED. IF IDLE/DISABLE APPLICATION, SEND SH/ISD TO
  37. * *OTQ*. IF ILLEGAL APPLICATION, SEND A MESSAGE TO *CTQ*.
  38. #
  39.  
  40.  
  41. #
  42. **** PROC NVFOPAC XREF LIST
  43. #
  44. XREF
  45. BEGIN
  46. PROC NVFOFAD; # FORMAT APPICATION DATA #
  47. PROC NVFOPSS; # PREPARE STATUS SEARCH #
  48. PROC NVFUMQE; # MAKE A QUEUE ENTRY #
  49. PROC SSTAQE; # SS- ACCEPT A QUEUE ENTRY #
  50. PROC SSTETS; # SS- ENLARGE TABLE SPACE #
  51. PROC SSTRTS; # SS- REMOVE TABLE SPACE #
  52. END
  53. #
  54. ****
  55. #
  56.  
  57.  
  58. DEF APLWRD1 # HDR$TXWCNT[1]+2 #; # INDEX TO APPLICATION NAME #
  59. DEF APLWRD2 # HDR$TXWCNT[1]+3 #; # INDEX TO APPLICATION NAME #
  60.  
  61.  
  62.  
  63.  
  64. ITEM AN U; # APPLICATION NUMBER #
  65. ITEM ANAME C(10); # APPLICATION NAME #
  66. ITEM I U; # LOOP VARIABLE #
  67. ITEM AORD U; # AST ORDINAL #
  68. ITEM ITEMP I; # INTEGER TEMPORARY #
  69. ITEM MATCH B; # LOOP EXIT VARIABLE #
  70. ITEM NENTRY U; # NO OF ENTRIES IN AST #
  71. ITEM SECNUM U; # NUMBER SECONDARY APPLICATIONS #
  72. ITEM XJ U; # LOOP VARIABLE #
  73.  
  74.  
  75. #
  76. * ILAMSG - INVALID APPLICATION MESSAGE BUFFER.
  77. #
  78. ARRAY ILAMSG[00:00] S(3);
  79. BEGIN
  80. ITEM ILA$MSG C(00,00,20) = ["INVALID APPLICATION."];
  81. ITEM ILA$ZERO U(02,00,60) = [0]; # ZERO BYTE TERMINATOR #
  82. END
  83.  
  84.  
  85. CONTROL EJECT;
  86.  
  87. IF HDR$VERB[1] EQ DIA$
  88. OR HDR$VERB[1] EQ ENA$
  89. OR HDR$VERB[1] EQ IDA$
  90. THEN
  91. BEGIN # COMMAND VERB = DIA/ENA/IDA #
  92. MATCH = FALSE;
  93. FOR I = HDR$TXWCNT[1] STEP 1 WHILE (NOT MATCH) AND
  94. ((I - HDR$TXWCNT[1]) LS HDR$SPCNT[1])
  95. DO
  96. BEGIN # SEARCH PARM LIST FOR APPL NAME #
  97. IF PAR$PCODE[I] EQ APP$
  98. THEN
  99. BEGIN
  100. ANAME = PAR$ELNAME[I]; # SAVE APPL NAME #
  101. MATCH = TRUE;
  102. END
  103. END
  104. #
  105. * SEARCH *AST* FOR ENTRY THAT MATCHES THE APPL NAME AND SAVE
  106. * THE APPLICATION NUMBER.
  107. #
  108. MATCH = FALSE;
  109. NENTRY = ASTLNGTH/ASTSIZ$; # CALCULATE NUMBER OF ENTRIES #
  110. FOR I = 0 STEP 1 WHILE (NOT MATCH) AND (I LS NENTRY)
  111. DO
  112. BEGIN
  113. IF AST$ANAM[I] EQ ANAME
  114. THEN
  115. BEGIN
  116. AN = AST$AN[I]; # SAVE APPL NUMBER #
  117. MATCH = TRUE;
  118. END
  119. END
  120. WCB$WC[1] = 0; # CLEAR WC WORD #
  121. ABHWORD[1] = 0; # CLEAR ABH WORD #
  122. SPMSG0[1] = 0; # CLEAR MESSAGE BUFFER #
  123. IF MATCH
  124. THEN
  125. BEGIN
  126. NVFUMQE(P<USQ>,PARMS[0],5,0,HDR$TXWCNT[1]*10);
  127. IF HDR$VERB[1] EQ ENA$
  128. THEN
  129. BEGIN
  130. AST$DIF[I-1] = FALSE; # SET AST STATE TO ENABLED #
  131.  
  132. #
  133. * CHECK IF AST ENTRY IS A PRIMARY ENTRY WITH SECONDARY ENTRIES
  134. * ACTIVE. IF SO, RESET THE DISABLE FLAG OF EACH SECONDARY AST ENTRY
  135. * AS WELL AS THE PRIMARY.
  136. #
  137.  
  138. IF ((AST$UPANAM[I-1] EQ AST$USANAM[I-1]) AND
  139. (AST$MXCOP[I-1] GR 1))
  140. THEN
  141. BEGIN
  142. FOR AORD = 0 STEP 1 WHILE AORD LS NENTRY
  143. DO
  144. BEGIN
  145. IF AST$SANAM[AORD] EQ AST$PANAM[I-1]
  146. THEN
  147. AST$DIF[AORD] = FALSE;
  148. END
  149. END
  150. END
  151. ELSE
  152. BEGIN
  153.  
  154. #
  155. * COMMAND IS A DISABLE OR IDLE APPLICATION. SET UP THE SHUT/INSD
  156. * SUPERVISORY COMMAND. IF DISABLE, THEN SET THE DISABLE FLAG OF THE
  157. * AST ENTRY AND THE IMMEDIATE SHUT FLAG OF THE SM. IF A PRIMARY AP-
  158. * PLICATION ONLY, SEND THE SHUT. IF SECONDARY COPIES EXIST AND ARE
  159. * ACTIVE, FIND THEM IN THE AST AND SEND THEM THE SHUT/INSD SM.
  160. #
  161.  
  162. PFCSFC[1] = SHISD;
  163. SHISAN[1] = AN;
  164. SHISF[1] = FALSE;
  165. SHANAME[1] = ANAME;
  166. WCB$WC[1] = LSH + 2;
  167. ABHABT[1] = APPCMD;
  168. ABHACT[1] = CT60TRANS;
  169. ABHTLC[1] = LSH ;
  170. IF HDR$VERB[1] EQ DIA$
  171. THEN
  172. BEGIN
  173. SHISF[1] = TRUE;
  174. AST$DIF[I-1] = TRUE;
  175. END
  176. IF AN NQ 0
  177. THEN
  178. SSTAQE(P<OTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  179. ELSE
  180. BEGIN
  181. IF AST$USANAM[I-1] EQ AST$UPANAM[I-1] AND
  182. AST$MXCOP[I-1] GR 1
  183. THEN
  184. BEGIN
  185. FOR AORD = 0 STEP 1 WHILE AORD LS NENTRY
  186. DO
  187. BEGIN
  188. IF ((AST$SANAM[AORD] EQ AST$PANAM[I-1]) AND
  189. (AST$PANAM[AORD] NQ AST$SANAM[AORD]) AND
  190. (AST$JSN[AORD] NQ " "))
  191. THEN
  192. BEGIN
  193. SHANAME[1] = AST$PANAM[AORD];
  194. SHISAN[1] = AST$AN[AORD];
  195. SSTAQE(P<OTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  196. IF HDR$VERB[1] EQ DIA$
  197. THEN
  198. AST$DIF[AORD] = TRUE;
  199. END
  200. END # FOR LOOP #
  201. END
  202. ELSE # APPLICATION NOT NETTED ON #
  203. IF HDR$VERB[1] EQ DIA$
  204. THEN
  205. AST$DIF[I-1] = TRUE;
  206. END
  207. END
  208.  
  209. WCB$WORD[1] = 0; # CLEAR WC WORD AGAIN #
  210. ABHWORD[1] = 0; # CLEAR ABH WORD AGAIN #
  211. WCB$IAF[1] = TRUE; # SET INPUT-ALLOW FLAG TRUE #
  212. WCB$HAF[1] = FALSE; # SET HOP-ALERT FLAG FALSE #
  213. WCB$WC[1] = 2;
  214. ABHABT[1] = HOPTX$;
  215. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],MSGBUF[0]); # SEND NULL TXT#
  216. END
  217. ELSE
  218. BEGIN # ILLEGAL APPLICATION #
  219. WCB$IAF[1] = TRUE;
  220. WCB$HAF[1] = FALSE;
  221. WCB$WC[1] = LMSG30$/10 + 2;
  222. ABHABT[1] = HOPTX$;
  223. ABHADR[1] = HDR$OPORD[1];
  224. ABHTLC[1] = LMSG30$;
  225. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],ILAMSG[0]);
  226. END
  227. END # COMMAND VERB = DIA/ENA/IDA #
  228.  
  229.  
  230. #
  231. * IF THE CURRENT COMMAND IS A STATUS OF APPLICATION, OF ALL TERMS
  232. * CONNECTED TO AN APPLICATION OR ALL USERS CONNECTED TO AN APPL,
  233. * THEN SEARCH THE AST FOR THIS APPLICATION. IF FOUND, SEND THE APPL
  234. * DATA TO GET FORMATTED AND, IF THE CURRENT COMMAND IS NOT JUST A
  235. * STATUS OF AN APPL, SEND THE COMMAND TO THE SERIAL SEARCH REQUEST
  236. * PROC TO SEARCH THE VCB-S FOR ALL THE TERMS/USERS CONNECTED TO THIS
  237. * APPLICATION.
  238. #
  239.  
  240. ELSE IF HDR$VERB[1] EQ STA$ OR
  241. HDR$VERB[1] EQ SSA$ OR
  242. HDR$VERB[1] EQ SUA$
  243. THEN
  244. BEGIN
  245. IF HDR$VERB[1] EQ STA$
  246. THEN
  247. BEGIN
  248. ANAME = PAR$ELNAME[APLWRD1];
  249. END
  250. ELSE
  251. BEGIN
  252. ANAME = PAR$ELNAME[APLWRD2];
  253. END
  254. #
  255. * CHECK IF APPL NAME NOT NVF.
  256. #
  257.  
  258. IF ANAME NQ "NVF"
  259. THEN
  260. BEGIN
  261. #
  262. * APPL NAME NOT NVF. LOCATE AST ENTRY FOR APPL NAME.
  263. #
  264. FOR I=0 STEP 1 WHILE ANAME NQ AST$ANAM[I] AND
  265. I LS ASTLNGTH/ASTSIZ$
  266. DO
  267. BEGIN
  268. END
  269.  
  270.  
  271. IF I LS ASTLNGTH/ASTSIZ$
  272. THEN
  273. BEGIN
  274. #
  275. * AST ENTRY FOUND. SEND PRIMARY APPLICATION STATUS LINE.
  276. * THEN CHECK IF NOT APPLICATION STATUS IN WHICH CASE A SERIAL
  277. * SEARCH OF THE VCBS IS REQUIRED.
  278. * OTHERWISE, FURTHER CHECK OF APPLICATION TYPE AND COPIES IS
  279. * NEEDED.
  280. #
  281. NVFOFAD(I);
  282. IF HDR$VERB[1] NQ STA$
  283. THEN
  284. BEGIN
  285. #
  286. * CALL NVFOPSS FOR SERIAL SEARCH OF VCBS.
  287. #
  288. NVFOPSS;
  289. END
  290. ELSE
  291. BEGIN
  292. #
  293. * STATUS OF APPLICATION.
  294. * SET UP WORD COUNT WORD AND ABH WORD FOR "READY.." MSG.
  295. #
  296. WCB$WORD[1] = 0;
  297. WCB$IAF[1] = TRUE;
  298. WCB$WC[1] = 2;
  299. ABHWORD[1] = 0;
  300. ABHABT[1] = HOPTX$;
  301. #
  302. * DETERMINE IF MULTIPLE COPY TYPE APPLICATION.
  303. * IF SO, FINISHED, SEND "READY.."
  304. #
  305. IF AST$MXCOP[I] EQ 1
  306. THEN
  307. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  308. ELSE
  309. BEGIN
  310. #
  311. * MULTIPLE COPY TYPE APPLICATION.
  312. * CHECK IF MORE THAN 1 COPY ACTIVE.
  313. * IF NOT, FINISHED, SEND "READY.." STATUS LINE.
  314. #
  315. IF AST$CUCOP[I] EQ 0
  316. THEN
  317. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  318. ELSE
  319. BEGIN
  320. #
  321. * MULTIPLE COPY TYPE APPLICATION HAS AT LEAST ONE COPY ACTIVE.
  322. * SET UP TO FIND THE SECONDARY APPLICATIONS AND SEND A STATUS LINE
  323. * FOR EACH BEING AWARE THAT THE LAST LINE MUST HAVE THE INPUT
  324. * ALLOWED FLAG SET TRUE IN ORDER TO FINISH THE COMMAND.
  325. #
  326. SECNUM = 0;
  327. NENTRY = ASTLNGTH / ASTSIZ$;
  328. FOR XJ = 0 STEP 1 WHILE
  329. (SECNUM LS AST$CUCOP[I]) AND
  330. (XJ LS NENTRY)
  331. DO
  332. BEGIN
  333. IF ((AST$PANAM[I] EQ AST$SANAM[XJ]) AND
  334. (AST$JSN[XJ] NQ " ") AND
  335. (AST$PANAM[XJ] NQ AST$SANAM[XJ]))
  336. THEN
  337. BEGIN
  338. NVFOFAD(XJ);
  339. SECNUM = SECNUM + 1;
  340. IF SECNUM EQ AST$CUCOP[I]
  341. THEN
  342. BEGIN
  343. #
  344. * LAST STATUS LINE SENT. SEND "READY.. " STATUS LINE.
  345. #
  346. WCB$WORD[1] = 0;
  347. ABHWORD[1] = 0;
  348. WCB$WC[1] = 2;
  349. ABHABT[1] = HOPTX$;
  350. WCB$IAF[1] = TRUE;
  351. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  352. END
  353. END
  354. END
  355. #
  356. * IF THE NUMBER OF SECONDARY APPLICATIONS IS MORE THAN THE NUMBER
  357. * OF MESSAGES SENT, THE "READY.." MESSAGE WAS NOT SENT OUT. SEND
  358. * THE "READY.." STATUS LINE.
  359. #
  360. IF SECNUM LS AST$CUCOP[I]
  361. THEN
  362. BEGIN
  363. WCB$WORD[1] = 0;
  364. ABHWORD[1] = 0;
  365. WCB$WC[1] = 2;
  366. ABHABT[1] = HOPTX$;
  367. WCB$IAF[1] = TRUE;
  368. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  369. END
  370. END
  371. END
  372. END
  373. END
  374. ELSE
  375. BEGIN
  376. WCB$WORD[1] = 0;
  377. WCB$IAF[1] = TRUE;
  378. WCB$WC[1] = 2 + LMSG30$/10;
  379. ABHWORD[1] = 0;
  380. ABHABT[1] = HOPTX$;
  381. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],ILAMSG);
  382. END
  383. END
  384.  
  385. #
  386. * IF THIS APPLICATION IS NVF, SET UP AN AST ENTRY FOR NVF TO
  387. * TO PASS TO THE STATUS FORMATTING ROUTINE. IF THE CURRENT
  388. * COMMAND IS STATUS, OF ALL USERS OR TERMINALS CONNECTED TO NVF,
  389. * CALL THE PREPARE SERIAL SEARCH PROC, OTHERWISE SEND A NULL
  390. * TEXT TO THE HOP WITH THE INPUT ALLOWED FLAG SET.
  391. #
  392.  
  393. ELSE
  394. BEGIN
  395. SSTETS(P<AST>,0,ASTSIZ$);
  396.  
  397. AST$ANAM[0] = "NVF";
  398. AST$JSN[0] = "NVF";
  399. AST$DIF[0] = FALSE;
  400. AST$DNF[0] = FALSE;
  401. AST$TACN[0] = PTALNGTH/PTACSIZ$;
  402. AST$AACN[0] = 0;
  403.  
  404. NVFOFAD(0);
  405.  
  406. SSTRTS(P<AST>,0,ASTSIZ$);
  407.  
  408. IF HDR$VERB[1] NQ STA$
  409. THEN
  410. BEGIN
  411.  
  412. NVFOPSS;
  413.  
  414. END
  415.  
  416. ELSE
  417. BEGIN
  418. WCB$WORD[1] = 0;
  419. WCB$IAF[1] = TRUE;
  420. WCB$WC[1] = 2;
  421.  
  422. ABHWORD[1] = 0;
  423. ABHABT[1] = HOPTX$;
  424.  
  425. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  426. END
  427. END
  428. END
  429.  
  430.  
  431. #
  432. * IF THE CURRENT COMMAND IS STATUS ALL APPLICATIONS, FOR EACH ENTRY
  433. * IN THE AST, FORMAT THE STATUS AND SEND IT OFF TO THE HOP.
  434. #
  435.  
  436. ELSE IF HDR$VERB[1] EQ STS$
  437. THEN
  438. BEGIN
  439. IF PAR$PCODE[HDR$TXWCNT[1]+3] NQ AC$
  440. THEN
  441. BEGIN
  442. FOR I=0 STEP 1 UNTIL ASTLNGTH/ASTSIZ$-1
  443. DO
  444. BEGIN
  445. NVFOFAD(I);
  446. END
  447. END
  448.  
  449.  
  450. #
  451. * IF THE CURRENT COMMAND IS STATUS ALL ACTIVE APPLICATIONS, FOR EACH
  452. * ENTRY IN THE AST WHERE THE APPLICATION IS ACTIVE, FOR THE STATUS
  453. * MESSAGE AND SEND IT OFF TO THE HOP.
  454. #
  455.  
  456. ELSE
  457. BEGIN
  458. FOR I=0 STEP 1 UNTIL ASTLNGTH/ASTSIZ$-1
  459. DO
  460. BEGIN
  461. IF (NOT AST$DIF[I] AND
  462. NOT AST$DNF[I] AND
  463. AST$JSN[I] NQ " ") OR
  464. (NOT AST$DIF[I] AND
  465. NOT AST$DNF[I] AND
  466. AST$JSN[I] EQ " " AND
  467. AST$CUCOP[I] NQ 0 AND
  468. AST$MXCOP[I] GR 1)
  469. THEN
  470. BEGIN
  471. NVFOFAD(I);
  472. END
  473. END
  474. END
  475.  
  476.  
  477. #
  478. * FINALLY SEND A NULL TEXT TO THE C-LAYER TO CLEAN THE PIPE LINE.
  479. #
  480.  
  481. WCB$WORD[1] = 0;
  482. WCB$IAF[1] = TRUE;
  483. WCB$WC[1] = 2;
  484. ABHWORD[1] = 0;
  485. ABHABT[1] = HOPTX$;
  486. SSTAQE(P<CTQ>,WCBUF[1],ABHBUF[1],NVFSM[1]);
  487. END
  488.  
  489.  
  490. END # NVFOPAC #
  491.  
  492. TERM
cdc/nos2.source/nam5871/nvfopac.txt ยท Last modified: 2023/08/05 17:23 by Site Administrator