User Tools

Site Tools


cdc:nos2.source:nam5871:kadd

Table of Contents

KADD

Table Of Contents

  • [00014] PRGM KADD
  • [00082] PROC KUPVTAB
  • [00083] PROC KPUT
  • [00084] PROC XTRACE

Source Code

KADD.txt
  1. *DECK KADD
  2. USETEXT NIPDEF
  3. USETEXT AT
  4. USETEXT PT
  5. USETEXT KDIS
  6. USETEXT KINITBF
  7. USETEXT KSTTAB
  8. USETEXT ACB
  9. USETEXT LLCB
  10. USETEXT NBT
  11. USETEXT PARAMS
  12. USETEXT DRHDR
  13. USETEXT KHDRX
  14. PRGM KADD;
  15. STARTIMS;
  16. #
  17. *1DC KADD
  18. *
  19. * 1.PROC NAME AUTHOR DATE
  20. * KADD A.BEN-ARTZI 82/03/04
  21. * M.GIBIAN 83/12/20
  22. *
  23. * 2.FUNCTIONAL DESCRIPTION
  24. *
  25. * ADD A NEW LINE INTO THE STATUS DISPLAY AND UPDATE DISPLAY IF
  26. * CURRENTLY IN VIEW.
  27. *
  28. * 3.METHOD USED
  29. *
  30. * - SET STRUCTURE INDEX TO 0 TO INDICATE NEW LINE NOT DISPLAYED
  31. *
  32. * - ASSIGN RELATIVE LINE NUMBER TO NEW LINE AND UPDATE VIEW TABLE
  33. *
  34. * - IF IN VIEW, SET STRUCTURE INDEX AND STRUCTURE ADDRESS, AND
  35. * SET ABSOLUTE ADDRESS OF NEW LINE
  36. *
  37. * - IF STUCTURE INDEX IS NON-ZERO, MOVE DISPLAY AND DISPLAY NEW
  38. * LINE
  39. *
  40. * 4.ENTRY PARAMETERS
  41. *
  42. * TYPE - 1,2,OR 3 STANDS FOR ACB,NBT OR LLCB, TYPE ST-LINE.
  43. *
  44. * ADDRESS - THE ADDRESS OF PROPER DATA STRUCTURE
  45. *
  46. * 5.EXIT PARAMETERS
  47. *
  48. * NONE
  49. *
  50. * 6.COMDECKS AND TEXTS
  51. *
  52. * NIPDEF KDIS KINITBF KSTTAB
  53. * KHDRX
  54. * ACB LLCB NBT DRHDR
  55. *
  56. * 7.ROUTINES AND OVERLAYS CALLED
  57. *
  58. * KPUT - UPDATE ST-VALUE
  59. * KUPVTAB- UPDATE VIEW TABLE
  60. * XTRACE- MARK NAME IN TRACE BUFFER
  61. *
  62. *
  63. * 8.DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
  64. * THIS PROCEDURE IS CALLED BY BLDACB,BLDLLCB,XCHKCET
  65. *
  66.  #
  67. STOPIMS;
  68. #
  69.   INPUT PARAMETERS
  70. #
  71. ITEM TYPE S:KST; # STATUS LINE BUFFER TYPE #
  72. ITEM ADDRESS; # ACB ADDRESS/NBT ENTRY INDEX/LLCB ADDRESS#
  73. #
  74.   OUTPUT PARAMETERS
  75.   NONE
  76. #
  77. #
  78.   EXTERNAL REFERENCES
  79. #
  80. XREF
  81. BEGIN
  82. PROC KUPVTAB; # UPDATE VIEW TABLE #
  83. PROC KPUT; # UPDATE STATUS DISPLAY #
  84. PROC XTRACE; # TRACE CALL #
  85. LABEL RJMAIN;
  86. END
  87. #
  88.   LOCAL VARIABLES
  89. #
  90. ITEM I; # INDUCTION VARIABLE #
  91. ITEM KN; # TEMPORARY DISPLAY LINE INDEX #
  92. ITEM STRIND U; # STRUCTURE INDEX #
  93.  
  94. BASED ARRAY INDEXES S(1);
  95. BEGIN
  96. ITEM ISTART U(0,9,9); # START INDEX IN VIEW TABLE ARRAY #
  97. ITEM IEND U(0,18,9); # END INDEX IN VIEW TABLE ARRAY #
  98. END
  99.  
  100. SWITCH KLAB:KST
  101. LB$APP:APP,
  102. LB$EST:EST,
  103. LB$LLK:LLK;
  104.  
  105. CONTROL EJECT;
  106.  
  107. BEGIN # KADD #
  108.  
  109. CONTROL IFEQ DEBUG,1;
  110. XTRACE("KADD"); # TRACE CALL #
  111. CONTROL FI;
  112.  
  113. #
  114.   UPDATE SPECIFIC DATA ACORDING TO THE TYPE
  115. #
  116. TYPE=PARAMS1;
  117. PARAMS1=0;
  118. ADDRESS=PARAMS2;
  119. STRIND=0; # INDICATE LINE ADDED IS NOT DIPLAYED #
  120. GOTO KLAB[TYPE]; # SWITCH ON BUFFER TYPE #
  121.  
  122. LB$APP: # ADD NEW APPLICATION TO STATUS DISPLAY #
  123. KDAPPMX[0]=KDAPPMX[0]+1; #ADD NEW APPLICATION TO COUNT OF APPS #
  124. KPUT(LOC(KHDRXNM),0,KPHXNAP,KDAPPMX[0]-3);
  125.  
  126. P<ACB> = ADDRESS; # FWA OF ACB #
  127. ACBKNDX[0] = KDAPPMX[0]; # RESET STATUS DISPLAY LINE INDEX #
  128.  
  129. KUPVTAB; # ADJUST VIEW TABLE TO REFLECT NEW LINE #
  130.  
  131. # NOW DETERMINE IF LINE IS BEING DISPLAYED #
  132.  
  133. IF KDAPPST[0] NQ 0 # SOME APPLICATIONS ARE BEING DISPLAYED #
  134. AND ACBKNDX[0] GQ KDAPPST[0] #LINE IS AFTER/IS FIRST LINE #
  135. AND ACBKNDX[0] LQ KDAPPND[0] #LINE IS BEFORE/IS LAST LINE #
  136. THEN
  137. STRIND=ACBKNDX[0];
  138. GOTO LB$;
  139.  
  140. LB$EST: # ADD NEW EST ENTRY TO STATUS DISPLAY #
  141. KDESTMX[0] = KDESTMX[0] + 1;
  142. NBTKNDX[ADDRESS] = KDESTMX[0];
  143.  
  144. KUPVTAB; # UPDATE VIEW TABLE TO REFLECT NEW LINE #
  145.  
  146. # CHECK TO SEE IF THIS LINE IS IN VIEW #
  147.  
  148. IF KDESTST[0] NQ 0 # EST LINE ARE BEING DISPLAYED #
  149. AND KDESTMX[0] GQ KDESTST[0] #GREATER/IS FIRST LINE #
  150. AND KDESTMX[0] LQ KDESTND[0] #LESS/IS LAST LINE #
  151. THEN
  152. STRIND=KDESTMX[0];
  153. GOTO LB$;
  154.  
  155. LB$LLK: # ADD NEW LOGICAL LINK TO STATUS DISPLAY #
  156. KDLGLMX[0] = KDLGLMX[0]+1;
  157. P<LLCB> = ADDRESS; # FWA OF LLCB #
  158. LLCBKNDX[0] = KDLGLMX[0];
  159.  
  160. KUPVTAB; # UPDATE VIEW TABLE TO REFLECT NEW LINE #
  161.  
  162. # CHECK TO SEE IF THIS LINE IS BEING DISPLAYED #
  163.  
  164. IF KDLGLST[0] NQ 0
  165. AND KDLGLMX[0] GQ KDLGLST[0]
  166. AND KDLGLMX[0] LQ KDLGLND[0] THEN
  167. STRIND=KDLGLMX[0];
  168. GOTO LB$;
  169. LB$:
  170. IF STRIND NQ 0 THEN
  171. BEGIN
  172. P<KSTTAB> = KHDRNP[0] + BLKHSIZE + KHDRSIZE;
  173.  
  174. P<INDEXES>=LOC(KDAPPST[0])-1;
  175. FOR I=KST"APP" STEP 1 WHILE ISTART[I] EQ 0 DO;
  176. KN=STRIND-ISTART[I];
  177. FOR I=KST"APP" STEP 1 UNTIL TYPE-1 DO KN=KN+IEND[I];
  178.  
  179. FOR I=KDVWLN[0]-1 STEP -1 UNTIL KN+1 DO
  180. KLGLDTA[I]=KLGLDTA[I-1]; # SHIFT LINE UP ONE POSITION #
  181.  
  182. PARAMS1=STRIND;
  183. PARAMS2=ADDRESS;
  184. PARAMS3=TYPE;
  185. PARAMS5=TRUE;
  186. END
  187.  
  188. GOTO RJMAIN;
  189. END
  190. TERM
cdc/nos2.source/nam5871/kadd.txt ยท Last modified: 2023/08/05 17:22 by Site Administrator