FetchP70V1ServerImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by BJackson.pa at March 21, 1987 5:49:26 pm PST
using Sirocco [2.0] of January 31, 1987 1:52:42 am PST
DIRECTORY
CrRPC,
FetchP70V1;
FetchP70V1ServerImpl:
CEDAR
PROGRAM
IMPORTS CrRPC, FetchP70V1 ~ {
OPEN FetchP70V1;
FindCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
file: ROPE;
release: ROPE;
getDFName: BOOLEAN;
getFilePath: BOOLEAN;
getCreateDate: BOOLEAN;
dfName: ROPE;
filePath: ROPE;
createDate: ROPE;
nMatches: CARD16;
{
file ← CrRPC.GetRope[s];
};
{
release ← CrRPC.GetRope[s];
};
{
getDFName ← CrRPC.GetBool[s];
};
{
getFilePath ← CrRPC.GetBool[s];
};
{
getCreateDate ← CrRPC.GetBool[s];
};
[dfName, filePath, createDate, nMatches] ← Find[h, file, release, getDFName, getFilePath, getCreateDate];
beginReturn[h];
{
CrRPC.PutRope[s, dfName];
};
{
CrRPC.PutRope[s, filePath];
};
{
CrRPC.PutRope[s, createDate];
};
{
CrRPC.PutCard16[s, nMatches];
};
};
PredicateCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
release: ROPE;
respond: BOOLEAN;
{
release ← CrRPC.GetRope[s];
};
[respond] ← Predicate[h, release];
beginReturn[h];
{
CrRPC.PutBool[s, respond];
};
};
Server: CrRPC.ServerProc ~ {
[h: Handle, s: STREAM, pgm: CARD32, pgmVersion: CARD16, proc: CARD16, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc]
ENABLE {
FetchP70V1.BadFileName => {
-- (12 )
beginError[h, 12 ];
GOTO Finished;
};
FetchP70V1.CantOpenLogFile => {
-- (10 )
beginError[h, 10 ];
GOTO Finished;
};
FetchP70V1.ServerNotFound => {
-- (5 )
beginError[h, 5 ];
GOTO Finished;
};
FetchP70V1.NilHeap => {
-- (9 )
beginError[h, 9 ];
GOTO Finished;
};
FetchP70V1.BadParameters => {
-- (2 )
beginError[h, 2 ];
GOTO Finished;
};
FetchP70V1.BadRelease => {
-- (13 )
beginError[h, 13 ];
GOTO Finished;
};
FetchP70V1.InternalError => {
-- (3 )
beginError[h, 3 ];
GOTO Finished;
};
FetchP70V1.Warning => {
-- (11 )
beginError[h, 11 ];
GOTO Finished;
};
FetchP70V1.CourierError => {
-- (6 )
beginError[h, 6 ];
GOTO Finished;
};
FetchP70V1.FileNotFound => {
-- (0 )
beginError[h, 0 ];
GOTO Finished;
};
FetchP70V1.VersionMismatch => {
-- (8 )
beginError[h, 8 ];
GOTO Finished;
};
FetchP70V1.ServerGoingAway => {
-- (4 )
beginError[h, 4 ];
GOTO Finished;
};
FetchP70V1.BadHandle => {
-- (7 )
beginError[h, 7 ];
GOTO Finished;
};
FetchP70V1.BadResults => {
-- (1 )
beginError[h, 1 ];
GOTO Finished;
};
};
IF (pgmVersion # 1)
THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCard16[s, 1]; --low
CrRPC.PutCard16[s, 1]; --high
RETURN
};
SELECT proc
FROM
1 => FindCaller[h, s, beginReturn];
0 => PredicateCaller[h, s, beginReturn];
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};
EXITS
Finished => { NULL };
};
CrRPC.RegisterServerProc[pgm~70, serverProc~Server, pgmVersion~1];
CrRPC.EnsureListener[class~$SPP];
}...