*DECK HSFCBRK
USETEXT NIPDEF
USETEXT PARAMS
USETEXT PT
USETEXT ACB
USETEXT ACNT
USETEXT AT
USETEXT ACNB
USETEXT AHEADER
USETEXT DRHDR
USETEXT KDIS
USETEXT SUPMSG
PRGM HSFCBRK ;
STARTIMS ;
#
*1DC HSFCBRK
*
* 1. PROC NAME AUTHOR DATE
* HSFCBRK L.T.NGUYEN 81/12/10
*
* 2. FUNCTION
* FOFM FC/BRK OR FC/RST AND SEND TO APPLICATION
* IF BREAK - ALSO DELETE MSG QUEUED ON ACNB
*
* 3. METHOD
* ALLOCATE BUFFER FOR FC/BRK(RST)
* LINK TO ACB
*
* 4. ENTRY PARAMETERS:
* PARAMS1 - ACNB
* PARAMS2 - IF BREAK = BUFFER ADDRESS
* IF RST = 0
*
* 5. EXIT PARAMETERS
* NONE
*
* 6. COMDECKS CALLED AND SYMPL TEXTS USED
* NIPDEF PARAMS PT
* ACB ACNT AT
* ACNB AHEADER DRHDR
* NCNB SUPMSG OSSIZE
*
* 7. ROUTINES CALLED
* DELCDR DELINK ACNB FROM CONNECTION DATA RING
* HUPDDAW UPDATE DATA AVAILABLE WORD
* MGETS ALLOCATE A BUFFER
* MRELS RELEASE BUFFER
* BLINK LINK MESSAGE ON DATA RING
* NXBLOCK SEND SPECIAL BLOCKS TO CCP
* OSCHAPP SCHEDULE APPLICATION
* XTRACE TRACE PROCEDURE CALL
*
* 8. DAYFILE MESSAGES AND OTHER IMPORTANT INFORMATION
* THIS IS A SECONDARY OVERLAY CALLED BY HBSTTP.
* W A R N I N G - THIS PROGRAM CANNOT EXCEED THE SECONDARY
*CALL OSSIZE
*
*
#
STOPIMS;
XREF LABEL RJMAIN ;
XREF PROC DELCDR;
XREF PROC HUPDDAW; # UPDATE DATA AVAILABLE WORD #
XREF PROC MGETS ;
XREF PROC MRELS ;
XREF PROC KPUT ;
XREF PROC BLINK ;
XREF PROC OSCHAPP ;
XREF PROC XTRACE ;
ITEM BUFFER ; # BUFFER TO HOLD FC/BRK #
ITEM I ;
ITEM NEXT ;
ITEM TEMPBLKSQ ;
BASED ARRAY NHSECOND P(1) ;
BEGIN
ITEM NHBRKRC U (0,0,8) ;
ITEM NHWORD2 U (0,0,WL) ;
END
ITEM ACNTINDX U ;
BEGIN # HSFCBRK #
CONTROL IFEQ DEBUG,1 ;
XTRACE("HSBRK") ;
CONTROL FI;
TEMPBLKSQ = 0 ;
P<ACNB> = PARAMS1 ;
P<NHSECOND> = PARAMS2 + BLKHSIZE + NBHSIZE ;
IF ACNBDRFP[0] NQ 0
THEN
BEGIN # DISCARD DATA #
NEXT = ACNBDRFP[0] ; # FIRST DATA BLOCK #
P<DRHDRWD> = 0 ;
P<AHEADER> = 0 ;
FOR I = I WHILE NEXT NQ LOC(ACNBDRFP[0])
DO
BEGIN # PROCESS THE WHOLE RING #
BUFFER = NEXT ;
NEXT = NEXTPTR[BUFFER] ; # NEXT OF BUFFER #
TEMPBLKSQ = TEMPBLKSQ + 1 ;
MRELS(BUFFER) ; # RELEASE THE BUFFER BLOCK #
END # PROCESS THE WHOLE RING #
ACNBDRFP[0] = 0 ; # THE WHOLE RING HAS BEEN #
ACNBDRBP[0] = 0 ; # RELEASED #
DELCDR(P<ACNB>); # DELINK ACNB FROM CON DATA RING#
END
P<ACB> = ATACBA[ACNBAN[0]] ;
P<ACNT> = ACBACNT[0] ;
HUPDDAW(P<ACB>,P<ACNB>,-TEMPBLKSQ,-TEMPBLKSQ);
ACNTINDX = ACNBACN[0] - ACNTMINACN[0] + ACNTHSIZE ;
ACNTABO[ACNTINDX] = 0 ;# RESET THE ABO COUNT #
MGETS(LFCBRK + BLKHSIZE + ABHSIZE,BUFFER,TRUE);
# SET UP APPLICATION BLOCK HEADER #
P<AHEADER> = BUFFER + BLKHSIZE ;
ABHABT[0] = APPCMD ; # COMMAND BLOCK #
ABHACT[0] = CT60TRANS ; # CHAR TYPE - TRANSPARENT #
ABHTLC[0] = LFCBRK ;
# SET UP FC/BRK (RST) #
P<SUPMSG> = BUFFER + BLKHSIZE + ABHSIZE ;
FCACN[0] = ACNBACN[0] ;
IF PARAMS2 NQ 0 # (BREAK) #
THEN
BEGIN
PFCSFC[0] = FCBRK ;
FCRBR[0] = NHBRKRC[0] ;
END
ELSE
PFCSFC[0] = FCRST ;
BLINK(BUFFER,ATACBA[ACNBAN[0]]) ;
OSCHAPP(ATACBA[ACNBAN[0]]) ;
GOTO RJMAIN ;
END # HSFCBRK #
TERM