*DECK KADD USETEXT NIPDEF USETEXT AT USETEXT PT USETEXT KDIS USETEXT KINITBF USETEXT KSTTAB USETEXT ACB USETEXT LLCB USETEXT NBT USETEXT PARAMS USETEXT DRHDR USETEXT KHDRX PRGM KADD; STARTIMS; # *1DC KADD * * 1.PROC NAME AUTHOR DATE * KADD A.BEN-ARTZI 82/03/04 * M.GIBIAN 83/12/20 * * 2.FUNCTIONAL DESCRIPTION * * ADD A NEW LINE INTO THE STATUS DISPLAY AND UPDATE DISPLAY IF * CURRENTLY IN VIEW. * * 3.METHOD USED * * - SET STRUCTURE INDEX TO 0 TO INDICATE NEW LINE NOT DISPLAYED * * - ASSIGN RELATIVE LINE NUMBER TO NEW LINE AND UPDATE VIEW TABLE * * - IF IN VIEW, SET STRUCTURE INDEX AND STRUCTURE ADDRESS, AND * SET ABSOLUTE ADDRESS OF NEW LINE * * - IF STUCTURE INDEX IS NON-ZERO, MOVE DISPLAY AND DISPLAY NEW * LINE * * 4.ENTRY PARAMETERS * * TYPE - 1,2,OR 3 STANDS FOR ACB,NBT OR LLCB, TYPE ST-LINE. * * ADDRESS - THE ADDRESS OF PROPER DATA STRUCTURE * * 5.EXIT PARAMETERS * * NONE * * 6.COMDECKS AND TEXTS * * NIPDEF KDIS KINITBF KSTTAB * KHDRX * ACB LLCB NBT DRHDR * * 7.ROUTINES AND OVERLAYS CALLED * * KPUT - UPDATE ST-VALUE * KUPVTAB- UPDATE VIEW TABLE * XTRACE- MARK NAME IN TRACE BUFFER * * * 8.DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION * THIS PROCEDURE IS CALLED BY BLDACB,BLDLLCB,XCHKCET * # STOPIMS; # INPUT PARAMETERS # ITEM TYPE S:KST; # STATUS LINE BUFFER TYPE # ITEM ADDRESS; # ACB ADDRESS/NBT ENTRY INDEX/LLCB ADDRESS# # OUTPUT PARAMETERS NONE # # EXTERNAL REFERENCES # XREF BEGIN PROC KUPVTAB; # UPDATE VIEW TABLE # PROC KPUT; # UPDATE STATUS DISPLAY # PROC XTRACE; # TRACE CALL # LABEL RJMAIN; END # LOCAL VARIABLES # ITEM I; # INDUCTION VARIABLE # ITEM KN; # TEMPORARY DISPLAY LINE INDEX # ITEM STRIND U; # STRUCTURE INDEX # BASED ARRAY INDEXES S(1); BEGIN ITEM ISTART U(0,9,9); # START INDEX IN VIEW TABLE ARRAY # ITEM IEND U(0,18,9); # END INDEX IN VIEW TABLE ARRAY # END SWITCH KLAB:KST LB$APP:APP, LB$EST:EST, LB$LLK:LLK; CONTROL EJECT; BEGIN # KADD # CONTROL IFEQ DEBUG,1; XTRACE("KADD"); # TRACE CALL # CONTROL FI; # UPDATE SPECIFIC DATA ACORDING TO THE TYPE # TYPE=PARAMS1; PARAMS1=0; ADDRESS=PARAMS2; STRIND=0; # INDICATE LINE ADDED IS NOT DIPLAYED # GOTO KLAB[TYPE]; # SWITCH ON BUFFER TYPE # LB$APP: # ADD NEW APPLICATION TO STATUS DISPLAY # KDAPPMX[0]=KDAPPMX[0]+1; #ADD NEW APPLICATION TO COUNT OF APPS # KPUT(LOC(KHDRXNM),0,KPHXNAP,KDAPPMX[0]-3); P = ADDRESS; # FWA OF ACB # ACBKNDX[0] = KDAPPMX[0]; # RESET STATUS DISPLAY LINE INDEX # KUPVTAB; # ADJUST VIEW TABLE TO REFLECT NEW LINE # # NOW DETERMINE IF LINE IS BEING DISPLAYED # IF KDAPPST[0] NQ 0 # SOME APPLICATIONS ARE BEING DISPLAYED # AND ACBKNDX[0] GQ KDAPPST[0] #LINE IS AFTER/IS FIRST LINE # AND ACBKNDX[0] LQ KDAPPND[0] #LINE IS BEFORE/IS LAST LINE # THEN STRIND=ACBKNDX[0]; GOTO LB$; LB$EST: # ADD NEW EST ENTRY TO STATUS DISPLAY # KDESTMX[0] = KDESTMX[0] + 1; NBTKNDX[ADDRESS] = KDESTMX[0]; KUPVTAB; # UPDATE VIEW TABLE TO REFLECT NEW LINE # # CHECK TO SEE IF THIS LINE IS IN VIEW # IF KDESTST[0] NQ 0 # EST LINE ARE BEING DISPLAYED # AND KDESTMX[0] GQ KDESTST[0] #GREATER/IS FIRST LINE # AND KDESTMX[0] LQ KDESTND[0] #LESS/IS LAST LINE # THEN STRIND=KDESTMX[0]; GOTO LB$; LB$LLK: # ADD NEW LOGICAL LINK TO STATUS DISPLAY # KDLGLMX[0] = KDLGLMX[0]+1; P = ADDRESS; # FWA OF LLCB # LLCBKNDX[0] = KDLGLMX[0]; KUPVTAB; # UPDATE VIEW TABLE TO REFLECT NEW LINE # # CHECK TO SEE IF THIS LINE IS BEING DISPLAYED # IF KDLGLST[0] NQ 0 AND KDLGLMX[0] GQ KDLGLST[0] AND KDLGLMX[0] LQ KDLGLND[0] THEN STRIND=KDLGLMX[0]; GOTO LB$; LB$: IF STRIND NQ 0 THEN BEGIN P = KHDRNP[0] + BLKHSIZE + KHDRSIZE; P=LOC(KDAPPST[0])-1; FOR I=KST"APP" STEP 1 WHILE ISTART[I] EQ 0 DO; KN=STRIND-ISTART[I]; FOR I=KST"APP" STEP 1 UNTIL TYPE-1 DO KN=KN+IEND[I]; FOR I=KDVWLN[0]-1 STEP -1 UNTIL KN+1 DO KLGLDTA[I]=KLGLDTA[I-1]; # SHIFT LINE UP ONE POSITION # PARAMS1=STRIND; PARAMS2=ADDRESS; PARAMS3=TYPE; PARAMS5=TRUE; END GOTO RJMAIN; END TERM