Guardian Programmer's Guide

Table Of Contents
Writing a Server Program
Guardian Programmer’s Guide 421922-014
22 - 49
The Order-Query Server ($SER3)
The user message read by the SERVER procedure contains a 28-digit order number
used to refer to the desired order record.
If the requester process is in the opener table, then the PROCESS^USER^REQUEST
procedure uses the 28-digit order number provided in the message read by the
SERVER procedure as a primary key to the orders file. After reading the record from
the file, the procedure saves the record for the SERVER procedure to send back to the
requester.
The Code for the Order-Query Server ($SER3)
The code for the order-query server program appears on the following pages.
?INSPECT, SYMBOLS, NOCODE
?NOLIST, SOURCE $TOOLS.ZTOOLD04.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;
!------------------------
!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;