*DECK INSCDR
USETEXT NIPDEF
USETEXT ACNB
USETEXT ACB
USETEXT AT
PROC INSCDR((ACNBFWA)); # ADD ACNB TO CDR #
STARTIMS ;
#
*1DC INSALR
* 1. PROC NAME AUTHOR DATE
* INSCDR E. GEE 85/04/02
*
* 2. FUNCTIONAL DESCRIPTION
* INSERT ACNB INTO THE CONNECTION DATA RING, IF ONE EXISTS.
* IF NONE EXIST, CREATE ONE WITH THIS ACNB.
*
* 3. METHOD
* IF NO CONNECTION DATA RING EXISTS,
* UPDATE ACB TO POINT TO THIS ACNB.
* ELSE (CONNECTION DATA RING ALREADY EXISTS),
* ADD THIS ACNB TO CONNECTION DATA RING. IT IS LINKED IN
* FRONT OF THE ACNB POINTED TO BY THE ACB.
*
* 4. ENTRY PARAMETERS
* ACNBFWA - FIRST WORD ADDRESS OF THIS ACNB.
*
* 5. EXIT PARAMETERS
* NONE
*
* 6. COMDECKS CALLED
* ACNB
* ACB
* AT
* NIPDEF
*
* 7. ROUTINES CALLED
* XTRACE - TRACE PROCEDURE CALL
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
*
#
STOPIMS;
#
EXTERNAL REFERENCES
#
XREF
BEGIN
PROC XTRACE;
END
#
FORMAL PARAMETERS
#
ITEM ACNBFWA U; # FWA OF ACNB TO BE ADDED TO CDR#
#
LOCAL VARIABLES
#
ITEM CDRBP; # CDR BACK POINTER #
CONTROL EJECT;
BEGIN # BEGIN INSCDR #
CONTROL IFEQ DEBUG,1;
XTRACE("INCDR");
CONTROL FI;
P<ACNB> = ACNBFWA;
P<ACB> = ATACBA[ACNBAN[0]]; # FWA OF ACB #
IF ACBCDRP[0] NQ 0
THEN # CONNECTION DATA RING EXISTS #
BEGIN
P<ACNB> = ACBCDRP[0]; # FWA OF ACNB #
CDRBP = ACNBCDRBP[0]; # ADDR OF PREV ACNB IN CDR #
ACNBCDRBP[0] = ACNBFWA; # ADDR OF NEW LAST ACNB IN CDR #
P<ACNB> = ACNBFWA;
ACNBCDRBP[0] = CDRBP; # ADDR OF NEXT TO LAST ACNB #
ACNBCDRFP[0] = ACBCDRP[0]; # ADDR OF FIRST ACNB IN CDR #
P<ACNB> = CDRBP; # NEXT TO LAST ACNB IN CDR #
ACNBCDRFP[0] = ACNBFWA; # ADDR OF NEW LAST ACNB IN CDR #
END
ELSE # NO CONNECTION DATA RING EXISTS#
BEGIN
ACNBCDRFP[0] = ACNBFWA;
ACNBCDRBP[0] = ACNBFWA;
ACBCDRP[0] = ACNBFWA;
END
RETURN;
END # END INSCDR #
TERM