XObject:
TYPE =
RECORD[
variant:
SELECT type: *
FROM
passive => [rendezvous: CONDITION, process: PROCESS, active: XAddress],
ENDCASE];
Block: TYPE = RECORD [
blockPointer: POINTER TO PACKED ARRAY [0..0) OF BYTE,
startIndex, stopIndexPlusOne: CARD32];
ClassOfService: TYPE = {a, b, c};
NetworkAddress:
TYPE =
MSBIT
WORD32
MACHINE
DEPENDENT
RECORD [
net(0:0..31): NetworkNumber,
host(0:32..79): HostNumber,
socket(0:80..95): SocketNumber];
NetworkNumber: TYPE [4];
HostNumber: TYPE [6];
SocketNumber: TYPE [2];
SHandle: TYPE = POINTER;
AddressType: TYPE =
MACHINE DEPENDENT {name(1), iso(2), tcp(3), spp(4), (LAST[CARD16])}; -- will be extended
TcpAddress: TYPE = WORD16 MACHINE DEPENDENT RECORD [
inetAddress: PACKED ARRAY [0 .. 4) OF CHARACTER,
socketnum: CARD16];
Address: TYPE = WORD16 MACHINE DEPENDENT RECORD [
addrLength(0): CARD16, -- Length of vaddr field in bytes
vaddr(1): SELECT addrType(1): AddressType FROM
name => [addrName(2) : POINTER TO CHARACTER],
spp => [addr(2): NetworkAddress],
tcp => [addr(2): TcpAddress],
iso => [dummy(2): CARD16] -- undefined
ENDCASE];
Handle: TYPE = POINTER TO READONLY Object;
Object: TYPE = RECORD [
remote: Address,
programNumber: CARD32,
versionNumber: CARD16,
zone: UNCOUNTED ZONE,
sH: SHandle,
classOfService: ClassOfService];
Create: PROCEDURE [
remote: Address,
programNumber: CARD32,
versionNumber: CARD16,
zone: UNCOUNTED ZONE,
classOfService: ClassOfService]
RETURNS [cH: Handle];
Delete: PROCEDURE [cH: Handle];
Call: PROCEDURE [
cH: Handle,
procedureNumber: CARD16,
arguments, results: Parameters := nullParameters,
requestDataStream: BOOLEAN := FALSE,
streamCheckoutProc: PROCEDURE [cH: Handle] := NIL]
RETURNS [sH: SHandle];
ReleaseDataStream: PROCEDURE [cH: Handle];
RemoteErrorSignalled: ERROR [errorNumber: CARD16, arguments: Arguments];
VersionMismatch: ERROR [versionRange: VersionRange];
VersionRange: TYPE = MACHINE DEPENDENT RECORD [low, high: CARD16];
unlimitedThreads: CARDINAL = 0; -- Constant for ExportRemoteProgram
ExportRemoteProgram: PROCEDURE [
programNumber: CARD32,
versionRange: VersionRange,
dispatcher: Dispatcher,
serviceName: STRING := NIL,
maxThreads: CARDINAL := unlimitedThreads,
zone: UNCOUNTED ZONE,
classOfService: ClassOfService];
UnexportRemoteProgram: PROCEDURE [
programNumber: CARD32, versionRange: VersionRange];
Dispatcher: TYPE = PROCEDURE [
cH: Handle,
procedureNumber: CARD16,
arguments: Arguments,
results: Results];
SignalRemoteError: ERROR [
errorNumber: CARD16, arguments: Parameters := nullParameters];
InvalidArguments: ERROR;
NoSuchProcedureNumber: ERROR;
Free: PROCEDURE [parameters: Parameters, zone: UNCOUNTED ZONE];
SerializeParameters: PROCEDURE [parameters: Parameters, sH: SHandle];
DeserializeParameters: PROCEDURE [
parameters: Parameters, sH: SHandle, zone: UNCOUNTED ZONE];
infiniteIdleTime : INT32 = -1; -- do not delete Transports
SetTransportIdleTime: PROCEDURE [ch: Handle, idleTime: INT32];
GetTransportIdleTime: PROCEDURE [ch: Handle] RETURNS [idleTime: INT32];
Error: ERROR [errorCode: ErrorCode];
ErrorCode: TYPE = {
transmissionMediumHardwareProblem, transmissionMediumUnavailable,
transmissionMediumNotReady, noAnswerOrBusy, noRouteToSystemElement,
transportTimeout, remoteSystemElementNotResponding, noCourierAtRemoteSite,
tooManyConnections, invalidMessage, noSuchProcedureNumber, returnTimedOut,
callerAborted, unknownErrorInRemoteProcedure, streamNotYours,
truncatedTransfer, parameterInconsistency, invalidArguments,
noSuchProgramNumber, protocolMismatch, duplicateProgramExport,
noSuchProgramExport, invalidHandle, internalError, noError};
Parameters: TYPE = RECORD [location: POINTER, description: Description];
nullParameters: Parameters = [NIL, NIL];
Arguments: TYPE = PROCEDURE [argumentsRecord: Parameters := nullParameters];
Results: TYPE = PROCEDURE [
resultsRecord: Parameters := nullParameters,
requestDataStream: BOOLEAN := FALSE] RETURNS [sH: SHandle];
Description: TYPE = PROCEDURE [notes: Notes];
Notes: TYPE = POINTER TO READONLY NotesObject;
NotesObject: TYPE = RECORD [
zone: UNCOUNTED ZONE, --for allocating/deallocating storage
operation: {fetch, store, free}, --being performed by description routine
noteLocation: POINTER, --defines current position in parameter area
noteUnspec16: NoteUnspec16,
noteCard16: NoteCard16,
noteInt16: NoteInt16,
noteEnum16: NoteEnum16,
noteCard32: NoteCard32,
noteInt32: NoteInt32,
noteBool: NoteBool,
noteParameters: NoteParameters,
noteChoice: NoteChoice, -- note tag for variant record
noteDeadSpace: NoteDeadSpace, --consumes portion of parameter area
noteString: NoteString, --notes Mesa STRING (NB: NIL and length = 0)
noteSpace: NoteSpace, --notes disjoint block of unspecified data
noteDynamicArray: NoteDynamicArray, --(NB: BASE = NIL or LENGTH = 0)
noteDisjointData: NoteDisjointData, --(NB: NIL)
noteBlock: NoteBlock
]; --building block for processing byte data
NoteUnspec16: TYPE = PROCEDURE [site: POINTER := NIL,
elementCnt: CARDINAL := 1];
NoteCard16: TYPE = PROCEDURE [site: POINTER TO CARD16 := NIL,
elementCnt: CARDINAL := 1];
NoteInt16: TYPE = PROCEDURE [site: POINTER TO INT16 := NIL,
elementCnt: CARDINAL := 1];
NoteEnum16: TYPE = PROCEDURE [site: POINTER := NIL,
elementCnt: CARDINAL := 1];
NoteBool: TYPE = PROCEDURE [site: POINTER TO BOOL];
NoteCard32: TYPE = PROCEDURE [site: POINTER TO CARD32 := NIL,
elementCnt: CARDINAL := 1];
NoteInt32: TYPE = PROCEDURE [site: POINTER TO INT32 := NIL,
elementCnt: CARDINAL := 1];
NoteParameters: TYPE = PROCEDURE [
site: POINTER := NIL, description: Description];
NoteChoice: TYPE = PROCEDURE [
site: POINTER := NIL] --to tag field
RETURNS[tagValue : CARD16]; -- Returns value of tag
NoteDeadSpace: TYPE = PROCEDURE [size: CARDINAL];
NoteString: TYPE = PROCEDURE [site: POINTER TO STRING := NIL];
NoteSpace: TYPE = PROCEDURE [site: POINTER, size: CARDINAL]; -- in SIZE units
NoteDynamicArray: TYPE = PROCEDURE [
site: POINTER := NIL, --to DESCRIPTOR FOR ARRAY
elementSize: CARDINAL, -- addressing units used by one element of array
upperBound: CARDINAL, --maximum number of elements permitted
dataProc: ArrayDataDescription]; -- Procedure to note the data
ArrayDataDescription: TYPE = PROCEDURE[arrDesc: POINTER TO
DESCRIPTOR FOR ARRAY OF UNSPECIFIED, notes: Notes];
NoteDisjointData: TYPE = PROCEDURE [
site: POINTER TO POINTER := NIL, description: Description, size: CARDINAL];
NoteBlock: TYPE = PROCEDURE [block: Block];
LocalSystemElement: PROCEDURE[addrType: AddressType := spp]
RETURNS [localSystemElement: Address];