User Tools

Site Tools


cdc:nos2.source:nam5871:kdel

Table of Contents

KDEL

Table Of Contents

  • [00015] PRGM KDEL
  • [00075] PROC KUPVTAB
  • [00076] PROC KPUT
  • [00077] PROC XTRACE

Source Code

KDEL.txt
  1. *DECK KDEL
  2. USETEXT NIPDEF
  3. USETEXT KDIS
  4. USETEXT KINITBF
  5. USETEXT KSTTAB
  6. USETEXT ACB
  7. USETEXT LLCB
  8. USETEXT NBT
  9. USETEXT DRHDR
  10. USETEXT KHDRX
  11. USETEXT AT
  12. USETEXT PARAMS
  13. USETEXT PT
  14. USETEXT TNT
  15. PRGM KDEL;
  16. STARTIMS;
  17. #
  18. *1DC KDEL
  19. *
  20. * 1. PROC NAME AUTHOR DATE
  21. * KDEL A.BEN-ARTZI 82/03/04
  22. * M.GIBIAN 83/12/20
  23. *
  24. * 2. FUNCTIONAL DESCRIPTION
  25. *
  26. * DELETE A LINE FROM STATUS DISPLAY (ACB,NBT,OR LLCB)
  27. *
  28. * 3. METHOD USED
  29. *
  30. * -IF DELETED LINE IS BEING DISPLAYED, SET DISPLAY TYPE TO
  31. * THE TYPE OF LINE DELETED. COMPUTE THE CONVERSION FACTOR
  32. * TO CONVERT FROM RELATIVE LINE NUMBER TO ABSOLUTE LINE NUMBER.
  33. *
  34. * -DECREMENT MAXIMUM COUNT FOR LINE TYPE AND UPDATE VIEW TABLE
  35. *
  36. * -IF DELETED LINE IS BEING VIEWED THEN
  37. * SHIFT DISPLAY TO DELETE LINE
  38. * DETERMINE TYPE OF NEW LAST LINE AND SAVE IT. IF LAST LINE
  39. * IS BEYOND END OF DISPLAY, SET TYPE TO RESERVED TO PREVENT
  40. * ANY NEW LINE FROM BEING DISPLAYED.
  41. *
  42. * -SEARCH ACB-S NBTE-S AND LLCB-S TO ADJUST RELATIVE LINE NUMBER
  43. * FOR STRUCTURE OF DELETED LINE, AND TO DISPLAY NEW LAST LINE
  44. *
  45. * 4. ENTRY PARAMETERS
  46. *
  47. * TYPE - 1,2,OR 3 ACCORDING TO ACB,NBT(EST) OR LLCB
  48. *
  49. * KNDX - THE DATA-STRUCTURE INDX INTO THE STATUS DISPLAY BUFFER
  50. *
  51. * 5. EXIT PARAMETERS
  52. *
  53. * NONE
  54. *
  55. * 6. COMDECKS AND TEXTS
  56. *
  57. * NIPDEF KDIS KINITBF
  58. * KHDRX ACB LLCB NBT
  59. * DRHDR AT PT
  60. * TNT
  61. *
  62. * 7. ROUTINES AND OVERLAYS CALLED
  63. *
  64. * KPUT - UPDATE DATA ON STATUS DISPLAY BUFFERS
  65. * KUPVTAB- UPDATE VIEW TABLE
  66. * XTRACE - MARK ROUTINE IN TRACE DUMP
  67. *
  68. * 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  69. *
  70. * THIS PROCEDURE IS CALLED BY NPESTOF,RELACB AND RELLLCB.
  71. *
  72.  #
  73. STOPIMS;
  74. XREF BEGIN
  75. PROC KUPVTAB;
  76. PROC KPUT ;
  77. PROC XTRACE ;
  78. LABEL RJMAIN;
  79. END
  80. #
  81.   INPUT PARAMETERS
  82. #
  83. ITEM TYPE U; # SPECIFY ACB,NBT(EST) OR LLCB MOD (1,2 OR 3) #
  84. ITEM KNDX U; # THE INDEX INTO ST-DISPLAY BUFFER #
  85. #
  86.   INTERNAL VARIABLES
  87. #
  88. ITEM DTYPE S:KST; # TYPE OF DISPLAY CONTAINING LAST LINE #
  89. ITEM BUF U; # ADDRESS OF NEW BUFFER ALLOCATED #
  90. ITEM KN I; # TEMP LINE INDEX #
  91. # #
  92. BASED ARRAY INDEXES S(1);
  93. BEGIN
  94. ITEM ISTART U(0,9,9); # START INDEX IN VIEW TABLE ARRAY #
  95. ITEM IEND U(0,18,9); # END INDEX IN VIEW TABLE ARRAY #
  96. END
  97.  
  98. SWITCH KLAB1 N1,KAPP1,KEST1,KLGL1;
  99. # #
  100. ITEM SIZE U; # SIZE OF NEW BUFFER #
  101. ITEM I U; # LOOP INDEX #
  102. ITEM KINDEX U; # LOOP INDEX #
  103. # #
  104. #**********************************************************************#
  105. BEGIN
  106. CONTROL IFEQ DEBUG,1;
  107. XTRACE("KDEL ");
  108. CONTROL FI;
  109.  
  110. TYPE=PARAMS1;
  111. KNDX=PARAMS2;
  112. # #
  113. IF TYPE LS 1 OR TYPE GR 3
  114. THEN # ERROR IN TYPE (INTERNAL NIP) #
  115. RETURN ; # WE SHOULD ABORT NIP HERE #
  116. ELSE
  117. BEGIN
  118. DTYPE=KST"RESERVED";
  119. P<KSTTAB> = KHDRNP[0]+BLKHSIZE+KHDRSIZE;
  120. P<INDEXES>=LOC(KDAPPST[0])-1;
  121. FOR I=KST"APP" STEP 1 WHILE ISTART[I] EQ 0 DO;
  122. KN=KNDX-ISTART[I];
  123. FOR I=KST"APP" STEP 1 UNTIL TYPE-1 DO KN=KN+IEND[I];
  124. GOTO KLAB1[TYPE] ;
  125. END
  126. N1:
  127. RETURN ;
  128. # #
  129. KAPP1:
  130. IF KNDX GQ KDAPPST[0] AND KNDX LQ KDAPPND[0] THEN
  131. DTYPE=KST"APP";
  132. KDAPPMX[0] = KDAPPMX[0] - 1;
  133. KPUT(LOC(KHDRXNM),0,KPHXNAP,KDAPPMX[0]-3) ;
  134. GOTO NEXT ;
  135. # #
  136. KEST1:
  137. IF KNDX GQ KDESTST[0] AND KNDX LQ KDESTND[0] THEN
  138. DTYPE=KST"EST";
  139. KDESTMX[0] = KDESTMX[0] - 1 ;
  140. GOTO NEXT ;
  141. # #
  142. KLGL1:
  143. IF KNDX GQ KDLGLST[0] AND KNDX LQ KDLGLND[0] THEN
  144. DTYPE=KST"LLK";
  145. KDLGLMX[0] = KDLGLMX[0] - 1 ;
  146. GOTO NEXT ;
  147. # #
  148. NEXT:
  149. KUPVTAB;
  150.  
  151. # SHIFT DISPLAY TO DELETE LINE #
  152.  
  153. IF DTYPE NQ KST"RESERVED" THEN
  154. BEGIN
  155. FOR I=KN+1 STEP 1 UNTIL KDVWLN[0]-1 DO
  156. KLGLDTA[I-1]=KLGLDTA[I];
  157.  
  158. KLGLDTA[KDVWLN[0]-1]=" ";
  159.  
  160. # NOW DECIDE TYPE OF NEW LAST LINE IN DISPLAY #
  161.  
  162. IF KDLGLST[0] NQ 0 THEN
  163. BEGIN
  164. DTYPE=KST"LLK";
  165. IF KDESTST[0] EQ 0 THEN
  166. KN=KDLGLND[0]-KDLGLST[0];
  167. ELSE
  168. IF KDAPPST[0] EQ 0 THEN
  169. KN=KDLGLND[0]+KDESTND[0]-KDESTST[0];
  170. ELSE
  171. KN=KDLGLND[0]+KDESTND[0]+KDAPPND[0]-KDAPPST[0];
  172.  
  173. IF KN LS KDVWLN[0]-1 THEN
  174. DTYPE=KST"RESERVED";
  175.  
  176. END
  177. ELSE IF KDESTST[0] NQ 0 THEN
  178. DTYPE=KST"EST";
  179. ELSE
  180. DTYPE=KST"APP";
  181.  
  182. END
  183.  
  184. IF IEND[DTYPE] EQ 1 OR IEND[DTYPE] EQ 3 THEN
  185. BEGIN
  186. PARAMS1=0;
  187. DTYPE=KST"RESERVED";
  188. END
  189.  
  190. IF DTYPE NQ KST"RESERVED" THEN
  191. BEGIN
  192. PARAMS5=TRUE;
  193. PARAMS3=DTYPE;
  194. END
  195.  
  196. IF IEND[DTYPE] EQ 2 THEN
  197. BEGIN
  198. PARAMS1=2;
  199. DTYPE=KST"RESERVED";
  200. END
  201.  
  202. IF TYPE EQ KST"LLK" OR DTYPE EQ KST"LLK" THEN
  203. BEGIN
  204.  
  205. # CHECK LLCB-S FOR LAST LINE IN DISPLAY AND UPDATED VALUES #
  206.  
  207. FOR KINDEX=1 STEP 1 UNTIL TNTBS[0]-1 DO
  208. BEGIN
  209. P<LLCB> = TNTLLAD[KINDEX];
  210. KLMORE:
  211. IF P<LLCB> NQ 0 THEN
  212. BEGIN
  213. IF TYPE EQ KST"LLK" AND LLCBKNDX[0] GR KNDX THEN
  214. LLCBKNDX[0]=LLCBKNDX[0]-1;
  215.  
  216. IF DTYPE EQ KST"LLK" AND LLCBKNDX[0] EQ KDLGLND[0] THEN
  217. BEGIN
  218. PARAMS1=LLCBKNDX[0];
  219. PARAMS2=P<LLCB>;
  220. DTYPE=KST"RESERVED";
  221. END
  222. #
  223.   BEFORE WE QUIT,CHECK FOR ANY MORE LL SERVING THE TNT
  224. #
  225. IF LLCBFP[0] NQ 0
  226. THEN
  227. BEGIN
  228. P<LLCB> = LLCBFP[0]; # GET DATA FROM THIS LLCB #
  229. GOTO KLMORE;
  230. END
  231. END
  232. #
  233.   END LLCB SEARCH
  234. #
  235. END
  236. END
  237.  
  238. IF TYPE EQ KST"EST" OR DTYPE EQ KST"EST" THEN
  239. BEGIN
  240.  
  241. # LOCATE EST ENTRY TO DISPLAY ON LAST LINE OF DISPLAY #
  242.  
  243. FOR KINDEX = 0 STEP NBTFETNO UNTIL NBTMAXID
  244. DO
  245. BEGIN
  246. IF TYPE EQ KST"EST" AND NBTKNDX[KINDEX] GR KNDX THEN
  247. NBTKNDX[KINDEX]=NBTKNDX[KINDEX]-1;
  248.  
  249. IF DTYPE EQ KST"EST" AND
  250. NBTKNDX[KINDEX] EQ KDESTND[0] THEN
  251. BEGIN
  252. PARAMS1=NBTKNDX[KINDEX];
  253. PARAMS2=KINDEX;
  254. DTYPE=KST"RESERVED";
  255. END
  256. END
  257. END
  258.  
  259. IF TYPE EQ KST"APP" OR DTYPE EQ KST"APP" THEN
  260. BEGIN
  261.  
  262. FOR KINDEX = 1 STEP 1 UNTIL ATHAN[0] DO
  263. BEGIN
  264. P<ACB> = ATACBA[KINDEX];
  265. IF ATACBA[KINDEX] NQ 0 THEN
  266. BEGIN
  267. IF TYPE EQ KST"APP" AND ACBKNDX[0] GR KNDX THEN
  268. ACBKNDX[0]=ACBKNDX[0]-1;
  269.  
  270. IF DTYPE EQ KST"APP" AND ACBKNDX[0] EQ KDAPPND[0] THEN
  271. BEGIN
  272. PARAMS1=KDAPPND[0];
  273. PARAMS2=ATACBA[KINDEX];
  274. DTYPE=KST"RESERVED";
  275. END
  276. END
  277. END
  278. END
  279.  
  280. IF DTYPE NQ KST"RESERVED" THEN PARAMS5=FALSE; # DO NOT CALL ADD #
  281. KLGLEND[KDVWLN[0]-1]=0; # MAKE SURE DISPLAY LINE IS TERMINATED #
  282. GOTO RJMAIN;
  283. END
  284. TERM
cdc/nos2.source/nam5871/kdel.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator