Guardian Programmer's Guide

Table Of Contents
Writing a Server Program
Guardian Programmer’s Guide 421922-014
22 - 13
The Part-Query Server ($SER1)
message as a key to the inventory file to access the desired record. If the record
exists, then the record is returned to the SERVER procedure with an error condition of
zero. If the record does not exist, then the file-system error number is returned without
a part record.
The Code for the Part-Query Server ($SER1)
The code for the part-query server program appears on the following pages.
?INSPECT, SYMBOLS, NOCODE
?NOLIST, SOURCE $SYSTEM.ZSYSDEFS.ZSYSTAL
?LIST
!-----------------------
!Literals:
!-----------------------
LITERAL MAX^OPENERS = 2, !maximum number of openers
! allowed
EXACT = 2, !for exact key positioning
MAXFLEN = ZSYS^VAL^LEN^FILENAME,
!maximum length for file name
BUFSIZE = 512; !size of I/O buffer
!------------------------
!Global data structures:
!------------------------
!Data structure for Startup message:
STRUCT .START^UP^MESSAGE;
BEGIN
INT MSG^CODE;
STRUCT DEFAULT;
BEGIN
INT VOLUME[0:3];
INT SUBVOLUME[0:3];
END;
STRUCT INFILE; !IN file name
BEGIN
INT VOLUME[0:3];
INT SUBVOLUME[0:3];
INT FILENAME[0:3];
END;
STRUCT OUTFILE; !OUT file name
BEGIN
INT VOLUME[0:3];
INT SUBVOLUME[0:3];
INT FILENAME[0:3];
END;
STRING PARAM[0:529]; !parameter string
END;
INT MESSAGE^LEN; !length of Startup message