*DECK KDEL
USETEXT NIPDEF
USETEXT KDIS
USETEXT KINITBF
USETEXT KSTTAB
USETEXT ACB
USETEXT LLCB
USETEXT NBT
USETEXT DRHDR
USETEXT KHDRX
USETEXT AT
USETEXT PARAMS
USETEXT PT
USETEXT TNT
PRGM KDEL;
STARTIMS;
#
*1DC KDEL
*
* 1. PROC NAME AUTHOR DATE
* KDEL A.BEN-ARTZI 82/03/04
* M.GIBIAN 83/12/20
*
* 2. FUNCTIONAL DESCRIPTION
*
* DELETE A LINE FROM STATUS DISPLAY (ACB,NBT,OR LLCB)
*
* 3. METHOD USED
*
* -IF DELETED LINE IS BEING DISPLAYED, SET DISPLAY TYPE TO
* THE TYPE OF LINE DELETED. COMPUTE THE CONVERSION FACTOR
* TO CONVERT FROM RELATIVE LINE NUMBER TO ABSOLUTE LINE NUMBER.
*
* -DECREMENT MAXIMUM COUNT FOR LINE TYPE AND UPDATE VIEW TABLE
*
* -IF DELETED LINE IS BEING VIEWED THEN
* SHIFT DISPLAY TO DELETE LINE
* DETERMINE TYPE OF NEW LAST LINE AND SAVE IT. IF LAST LINE
* IS BEYOND END OF DISPLAY, SET TYPE TO RESERVED TO PREVENT
* ANY NEW LINE FROM BEING DISPLAYED.
*
* -SEARCH ACB-S NBTE-S AND LLCB-S TO ADJUST RELATIVE LINE NUMBER
* FOR STRUCTURE OF DELETED LINE, AND TO DISPLAY NEW LAST LINE
*
* 4. ENTRY PARAMETERS
*
* TYPE - 1,2,OR 3 ACCORDING TO ACB,NBT(EST) OR LLCB
*
* KNDX - THE DATA-STRUCTURE INDX INTO THE STATUS DISPLAY BUFFER
*
* 5. EXIT PARAMETERS
*
* NONE
*
* 6. COMDECKS AND TEXTS
*
* NIPDEF KDIS KINITBF
* KHDRX ACB LLCB NBT
* DRHDR AT PT
* TNT
*
* 7. ROUTINES AND OVERLAYS CALLED
*
* KPUT - UPDATE DATA ON STATUS DISPLAY BUFFERS
* KUPVTAB- UPDATE VIEW TABLE
* XTRACE - MARK ROUTINE IN TRACE DUMP
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
*
* THIS PROCEDURE IS CALLED BY NPESTOF,RELACB AND RELLLCB.
*
#
STOPIMS;
XREF BEGIN
PROC KUPVTAB;
PROC KPUT ;
PROC XTRACE ;
LABEL RJMAIN;
END
#
INPUT PARAMETERS
#
ITEM TYPE U; # SPECIFY ACB,NBT(EST) OR LLCB MOD (1,2 OR 3) #
ITEM KNDX U; # THE INDEX INTO ST-DISPLAY BUFFER #
#
INTERNAL VARIABLES
#
ITEM DTYPE S:KST; # TYPE OF DISPLAY CONTAINING LAST LINE #
ITEM BUF U; # ADDRESS OF NEW BUFFER ALLOCATED #
ITEM KN I; # TEMP LINE 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 KLAB1 N1,KAPP1,KEST1,KLGL1;
# #
ITEM SIZE U; # SIZE OF NEW BUFFER #
ITEM I U; # LOOP INDEX #
ITEM KINDEX U; # LOOP INDEX #
# #
#**********************************************************************#
BEGIN
CONTROL IFEQ DEBUG,1;
XTRACE("KDEL ");
CONTROL FI;
TYPE=PARAMS1;
KNDX=PARAMS2;
# #
IF TYPE LS 1 OR TYPE GR 3
THEN # ERROR IN TYPE (INTERNAL NIP) #
RETURN ; # WE SHOULD ABORT NIP HERE #
ELSE
BEGIN
DTYPE=KST"RESERVED";
P<KSTTAB> = KHDRNP[0]+BLKHSIZE+KHDRSIZE;
P<INDEXES>=LOC(KDAPPST[0])-1;
FOR I=KST"APP" STEP 1 WHILE ISTART[I] EQ 0 DO;
KN=KNDX-ISTART[I];
FOR I=KST"APP" STEP 1 UNTIL TYPE-1 DO KN=KN+IEND[I];
GOTO KLAB1[TYPE] ;
END
N1:
RETURN ;
# #
KAPP1:
IF KNDX GQ KDAPPST[0] AND KNDX LQ KDAPPND[0] THEN
DTYPE=KST"APP";
KDAPPMX[0] = KDAPPMX[0] - 1;
KPUT(LOC(KHDRXNM),0,KPHXNAP,KDAPPMX[0]-3) ;
GOTO NEXT ;
# #
KEST1:
IF KNDX GQ KDESTST[0] AND KNDX LQ KDESTND[0] THEN
DTYPE=KST"EST";
KDESTMX[0] = KDESTMX[0] - 1 ;
GOTO NEXT ;
# #
KLGL1:
IF KNDX GQ KDLGLST[0] AND KNDX LQ KDLGLND[0] THEN
DTYPE=KST"LLK";
KDLGLMX[0] = KDLGLMX[0] - 1 ;
GOTO NEXT ;
# #
NEXT:
KUPVTAB;
# SHIFT DISPLAY TO DELETE LINE #
IF DTYPE NQ KST"RESERVED" THEN
BEGIN
FOR I=KN+1 STEP 1 UNTIL KDVWLN[0]-1 DO
KLGLDTA[I-1]=KLGLDTA[I];
KLGLDTA[KDVWLN[0]-1]=" ";
# NOW DECIDE TYPE OF NEW LAST LINE IN DISPLAY #
IF KDLGLST[0] NQ 0 THEN
BEGIN
DTYPE=KST"LLK";
IF KDESTST[0] EQ 0 THEN
KN=KDLGLND[0]-KDLGLST[0];
ELSE
IF KDAPPST[0] EQ 0 THEN
KN=KDLGLND[0]+KDESTND[0]-KDESTST[0];
ELSE
KN=KDLGLND[0]+KDESTND[0]+KDAPPND[0]-KDAPPST[0];
IF KN LS KDVWLN[0]-1 THEN
DTYPE=KST"RESERVED";
END
ELSE IF KDESTST[0] NQ 0 THEN
DTYPE=KST"EST";
ELSE
DTYPE=KST"APP";
END
IF IEND[DTYPE] EQ 1 OR IEND[DTYPE] EQ 3 THEN
BEGIN
PARAMS1=0;
DTYPE=KST"RESERVED";
END
IF DTYPE NQ KST"RESERVED" THEN
BEGIN
PARAMS5=TRUE;
PARAMS3=DTYPE;
END
IF IEND[DTYPE] EQ 2 THEN
BEGIN
PARAMS1=2;
DTYPE=KST"RESERVED";
END
IF TYPE EQ KST"LLK" OR DTYPE EQ KST"LLK" THEN
BEGIN
# CHECK LLCB-S FOR LAST LINE IN DISPLAY AND UPDATED VALUES #
FOR KINDEX=1 STEP 1 UNTIL TNTBS[0]-1 DO
BEGIN
P<LLCB> = TNTLLAD[KINDEX];
KLMORE:
IF P<LLCB> NQ 0 THEN
BEGIN
IF TYPE EQ KST"LLK" AND LLCBKNDX[0] GR KNDX THEN
LLCBKNDX[0]=LLCBKNDX[0]-1;
IF DTYPE EQ KST"LLK" AND LLCBKNDX[0] EQ KDLGLND[0] THEN
BEGIN
PARAMS1=LLCBKNDX[0];
PARAMS2=P<LLCB>;
DTYPE=KST"RESERVED";
END
#
BEFORE WE QUIT,CHECK FOR ANY MORE LL SERVING THE TNT
#
IF LLCBFP[0] NQ 0
THEN
BEGIN
P<LLCB> = LLCBFP[0]; # GET DATA FROM THIS LLCB #
GOTO KLMORE;
END
END
#
END LLCB SEARCH
#
END
END
IF TYPE EQ KST"EST" OR DTYPE EQ KST"EST" THEN
BEGIN
# LOCATE EST ENTRY TO DISPLAY ON LAST LINE OF DISPLAY #
FOR KINDEX = 0 STEP NBTFETNO UNTIL NBTMAXID
DO
BEGIN
IF TYPE EQ KST"EST" AND NBTKNDX[KINDEX] GR KNDX THEN
NBTKNDX[KINDEX]=NBTKNDX[KINDEX]-1;
IF DTYPE EQ KST"EST" AND
NBTKNDX[KINDEX] EQ KDESTND[0] THEN
BEGIN
PARAMS1=NBTKNDX[KINDEX];
PARAMS2=KINDEX;
DTYPE=KST"RESERVED";
END
END
END
IF TYPE EQ KST"APP" OR DTYPE EQ KST"APP" THEN
BEGIN
FOR KINDEX = 1 STEP 1 UNTIL ATHAN[0] DO
BEGIN
P<ACB> = ATACBA[KINDEX];
IF ATACBA[KINDEX] NQ 0 THEN
BEGIN
IF TYPE EQ KST"APP" AND ACBKNDX[0] GR KNDX THEN
ACBKNDX[0]=ACBKNDX[0]-1;
IF DTYPE EQ KST"APP" AND ACBKNDX[0] EQ KDAPPND[0] THEN
BEGIN
PARAMS1=KDAPPND[0];
PARAMS2=ATACBA[KINDEX];
DTYPE=KST"RESERVED";
END
END
END
END
IF DTYPE NQ KST"RESERVED" THEN PARAMS5=FALSE; # DO NOT CALL ADD #
KLGLEND[KDVWLN[0]-1]=0; # MAKE SURE DISPLAY LINE IS TERMINATED #
GOTO RJMAIN;
END
TERM