Spooler Plus Programmer's Guide
Sample Print Process
Spooler Plus Programmer’s Guide—522293-003
A-4
LITERAL missing^parameter = 29;
INT err := 0,
flags^ := 0;
!---Beginning of code--------------------------------------------------
IF NOT ($PARAM (fname) AND $PARAM (fnum)) THEN
RETURN missing^parameter;
IF $PARAM (flags) THEN
flags^ := flags;
CALL OPEN (fname, fnum, flags^);
IF < THEN
CALL FILEINFO (-1, err);
RETURN err;
END;
! *===================================================================*
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! procedure name: WRITEFILE
! parameters: FNUM - file number
! BUF - buffer that contains the text to be written
! WRITE^COUNT - number of bytes to be written
! description: This procedure is the same as the Guardian file-
! system procedure "WRITE", plus a check of the returned
! condition code. Returns a Guardian file-system error
! number if condition code < 0.
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
INT PROC writefile (fnum, buf, write^count);
INT fnum,
.buf,
write^count;
BEGIN
INT err := 0;
!---Beginning of code--------------------------------------------------
CALL WRITE (fnum, buf, write^count);
IF < THEN
CALL FILEINFO (fnum, err);
RETURN err;
END;
! *===================================================================*
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
! procedure name: TELL^SUPER
! parameters: TYPE - type of message sent
! DEVICE - name of the device on which the error occurred
! ERROR - the error number that caused this call to
! TELL^SUPER
! PAGE - current page number, required parameter for type
! 0
! LINE - current line number, required parameter for type
! 0
! TOTAL^LINES - total number of lines printed, required
! parameter for type 0
! NUM^COPIES - number of copies of the job remaining to be
! printed, required parameter for type 0
! description: This procedure informs the spooler supervisor that an
! error occurred (Guardian file-system error number) or
! responds to a request for the status of a job by
! calling PRINTSTATUS. The parameters to this procedure
! are exactly the same as those of PRINTSTATUS, except