C+ C C Retrieve parameters or exit subroutine (RCVPRM) C C C FUNCTION: C This subroutine is used to retreive parameters C passed via program activation. C C C CALLING SEQUENCE: C C CALL RCVPRM(PRMBUF, NPRM) C C WHERE: C ARGUMENT = DESCRIPTION ACCESS C PRMBUF = Buffer for parameters RE C NPRM = Passed as maximum number of parameters PA/RE C PRMBUF sized for. C C SUBROUTINES REFERENCED: C PIPE ALTPRI BUGMSG GETTSK C SETEF C C C DESCRIPTION: C RCVPRM fetches the task name then, reads the program parameter C pipe to see if there is anything queued. If not, RCVPRM C causes the program to exit. If parameters are obtained, the C parameters are passed back to the program. The calling program C must keep calling RCVPRM until it exits. C C SPECIAL CONSIDERATIONS: C 1. Program must be privleged (PR:0) C- SUBROUTINE RCVPRM(PRMBUF, NPRM) IMPLICIT INTEGER(A-Z) DIMENSION PGMNAM(18), PRMBUF(1) C C C C Get the task name. C CALL GETTSK (PGMNAM, IDS) IF (IDS .NE. 1) THEN CALL BUGMSG ('Unable to get task information, error = ',IDS) GOTO 500 ENDIF C C C CALL ALTPRI(, 200, IDS) IF (IDS .NE. 1) THEN CALL BUGMSG ('Unable to alter priority, error = ',IDS) GOTO 500 ENDIF C C Request data from our pipe; C if none, C set 'remove' event; C exit. C else, C return to calling program with parameters. C NWDS = NPRM CALL PIPE( 3, 2, PGMNAM, PRMBUF, NWDS, IDS) IF (IDS .EQ. 0)GOTO 20 IF (IDS .NE. -105) THEN CALL BUGMSG ('Error from VX driver = ',IDS) GOTO 500 ENDIF IF (EF .EQ. 0)GO TO 10 CALL SETEF(EF) CALL DECLAR 10 CONTINUE CALL EXIT 20 CONTINUE CALL ALTPRI IF (EF .EQ. 0) EF = PRMBUF(3) C C Calculate number of parameters passed; C Copy to parameter buffer over task name; C return. NPRM = NWDS - 3 IF (NPRM .GT. 0) THEN DO 100 I = 1, NPRM PRMBUF(I) = PRMBUF(I+3) 100 CONTINUE ENDIF C C Return to calling task. C RETURN C C Error exit. C 500 CONTINUE CALL EXIT END