*DECK SSCCTR
USETEXT TEXTSS
PROC SSCCTR (CNUM,SUCCESS);
# TITLE SSCCTR - CANCEL TIMER REQUEST. #
BEGIN # SSCCTR #
#
** SSCCTR - CANCEL TIMER REQUEST.
*
* F. HOU. 81/09/10.
*
* THIS PROCEDURE USES THE TIMER-CANCELLATION-NUMBER TO FIND
* THE CORRESPONDING TIMER ENTRY AND REMOVES IT.
*
* PROC SSCCTR (CNUM,SUCCESS)
*
* ENTRY CNUM = THE TIMER-CANCELLATION-NUMBER.
* SUCCESS= BOOLEAN FLAG TO INDICATE ENTRY WAS CANCELLED?
*
* EXIT THE TIMER REQUEST IS CANCELLED.
*
* NOTES NONE.
*
* METHOD
*
* SEARCH TRQ1 FOR ENTRY WITH MATCHING TIMER-CANCELLATION-NUMBER.
* IF NO MATCH FOUND,SET FLAG TO INDICATE FAIL.
* IF MATCH FOUND, REMOVE ENTRY, SET FLAG TO INDICATE SUCCESS.
* IF MORE ENTRY IN TRQ1, SET CTM FIRE-TIME TO TRQ1[0] FIRE-TIME.
* ELSE, SET CTM FIRE-TIME TO 77777777.
* RETURN WITH FLAG INDICATING FAIL/SUCESS.
*
#
ITEM CNUM U; # TIMER CANCELLATION NUMBER #
ITEM SUCCESS B; # FLAG TO INDICATE ENTRY WAS CANCELLED? #
#
****
#
XREF
BEGIN
PROC SSTRTS; # REMOVE TABLE SPACE #
END
#
****
#
ITEM I U; # I IS A LOOP VARIABLE #
ITEM II I; # II=I #
CONTROL EJECT;
P<TRQ1>=SSTRQ[0]; # SET BASED ARRAY-TRQ1 POINTER. #
IF (SSTRQL[0] EQ 0)
THEN
BEGIN
SUCCESS=FALSE; # RESET SUCCESS FLAG TO INDICATE FAIL #
RETURN;
END
II=0; # INITIAL VALUE OF II #
FOR I=0 STEP 1 WHILE I LS (SSTRQL[0]/4)
AND (CNUM NQ TRQ1$CNUM[I])
DO
BEGIN
II=I;
END
IF (II EQ (SSTRQL[0]/4-1)) AND
(CNUM NQ TRQ1$CNUM[II])
THEN
BEGIN
SUCCESS=FALSE; # RESET SUCCESS FLAG TO INDICATE FAIL #
RETURN;
END
# I=0 CASE #
IF (II EQ 0) AND
((SSTRQL[0] EQ 0) OR (CNUM EQ TRQ1$CNUM[0]))
THEN
BEGIN
II=II-1;
END
SUCCESS=TRUE; # SET SUCESS FLAG TO INDICATE SUCCESS #
SSTRTS (SSITRQ,(II+1)*4,TRQ1$ENTRY[II+1]); #REMOVE TABLE SPACE #
IF(SSTRQL[0] NQ 0)
THEN
BEGIN
CTM$FTIME[0]=TRQ1$FTIME[0]; # SET CTM FTIME TO TRQ1[0] FTIME #
END
ELSE
BEGIN
CTM$FTIME[0]=O"77777777";
END
END # SSCCTR #
TERM