User Tools

Site Tools


cdc:nos2.source:nam5871:kdstin

KDSTIN

Table Of Contents

  • [00019] PRGM KDSTIN
  • [00093] PROC MGETS
  • [00094] PROC KDISLN
  • [00095] PROC KPUT
  • [00096] PROC KUPVTAB
  • [00097] PROC XTRACE

Source Code

KDSTIN.txt
  1. *DECK KDSTIN
  2. USETEXT NIPDEF
  3. USETEXT DRHDR
  4. USETEXT AT
  5. USETEXT PT
  6. USETEXT ACB
  7. USETEXT LLCB
  8. USETEXT NBT
  9. USETEXT KDIS
  10. USETEXT KINITBF
  11. USETEXT DISTAIL
  12. USETEXT KHDRX
  13. USETEXT PARAMP
  14. USETEXT TNT
  15. USETEXT KSTTAB
  16. USETEXT FREETAB
  17. USETEXT INPARUT
  18. USETEXT SYSTIME
  19. PRGM KDSTIN; # PROCESS DYNAMIC STATUS DISPLAY #
  20. STARTIMS;
  21. #
  22. *1DC KDSTIN
  23. *
  24. * 1.PROC NAME AUTHOR DATE
  25. * KDSTIN A.BEN-ARTZI 82/01/06
  26.   M.GIBIAN 83/12/20
  27. *
  28. * 2.FUNCTIONAL DESCRIPTION.
  29. *
  30. * INITIATE THE STATUS DISPLAY SCREEN. IF CREATION CALL,
  31. * ALLOCATE VIEW WINDOW BUFFER AND INITIALIZE VIEW TABLE.
  32. * DISPLAY ALL LINES CURRENTLY IN VIEW WINDOW.
  33. *
  34. * 3.METHOD USED.
  35. *
  36. * IF THIS IS A CREATION CALL THEN
  37. * SET BLANK FLAG TO TRUE
  38. * SAVE ORIGINAL BUFFER
  39. * ALLOCATE VIEW WINDOW BUFFER AND CHAIN INTO PLACE
  40. * INITIALIZE THE VIEW TABLE BY
  41. * INITIALIZING THE APPLICATION START LINE
  42. * SCAN ACB-S, NBTE-S, AND LLCB-S TO COUNT THE NUMBER
  43. * OF LINES FOR EACH TYPE OF DISPLAY LINE. ASSIGN
  44. * A RELATIVE LINE NUMBER TO EACH ENTRY, AND STORE
  45. * THE MAXIMUM OF EACH TYPE IN THE VIEW TABLE.
  46. *
  47. * RESET THE SLOW UPDATE TIMER
  48. * IF THE BLANK FLAG IS SET, BLANK THE VIEW WINDOW, SET THE
  49. * STATUS TO CREATE, AND CLEAR THE BLANK FLAG.
  50. * CHECK ALL ACB-S, NBTE-S, AND LLCB-S AND DISPLAY ALL LINES
  51. * INDICATED AS BEING DISPLAYED BY THE VIEW TABLE.
  52. * IF CREATE IS SET, UPDATE THE MAIN HEADER
  53. * SET THE STATUS TO UPDATE
  54. *
  55. * LATER,EVERY ROUTINE,UPDATING A DATA WITCH IS SHOWN ON THE
  56. * DISPLAY(WHILE ST-DISPLAY IS ON) SHALL BE RESPONSIBLE TO
  57. * USE IT-S INDEX AND UPDATE IN THE BLOCK TOO.
  58. *
  59. * 4.ENTRY PARAMETERS.
  60. *
  61. * PARAMP1 = 1 - DO ONLY STATUS-DISPLAY UPDATE
  62. *
  63. * 5.OUTPUT PARAMETERS.
  64. *
  65. * 6.COMDECKS AND TEXTS USED.
  66. *
  67. * NIPDEF DRHDR AT PT ACB LLCB
  68. * NBT KDIS KSTTAB DISTAIL
  69. * KHDRX KINITBF PARAMP TNT
  70. * FREETAB INPARUT SYSTIME OSIZE
  71. *
  72. * 7.ROUTINES CALLED.
  73. *
  74. * MGETS ALLOCATE BUFFER
  75. * XTRACE RECORD PROCESSOR CALLS
  76. * KPUT PUTS VALUES IN BUFFER+CONVERT FROM B TO DISPLAY
  77. * KDISLN DISPLAY A SINGLE LINE IN THE VIEW WINDOW
  78. * KUPVTAB UPDATE THE VIEW TABLE
  79. *
  80. * 8.DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  81. * THIS IS AN OVERSIZED PRIMARY OVERLAY CALLED
  82. * BY XEXEC.
  83. * W A R N I N G-THIS OVERSIZED PRIMARY OVERLAY CANNOT EXCEED
  84. *CALL OSIZE
  85. *
  86.  #
  87. STOPIMS;
  88. #
  89.   EXTERNAL CALLS
  90. #
  91. XREF
  92. BEGIN
  93. PROC MGETS;
  94. PROC KDISLN;
  95. PROC KPUT;
  96. PROC KUPVTAB;
  97. PROC XTRACE;
  98. LABEL RJMAIN ;
  99. END
  100. #
  101.   INTERNAL VARIABLES
  102. #
  103. ITEM BUF U=0 ; # ADDRESS OF VIEW BUFFER #
  104. ITEM KREM I=0; # NUMBER OF LINES REMAINING IN VIEW BUFFER #
  105. # #
  106. ITEM KINDEX I=0; # COUNTER #
  107. ITEM KSIZE I=0; # TOTAL SIZE OF VIEW BUFFER #
  108. ITEM KN I=0; # INDEX INTO DATA BLOCK #
  109. #**********************************************************************#
  110. BEGIN
  111. CONTROL IFEQ DEBUG,1;
  112. XTRACE("KDSTN");
  113. CONTROL FI;
  114.  
  115. # SET POINTERS AND INDICATE STATUS DISPLAY IS BEING SHOWN #
  116.  
  117. KDST[0] = TRUE;
  118. #
  119.   CHECK IF ONLY UPDATE IS REQUIRED
  120. #
  121. IF KDIS$STAT EQ STM"STM$UPDATE"
  122. THEN
  123. BEGIN
  124. BUF = KHDRNP[0] ; # GET VIEW POINTER FROM HEADER BLOCK #
  125. GOTO KUPDAT ;
  126. END
  127.  
  128. KDBLNK=TRUE;
  129. #
  130.   SAVE ORIGINAL BUFFER
  131. #
  132.  
  133. P<DRHDRWD>=KDBP[0];
  134. BACKPTR[0]=LOC(KORIGBP[0]);
  135. NEXTPTR[0]=BACKPTR[0];
  136. BLKID[0]=DRIDVALUE;
  137. KORIGBP[0]=P<DRHDRWD>;
  138. KORIGFP[0]=P<DRHDRWD>;
  139. KDORIG[0]=FALSE;
  140.  
  141. # ALLOCATE AND CHAIN INTO PLACE THE VIEW BUFFER #
  142.  
  143. KSIZE = (KDVWLN[0]*KSTBLK) + BLKHSIZE + KHDRSIZE + 1;
  144. MGETS(KSIZE,BUF,TRUE);
  145.  
  146. P<KINITBF>=0;
  147. KDTYPE[BUF+BLKHSIZE] = 0;
  148. K7777[BUF+KSIZE-1] = O"7777";
  149. KDSTAIL[BUF+KSIZE-1] = LOC(KDTLNAM)+1;
  150.  
  151. KDFP[0] = LOC(KHDRBP[0]); # SET KDIS FORWARD ==> KHDRX #
  152. KHDRBP[0] = LOC(KDFP[0]); # SET KHDRX BACKWARD ==> KDIS FORWARD#
  153. KHDRNP[0] = BUF; # SET HEADER FORWARD POINTER TO VIEW BUFFER #
  154. P<DRHDRWD> = 0;
  155. NEXTPTR[BUF] = LOC(KDFP[0]); # VIEW NEXT ==> KDIS FORWARD #
  156. BACKPTR[BUF] = LOC(KHDRNP[0]); # VIEW BACK ==> KHDRX FORWARD #
  157. BLKID [BUF] = KDISIDVALUE;
  158. KHXNEXT[0] = BUF + BLKHSIZE + KHDRSIZE; # KHDRX 7777 CHAIN PTR #
  159. KDLSTOP[0] = LOC(KHDRX1); # CHAIN KDIS 7777 CHAIN PTR TO KHDRX#
  160.  
  161. # INITIALIZE VIEW TABLE #
  162.  
  163. KDAPPST[0] = 2; #FIRST DISPLAY STARTS WITH FIRST APPLICATION #
  164.  
  165. KDIS$RT = KDST[0] AND KFAST[0];
  166.  
  167. KN=3;
  168. FOR KINDEX = 1 STEP 1 UNTIL ATHAN[0] DO
  169. BEGIN
  170. IF ATACBA[KINDEX] NQ 0
  171. THEN
  172. BEGIN
  173. P<ACB> = ATACBA[KINDEX]; # WE WILL WRITE A LINE FRM THIS ACB#
  174. KN = KN+1 ;
  175. ACBKNDX[0] = KN; # THIS WILL BE ITS INDEX INTO DATA BLOCK #
  176. END
  177. END
  178. KDAPPMX[0] = KN;
  179. #
  180.   NOW SEARCH THE SAME WAY ALL NBT ENTRIES
  181. #
  182. KN = 3 ;
  183. FOR KINDEX = 0 STEP NBTFETNO UNTIL NBTMAXID
  184. DO
  185. BEGIN
  186. IF NBTIUF[KINDEX]
  187. THEN # YES, THIS IS A LIVING ENTRY #
  188. BEGIN
  189. KN = KN + 1 ;
  190. NBTKNDX[KINDEX] = KN ;
  191. END
  192. END
  193. KDESTMX[0]=KN;
  194. #
  195.   LAST REPEAT PROCESS FOR LOGICAL LINKS
  196. #
  197. KN = 3 ;
  198. FOR KINDEX = 1 STEP 1 UNTIL TNTBS[0]-1 DO
  199. BEGIN
  200. IF TNTLLAD[KINDEX] NQ 0
  201. THEN
  202. BEGIN
  203. P<LLCB> = TNTLLAD[KINDEX];#THIS IS AN LL WE SHOULD USE LATER #
  204. KL1: KN = KN + 1 ;
  205. IF LLCBHN[0] NQ 0
  206. THEN
  207. LLCBKNDX[0] = KN ; # INDEX INTO K-DISPLAY ST BUFFER #
  208. ELSE
  209. BEGIN # THIS IS A FAKE INTRA HOST LLK #
  210. KN = KN - 1 ;
  211. LLCBKNDX[0] = 0 ;
  212. END
  213. IF LLCBFP[0] NQ 0
  214. THEN # OH, WE HAVE ONE MORE LINK IN THIS ENTRY #
  215. BEGIN
  216. P<LLCB>=LLCBFP[0]; # SO, GET THIS ONE TWO #
  217. GOTO KL1; # AND DO TO IT THE SAME THING #
  218. END
  219. END
  220. END
  221. KDLGLMX[0]=KN;
  222. #
  223.   END VIEW BUFFER/STATUS DISPLAY INITIALIZATION
  224. #
  225.  
  226. KUPDAT:
  227. KSLOWTM[0] = RTSECS[0] ;
  228.  
  229. KUPVTAB; # REVISE THE VIEW WINDOW #
  230.  
  231. IF KDBLNK THEN # IF BLANK IS SET, CLEAR VIEW WINDOW + REDISPLAY #
  232. BEGIN
  233. P<KSTTAB>=BUF+BLKHSIZE+KHDRSIZE;
  234. FOR KINDEX = 1 STEP 1 UNTIL KDVWLN[0] DO
  235. BEGIN
  236. KAPPDTA[KINDEX-1] = " ";
  237. KAPPEND[KINDEX-1] = 0;
  238. END
  239. KDBLNK=FALSE;
  240. END
  241.  
  242. #
  243.   START LOOKING FOR DATA IN THE AT
  244. #
  245.  
  246. #
  247.   PROCESS APPLICATIONS IF ANY ARE DISPLAYED
  248. #
  249.  
  250. IF (KDAPPST[0] NQ 0) THEN
  251. BEGIN
  252. IF KDAPPST LQ 2 THEN
  253. KDISLN(2,0,KST"APP"); # DISPLAY HEADER LINE #
  254.  
  255. #
  256.  
  257.   CHECK ALL ACB-S TO SEE IF THEY ARE BEING DISPLAYED
  258. #
  259.  
  260. FOR KINDEX = 1 STEP 1 UNTIL ATHAN[0] DO
  261. BEGIN
  262. P<ACB> = ATACBA[KINDEX];
  263. IF ATACBA[KINDEX] NQ 0 # ACB EXISTS #
  264. AND ACBKNDX[0] NQ 0 # STATUS DISPLAY LINE EXISTS #
  265. AND ACBKNDX[0] GQ KDAPPST[0] #GREATER THAN FIRST LIN #
  266. AND ACBKNDX[0] LQ KDAPPND[0] #LESS THAN LAST LINE #
  267. THEN # UPDATE APPLICATION STATUS LINE #
  268. KDISLN(ACBKNDX[0],ATACBA[KINDEX],KST"APP");
  269. END
  270. END
  271. #
  272.   PROCESS ANY EST THAT IS DISPLAYED
  273. #
  274. IF KDESTST[0] NQ 0 THEN
  275. BEGIN
  276.  
  277. IF KDESTST[0] LQ 2 AND KDESTND[0] GQ 2 THEN
  278. KDISLN(2,0,KST"EST");
  279.  
  280. #
  281.   START LOOKING FOR DATA IN THE EST HEADER
  282. #
  283.  
  284. FOR KINDEX = 0 STEP NBTFETNO UNTIL NBTMAXID
  285. DO
  286. BEGIN
  287. IF NBTIUF[KINDEX]
  288. AND NBTKNDX[KINDEX] NQ 0 # STATUS DISPLAY LINE EXISTS #
  289. AND NBTKNDX[KINDEX] GQ KDESTST[0] #GTR THAN 1ST EST LN#
  290. AND NBTKNDX[KINDEX] LQ KDESTND[0] #LE LAST EST Y LINE #
  291. THEN
  292. KDISLN(NBTKNDX[KINDEX],KINDEX,KST"EST"); # GO DISPLAY#
  293. END
  294. END
  295.  
  296. #
  297.   DISPLAY ANY LOGICAL LINK LINES
  298. #
  299.  
  300. IF KDLGLST[0] NQ 0 THEN
  301. BEGIN
  302.  
  303. IF KDLGLST[0] LQ 2 AND KDLGLND[0] GQ 2 THEN
  304. KDISLN(2,0,KST"LLK");
  305.  
  306. #
  307.   START LOOKING FOR INFO ABOUT LOGICAL LINKS
  308. #
  309.  
  310. FOR KINDEX=1 STEP 1 UNTIL TNTBS[0]-1 DO
  311. BEGIN
  312. P<LLCB> = TNTLLAD[KINDEX];
  313. KLMORE:
  314. IF P<LLCB> NQ 0 THEN # LLCB EXISTS #
  315. BEGIN
  316. IF LLCBKNDX[0] NQ 0 # STATUS DISPLAY LINE EXISTS #
  317. AND LLCBKNDX[0] GQ KDLGLST[0] # AFTER/IS FIRST LGL LN #
  318. AND LLCBKNDX[0] LQ KDLGLND[0] # BEFORE/IS LAST LGL LN #
  319. THEN # UPDATE LOGICAL LINK STATUS LINE #
  320. KDISLN(LLCBKNDX[0],P<LLCB>,KST"LLK");
  321. #
  322.   BEFORE WE QUIT,CHECK FOR ANY MORE LL SERVING THE TNT
  323. #
  324. IF LLCBFP[0] NQ 0
  325. THEN
  326. BEGIN
  327. P<LLCB> = LLCBFP[0]; # GO GET DATA FROM THIS LLCB TOO #
  328. GOTO KLMORE;
  329. END
  330. #
  331.   END LLCB SEARCH
  332. #
  333. END
  334. END
  335. END
  336. #
  337.   UPDATE FIELDS IN MAIN HEADER
  338. #
  339. IF KDIS$STAT EQ STM"STM$CREATE"
  340. THEN
  341. BEGIN
  342. KPUT(LOC(KHDRXNM),0,KPHXNAP,KDAPPMX[0]-3);
  343. KPUT(LOC(KHDRXNM),0,KPHXNIN,INPNIN[1]);
  344. KPUT(LOC(KHDRXNM),0,KPHXRGL,HRL);
  345. KPUT(LOC(KHDRXNM),0,KPHXMFL,MAXFL);
  346. #
  347.   AND UPDATE TIMER FOR STATISTICS
  348. #
  349. KSTATIM[0] = RTSECS[0] ;
  350. END
  351.  
  352. KDIS$STAT=STM"STM$UPDATE";
  353. GOTO RJMAIN ;
  354.  
  355. END
  356. TERM
cdc/nos2.source/nam5871/kdstin.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator