User Tools

Site Tools


cdc:nos2.source:nam5871:csoghl

CSOGHL

Table Of Contents

  • [00008] PROC CSOGHL
  • [00009] CSOGHL - GENERATE HISTORY LINES
  • [00014] GENERATE HISTORY LINES.
  • [00038] PROC MOVE
  • [00039] PROC SSBTBW
  • [00040] PROC SSTRQE
  • [00041] PROC SSTAQE

Source Code

CSOGHL.txt
  1. *DECK CSOGHL
  2. USETEXT TEXTCS;
  3. USETEXT TEXTSS;
  4. USETEXT TXTSMCS;
  5. USETEXT TXTSUSS;
  6. USETEXT TXTAPSS;
  7. USETEXT TXCMDCS;
  8. PROC CSOGHL;
  9. # TITLE CSOGHL - GENERATE HISTORY LINES #
  10.  
  11. BEGIN # CSOGHL #
  12.  
  13. #
  14. ** CSOGHL - GENERATE HISTORY LINES.
  15. *
  16. * C. BRION 82/05/24.
  17. *
  18. * THIS PROCEDURE GENERATES THE HISTORY LINES TO AN OPERATOR.
  19. * THE HISTORY REQUEST QUEUE IS NON-EMPTY ON ENTRY.
  20. *
  21. * PROC CSOGHL
  22. *
  23. * ENTRY
  24. * ENTRIES IN THE HISTORY REQUEST QUEUE.
  25. *
  26. * EXIT
  27. * CONTENTS OF THE HISTORY BUFFER IN THE FORM OF TERMINAL TEXT
  28. * TO THE CONNECTION TRAFFIC QUEUE.
  29. *
  30. #
  31.  
  32. #
  33. **** PROC CSOGHL XREF LIST
  34. #
  35.  
  36. XREF
  37. BEGIN
  38. PROC MOVE; # MOVE A BLOCK OF CM WORDS #
  39. PROC SSBTBW; # TEST BIT IN WORD #
  40. PROC SSTRQE; # SS-REMOVE QUEUE ENTRY #
  41. PROC SSTAQE; # SS-ACCEPT QUEUE ENTRY #
  42. END
  43. #
  44. ****
  45. #
  46.  
  47. #
  48. * AGSWTCH - SWITCH LIST USED TO SELECT THE APPROPRIATE PARAGRAPH
  49. * TO EXECUTE BASED ON THE AUDIENCE GROUP OF THE MESSAGE.
  50. #
  51. SWITCH AGSWTCH ENDCASE,
  52. AUDGR1,
  53. AUDGR2,
  54. AUDGR3,
  55. AUDGR4,
  56. ENDCASE,
  57. AUDGR6;
  58.  
  59.  
  60. #
  61. * PROC CSOGHL ITEMS
  62. #
  63.  
  64. ITEM CSHSBLCNT; # HISTORY BUFFER LINE COUNT #
  65. ITEM I;
  66. ITEM BEGSPIX U; # ALL KEYWORD INDEX #
  67. ITEM LITOPASS U; # LINES TO PASS #
  68. ITEM LILOC U; # LINE PTR IN HISTORY BUFFER #
  69. ITEM ALLON B; # ALL INDICATOR #
  70. ITEM NLINES U; # LINE COUNTER #
  71. ITEM MSGINDEX U; # INDEX INTO MSGBUF #
  72. ITEM REPORT B; # REPORT FLAG #
  73. ITEM DVAR U;
  74.  
  75. #
  76. * BLINE - BLANK LINE MESSAGE ARRAY.
  77. #
  78.  
  79. ARRAY BLINE [00:00] S(1);
  80. BEGIN
  81. ITEM BLI$TXT1 C(00,00,01) = [" "];
  82. ITEM BLI$ZERO U(00,06,54) = [0];
  83. END
  84.  
  85. #
  86. * NCHDR - NCF VERSION HEADER FOR HISTORY,ALL CMD.
  87. #
  88.  
  89. ARRAY NCHDR [00:00] S(3);
  90. BEGIN
  91. ITEM NCH$TXT C(00,00,04) = ["NCF "];
  92. ITEM NCH$VER C(00,24,20);
  93. ITEM NCH$ZERO U(02,24,36) = [0];
  94. END
  95.  
  96. #
  97. * PROC CSOGHL EXECUTION STARTS HERE.
  98. #
  99.  
  100. #
  101. * THE MAIN LOOP OF THIS PROC CONTINUES UNTIL THE HISTORY REQUEST
  102. * QUEUE HAS BEEN EXHAUSTED.
  103. #
  104.  
  105. FOR I = 0 STEP 1 WHILE HRQL NQ 0
  106. DO
  107. BEGIN
  108. SSTRQE(P<HRQ>,WCBUF[0],HDRCMD[0],PARMS[0]);
  109.  
  110. #
  111. * INITIALIZE THE OUTGOING TTEXT ENTRY AREAS.
  112. #
  113.  
  114. WCB$WORD[1] = 0;
  115. ABHWORD[1] = 0;
  116. WCB$SMID[1] = SMID"TTEXT";
  117. WCB$IAF[1] = FALSE;
  118. WCB$HAF[1] = FALSE;
  119. ABHADR[1] = HDR$OPORD[0];
  120.  
  121.  
  122. #
  123. * THE STATE OF THE CONNECTION TO THE OPERATOR MUST BE ACTIVE FOR
  124. * THE HISTORY REQUEST TO BE PROCESSED.
  125. #
  126.  
  127. IF OC$STATE[HDR$OPORD[0]]
  128. THEN
  129. BEGIN
  130.  
  131. #
  132. * CHECK IF HISTORY BUFFER EMPTY. IF SO, SIMPLY GENERATE A NULL
  133. * TTEXT ENTRY TO CAUSE THE READY.. MESSAGE TO OPERATOR.
  134. #
  135.  
  136. IF HBFQL EQ 0
  137. THEN
  138. BEGIN
  139. WCB$WC[1] = 2;
  140. WCB$IAF[1] = TRUE;
  141. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],CSSM[1]);
  142. GOTO ENDEXIT;
  143. END
  144.  
  145.  
  146. #
  147. * THE OCB IS STILL ACTIVE. CHECK IF AN HISTORY, ALL REQUEST BY THE
  148. * PRESENCE OF THE ALL KEYWORD. IF ALL REQUEST, SET UP TO ISSUE THE
  149. * ENTIRE BUFFER.
  150. #
  151.  
  152. CSHSBLCNT = HBFQL / HBFESIZ$;
  153. BEGSPIX = HDR$TXWCNT[0] + 1; # SET ALL INDEX LOCATION #
  154. ALLON = FALSE;
  155. IF PAR$PCODE[BEGSPIX] EQ "ALL"
  156. THEN
  157. BEGIN
  158. LITOPASS = CSHSBLCNT; # SET FOR ALL LINES TO GO #
  159. LILOC = 0;
  160. ALLON = TRUE;
  161. END
  162. ELSE
  163.  
  164. #
  165. * JUST HISTORY COMMAND. SET UP TO ISSUE LAST PAGE OF BUFFER TO
  166. * THE OPERATOR BASED ON THE PAGE LENGTH. IT IS POSSIBLE THAT
  167. * THE BUFFER DOES NOT CONTAIN MORE LINES THAN PAGE LENGTH SO
  168. * THEN SET UP AS IF ALL REQUEST EXCEPT FOR HEADER.
  169. #
  170.  
  171. BEGIN
  172. IF OC$PL[HDR$OPORD[0]] EQ 0 # NO PAGE LENGTH DEFINED #
  173. THEN
  174. LITOPASS = DEFPL$; # USE DEFAULT #
  175. ELSE
  176. LITOPASS = OC$PL[HDR$OPORD[0]];
  177.  
  178. IF LITOPASS GR CSHSBLCNT # HSB LESS THAN PL #
  179. THEN
  180. BEGIN
  181. LITOPASS = CSHSBLCNT;
  182. END
  183. END # IF ALL #
  184.  
  185. #
  186. * BEGINNING WITH THE LAST ENTRY IN THE HISTORY BUFFER QUEUE, SELECT
  187. * THE PARAGRAPH TO APPLY BASED ON AUDIENCE GROUP. DO THE UNTIL
  188. * THE NUMBER OF LINES TO SEND TO THE OPERATOR IS REACHED OR THE
  189. * ENTIRE HISTORY BUFFER IS SCANNED.
  190. #
  191. NLINES = 0;
  192. FOR I=CSHSBLCNT STEP -1 WHILE NLINES LS LITOPASS AND
  193. I GR 0
  194. DO
  195. BEGIN
  196. HBF$LFLG[I] = FALSE;
  197.  
  198. GOTO AGSWTCH[HBF$AGRP[I]];
  199.  
  200. #
  201. * AUDIENCE GROUP ONE -- SET THE LIST FLAG AND INCREMENT THE SEND
  202. * LINE COUNT.
  203. #
  204. AUDGR1:
  205. HBF$LFLG[I] = TRUE;
  206. NLINES = NLINES + 1;
  207.  
  208. GOTO ENDCASE;
  209.  
  210. # AUDIENCE GROUP TWO -- IF THIS OPERATOR IS NOT A DOP, THEN SET
  211. * THE LIST FLAG AND INCREMENT THE SEND LINE COUNT.
  212. #
  213. AUDGR2:
  214. IF OC$TYPE[HDR$OPORD[0]] NQ OPTYP"DOP"
  215. THEN
  216. BEGIN
  217. HBF$LFLG[I] = TRUE;
  218. NLINES = NLINES + 1;
  219. END
  220.  
  221. GOTO ENDCASE;
  222.  
  223. #
  224. * AUDIENCE GROUP THREE -- IF REPORT IS TO BE RECEIVED BY THIS
  225. * OPERATOR, THEN SET THE LIST FLAG AND INCREMENT THE SEND LINE
  226. * COUNT.
  227. #
  228. AUDGR3:
  229. SSBTBW( NPU$RFLGS[HBF$NORD[I]] , HDR$OPORD[0] , REPORT );
  230.  
  231. IF REPORT
  232. THEN
  233. BEGIN
  234. HBF$LFLG[I] = TRUE;
  235. NLINES = NLINES + 1;
  236. END
  237.  
  238. GOTO ENDCASE;
  239.  
  240. #
  241. * AUDIENCE GROUP FOUR -- IF THIS OPERATOR IS THE HOP OR CONTROLLING
  242. * NOP, THEN SET THE LIST FLAG AND INCREMENT THE SEND LINE COUNT.
  243. #
  244. AUDGR4:
  245. IF HDR$OPORD[0] EQ HOPORD$ OR
  246. HDR$OPORD[0] EQ NPU$CNOP[HBF$NORD[I]]
  247. THEN
  248. BEGIN
  249. HBF$LFLG[I] = TRUE;
  250. NLINES = NLINES + 1;
  251. END
  252.  
  253. GOTO ENDCASE;
  254.  
  255. #
  256. * AUDIENCE GROUP SIX -- IF THIS OPERATOR IS THE HOP, THEN SET
  257. * THE LIST FLAG AND INCREMENT THE LINE COUNT.
  258. #
  259. AUDGR6:
  260. IF HDR$OPORD[0] EQ HOPORD$
  261. THEN
  262. BEGIN
  263. HBF$LFLG[I] = TRUE;
  264. NLINES = NLINES + 1;
  265. END
  266.  
  267. GOTO ENDCASE;
  268.  
  269. ENDCASE:
  270. END # I LOOP #
  271.  
  272. #
  273. * IF HISTORY ALL REQUEST, ISSUE HEADER TEXT FIRST.
  274. #
  275.  
  276. IF ALLON
  277. THEN
  278. BEGIN
  279. WCB$WC[1] = 6;
  280. SBD$ANAME[0] = "CS "; # SET HDR PRG NAME #
  281. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],SBUILD[0]);
  282. WCB$WC[1] = 5;
  283. NCH$VER[0] = CSNCFVER;
  284. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],NCHDR[0]);
  285. WCB$WC[1] = 3;
  286. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],BLINE[0]);
  287. END
  288.  
  289. #
  290. * BEGINNING WITH THE FIRST HISTORY LINE TO SEND, SEND EACH LINE
  291. * THAT HAS THE LIST FLAG SET UNTIL THE END OF THE HISTORY BUFFER.
  292. #
  293. WCB$WORD[1] = 0;
  294. WCB$SMID[1] = SMID"TTEXT";
  295. ABHWORD[1] = 0;
  296. ABHADR[1] = HDR$OPORD[0];
  297.  
  298. FOR I=I+1 STEP 1 UNTIL CSHSBLCNT
  299. DO
  300. BEGIN
  301. IF HBF$LFLG[I]
  302. THEN
  303. BEGIN
  304. WCB$WC[1] = HBF$WC[I] + 2;
  305. MOVE(HBF$WC[I],HBFQ[I],MSGBUF[1]);
  306. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],MSGBUF[1]);
  307. END
  308. END
  309.  
  310. #
  311. * SEND EMPTY TERMINAL TEXT WITH THE INPUT ALLOWED FLAG SET.
  312. #
  313. WCB$WORD[1] = 2;
  314. WCB$SMID[1] = SMID"TTEXT";
  315. WCB$IAF[1] = TRUE;
  316. ABHWORD[1] = 0;
  317. ABHADR[1] = HDR$OPORD[0];
  318.  
  319. SSTAQE(P<CNQ>,WCBUF[1],ABH[1],MSGBUF[1]);
  320.  
  321.  
  322. END # IF OC$STATE #
  323. END # FOR LOOP HRQL #
  324.  
  325.  
  326. ENDEXIT:
  327. DVAR = 1;
  328.  
  329. END # CSOGHL #
  330. TERM
cdc/nos2.source/nam5871/csoghl.txt ยท Last modified: 2023/08/05 17:21 by Site Administrator