-- KipperSupport.mesa December 6, 1985 9:35:33 am PST
-- Sturgis, January 6, 1986 1:07:11 pm PST
DIRECTORY
IO USING[STREAM],
HashTable USING[Table],
Rope USING[ROPE];
KipperSupport: CEDAR DEFINITIONS =
BEGIN
Kipper types
Kipperer: TYPE = REF KippererBody;
KippererBody: TYPE = RECORD[
stream: IO.STREAM,
refCounter: LONG CARDINAL,
refTable: HashTable.Table];
UnKipperer: TYPE = REF UnKippererBody;
UnKippererBody: TYPE = RECORD[
stream: IO.STREAM,
refCounter: LONG CARDINAL,
refTable: HashTable.Table];
RefTable: TYPE = REF RefTableBody;
RefTableBody: TYPE;
Creation procedures
CreateKipperer: PROC[s: IO.STREAM] RETURNS[Kipperer];
CreateUnKipperer: PROC[s: IO.STREAM] RETURNS[UnKipperer];
The second procedure may generate the following error
Error: ERROR[reason: Reason];
Reason: TYPE = {notAKipperStream, wrongKipperVersion};
notAKipperStream
means that the initial stream bytes do not contain an expected key
wrongKipperVersion
means the the next stream bytes do not contain an expected version number
Client callable procedures
KipperBoolean: PROC[kipperer: Kipperer, boolean: BOOLEAN];
UnKipperBoolean: PROC[unKipperer: UnKipperer] RETURNS[BOOLEAN];
KipperCardinal: PROC[kipperer: Kipperer, cardinal: CARDINAL];
UnKipperCardinal: PROC[unKipperer: UnKipperer] RETURNS[CARDINAL];
KipperCharacter: PROC[kipperer: Kipperer, character: CHARACTER];
UnKipperCharacter: PROC[unKipperer: UnKipperer] RETURNS[CHARACTER];
KipperInt: PROC[kipperer: Kipperer, int: INT];
UnKipperInt: PROC[unKipperer: UnKipperer] RETURNS[INT];
KipperInteger: PROC[kipperer: Kipperer, integer: INTEGER];
UnKipperInteger: PROC[unKipperer: UnKipperer] RETURNS[INTEGER];
KipperLongCardinal: PROC[kipperer: Kipperer, longCardinal: LONG CARDINAL];
UnKipperLongCardinal: PROC[unKipperer: UnKipperer] RETURNS[LONG CARDINAL];
KipperNat: PROC[kipperer: Kipperer, nat: NAT];
UnKipperNat: PROC[unKipperer: UnKipperer] RETURNS[NAT];
KipperReal: PROC[kipperer: Kipperer, real: REAL];
UnKipperReal: PROC[unKipperer: UnKipperer] RETURNS[REAL];
KipperRefText: PROC[kipperer: Kipperer, refText: REF TEXT];
UnKipperRefText: PROC[unKipperer: UnKipperer] RETURNS[REF TEXT];
KipperRope: PROC[kipperer: Kipperer, rope: Rope.ROPE];
UnKipperRope: PROC[unKipperer: UnKipperer] RETURNS[Rope.ROPE];
KipperWord: PROC[kipperer: Kipperer, word: WORD];
UnKipperWord: PROC[unKipperer: UnKipperer] RETURNS[WORD];
Private Procedures called by generated stubs
KipperRef: PROC[kipperer: Kipperer, r: REF ANY] RETURNS[kipperTheBody: BOOLEAN];
UnKipperRef: PROC[unKipperer: UnKipperer] RETURNS[kipperTheBody: BOOLEAN, ref: REF ANY];
RecordUnKipperedRef: PROC[unKipperer: UnKipperer, r: REF ANY];
END..