Guardian Programmer's Guide

Table Of Contents
Writing a Server Program
Guardian Programmer’s Guide 421922-014
22 - 20
The Part-Query Server ($SER1)
! If unable to position to the requested key, return
! the error number. This error occurs when the key is
! not in the inventory file.
IF <> THEN
BEGIN
CALL FILE_GETINFO_(INV^FNUM,REPLY^ERROR);
RETURN;
END;
! Clear the REPLY^ERROR variable if the read is
! successful:
REPLY^LEN := $LEN(PART^REC);
REPLY^ERROR := 0;
RETURN;
END;
! Check next entry in the opener table:
I := I + 1;
END;
! Requester not in opener table:
REPLY^ERROR := 60;
END;
!------------------------------------------------------------
! Procedure to process an Open system message (-103). It
! places the process handle of the requester in the opener
! table, if there is room. If the table is full, it
! rejects the open.
!------------------------------------------------------------
PROC PROCESS^OPEN^MESSAGE;
BEGIN
INT I;
INT J;
INT COUNT;
! Check if opener table full. Return "file in use" error if
! it is full:
IF OPENER^TABLE.CURRENT^COUNT >= MAX^OPENERS THEN
BEGIN
REPLY^ERROR := 12;
RETURN;
END;