-- file Copier.Mesa
-- last modified by Satterthwaite, October 7, 1979  2:33 PM

DIRECTORY
  SegmentDefs: FROM "segmentdefs" USING [FileHandle],
  BcdDefs: FROM "bcddefs" USING [VersionStamp],
  Symbols: FROM "symbols",
  SymbolTable: FROM "symboltable" USING [Base, Handle];

Copier: DEFINITIONS =
  BEGIN
  OPEN Symbols;

 -- implemented by FilePack

  FileInit: PROCEDURE [self: STRING, version: BcdDefs.VersionStamp];
  FileReset: PROCEDURE;

  CreateFileTable: PROCEDURE [CARDINAL];
  EnterFile: PROCEDURE [HTIndex, STRING] RETURNS [HTIndex];
  FindMdEntry: PROCEDURE [id: HTIndex, version: BcdDefs.VersionStamp, file: HTIndex]
    RETURNS [mdi: MDIndex];
  FreeSymbolTable: PROCEDURE [SymbolTable.Base];
  GetSymbolTable: PROCEDURE [MDIndex] RETURNS [SymbolTable.Base];
  HtiToMdi: PROCEDURE [HTIndex] RETURNS [MDIndex];
  LocateTables: PROCEDURE [CARDINAL];
  MakeFileTableEntry: PROCEDURE
    [SegmentDefs.FileHandle, SymbolTable.Handle] RETURNS [FileIndex];
  TableForModule: PROCEDURE [MDIndex] RETURNS [SymbolTable.Handle]; 

  FileProblem: SIGNAL [hti: HTIndex] RETURNS [BOOLEAN];
  FileVersion: SIGNAL [hti: HTIndex] RETURNS [BOOLEAN];
  FileVersionMix: SIGNAL [hti: HTIndex];
  OwnFile: SIGNAL [file: SegmentDefs.FileHandle];

 -- implemented by SymbolCopier

  CopierInit, CopierReset: PROCEDURE;

  CompleteContext: PROCEDURE [IncludedCTXIndex, BOOLEAN];
  Delink: PROCEDURE [ISEIndex];
  CloseIncludedTable: PROCEDURE;
  CopyIncludedSymbol: PROCEDURE [SEIndex, MDIndex] RETURNS [SEIndex];
  CopyArgSe: PROCEDURE [copy, master: ISEIndex];
  CopyUnion: PROCEDURE [CTXIndex];
  CopyXferType: PROCEDURE [CSEIndex] RETURNS [CSEIndex];
  FillModule: PROCEDURE [sei: ISEIndex];
  FindIncludedCtx: PROCEDURE [MDIndex, CTXIndex] RETURNS [IncludedCTXIndex];
  OpenIncludedTable: PROCEDURE [MDIndex] RETURNS [success: BOOLEAN];
  ResetIncludeContexts: PROCEDURE;
  SearchFileCtx: PROCEDURE [HTIndex, IncludedCTXIndex] RETURNS [BOOLEAN, ISEIndex];

  TableRelocated: SIGNAL;
  UnknownModule: SIGNAL [hti: HTIndex];

  END.