
<<SMModelBcd.mesa>>
<<Copyright © 1985 by Xerox Corporation.  All rights reserved.>>
<<last edit by Satterthwaite, May 12, 1986 11:58:29 am PDT>>

DIRECTORY
BasicTime: TYPE USING [GMT],
BcdDefs: TYPE USING [
BcdBase, IMPIndex, Link, ModuleIndex, MTIndex, NameRecord, VersionStamp],
IO: TYPE USING [STREAM],
LoaderOpsExtras: TYPE USING [AcquireFileProc],
LoadState: TYPE USING [ModuleIndex],
Rope: TYPE USING [ROPE],
SMTree: TYPE Tree USING [Link];

SMModelBcd: CEDAR DEFINITIONS ~ {
OPEN Tree~~SMTree;

Bcd: TYPE~REF BcdObject;
BcdObject: TYPE;

MTHandle: TYPE[1];


<<creation and deletion>>

BuildBcd: PROC[
name: Rope.ROPE,
stamp: BasicTime.GMT,
root: Tree.Link,
EnumerateComponents: PROC[
root: Tree.Link,
ProcessComponent: PROC[
BcdDefs.BcdBase, Rope.ROPE]
RETURNS[LoadState.ModuleIndex]],
oldBcd: Bcd]
RETURNS[Bcd];

ReplaceComponent: PROC[
config: Bcd, relGfi: LoadState.ModuleIndex, iBcd: BcdDefs.BcdBase, iFileName: Rope.ROPE];

WriteBcd: PROC[bcd: Bcd, stream: IO.STREAM, AcquireFile: LoaderOpsExtras.AcquireFileProc];

DeleteBcd: PROC[bcd: Bcd];

Overflow: ERROR;


<<operations>>

Base: PROC[bcd: Bcd] RETURNS[BcdDefs.BcdBase];

DeclareControl: PROC[bcd: Bcd,  module: LoadState.ModuleIndex];

DeclareImport: PROC[bcd: Bcd, formal, type: Rope.ROPE, stamp: BcdDefs.VersionStamp]
RETURNS[index: CARDINAL];
FillImport: PROC[bcd: Bcd, index: CARDINAL, iBcd: BcdDefs.BcdBase, iImpi: BcdDefs.IMPIndex]
RETURNS[BcdDefs.ModuleIndex];

DeclareExport: PROC[
bcd: Bcd, name: Rope.ROPE, stamp: BcdDefs.VersionStamp, size: NAT,
getLink: PROC[NAT] RETURNS[BcdDefs.Link]];

OpenLinks: PROC[bcd: Bcd, module: LoadState.ModuleIndex, relGfi: NAT, size: NAT]
RETURNS[MTHandle];

ReadLink: PROC[bcd: Bcd, mth: MTHandle, offset: NAT] RETURNS[BcdDefs.Link];
WriteLink: PROC[bcd: Bcd, mth: MTHandle, offset: NAT, link: BcdDefs.Link];

OpenLiterals: PROC[bcd: Bcd, iBcd: BcdDefs.BcdBase];
ImportLiterals: PROC[bcd: Bcd, mth: MTHandle, iBcd: BcdDefs.BcdBase, iMti: BcdDefs.MTIndex];
CloseLiterals: PROC[bcd: Bcd, iBcd: BcdDefs.BcdBase];


<<utilities>>

RopeFromNS: PROC[bcd: BcdDefs.BcdBase, name: BcdDefs.NameRecord] RETURNS[Rope.ROPE];

}.

