-- DSyms.mesa  last edit, Bruce  September 4, 1980  4:23 PM

DIRECTORY
  MachineDefs USING [GFHandle],
  Symbols USING [CTXIndex, HTIndex, MDIndex];

DSyms: DEFINITIONS =
  BEGIN

  GFHandle: TYPE = MachineDefs.GFHandle;
  HTIndex: TYPE = Symbols.HTIndex;
  MDIndex: TYPE = Symbols.MDIndex;

  AttachSymbols: PROC [frame, file: STRING];
  AttachBcd: PROC [gf: GFHandle, file: STRING];
  
  ModuleMdi: PROC [hti: HTIndex, fgt: BOOLEAN ← FALSE] RETURNS [MDIndex];
  GFrameMdi: PROC [gf: GFHandle, fgt: BOOLEAN ← FALSE] RETURNS [MDIndex];
  GFrameHti: PROC [gf: GFHandle, fgt: BOOLEAN ← FALSE] RETURNS [HTIndex];
  Stopping: PROC [gf: GFHandle, fgt: BOOLEAN ← FALSE] RETURNS [BOOLEAN];
  CrossJumped: PROC [gf: GFHandle, fgt: BOOLEAN ← FALSE] RETURNS [BOOLEAN];
  NoFGT: ERROR;

  -- Cache

  Item: TYPE = POINTER TO ItemObject;

  ItemObject: TYPE = RECORD [
    link: Item,
    gf: GFHandle,
    stopping: BOOLEAN,
    crossJumped: BOOLEAN,
    outerCtx: Symbols.CTXIndex,
    shared: BOOLEAN,
    directoryCtx, importCtx: Symbols.CTXIndex,
    sourceOk: BOOLEAN,
    fgtAvailable: BOOLEAN,
    symbol: SELECT tag: * FROM
      hash => [hti: HTIndex],
      mod => [mdi: Symbols.MDIndex],
      ENDCASE];

  FreeItems: PROC;
  Enumerate: PROC [proc: PROC [Item] RETURNS [BOOLEAN]] RETURNS [syms: Item];
  ModuleToHti: PROC [STRING] RETURNS [HTIndex];
  FindMod: PROC [HTIndex] RETURNS [Item];
  FindFrame: PROC [GFHandle] RETURNS [Item];

  Shared: SIGNAL;

  -- monitored

  SymbolLock: MONITORLOCK;

  Initialize: PROC;
  Prune: PROC;
  Clean: PROC;
  PurgeMdi: PROC [MDIndex];

  END.