-- CodePackProcs.mesa
-- last edited by JGS on 17-Sep-82 13:51:36
-- last edited by Satterthwaite, December 29, 1982 3:54 pm

DIRECTORY
  BcdDefs: TYPE USING [MTIndex],
  HashTypes: TYPE USING [HTIndex],
  PackageSymbols: TYPE USING [OPIndex],
  SourceBcd: TYPE USING [CTreeIndex],
  String: TYPE USING [SubString],
  Table: TYPE USING [Base, Index, Limit];

CodePackProcs: DEFINITIONS={

  TreeIndex: TYPE~Table.Index;  -- Tree.Index (avoids circular definition)
 
 -- Describes the procedures from a module that are included in a code pack

  ModuleIndex: TYPE~Table.Base RELATIVE POINTER[0..Table.Limit) TO ModuleRecord;
  nullModuleIndex: ModuleIndex~ModuleIndex.LAST;

  ModuleRecord: TYPE;


 -- Determination of procedures in each code pack

  Determine: PROC [configTreeRoot: SourceBcd.CTreeIndex];
  Destroy: PROC;

 -- Inquiry  

  EnumerateSegments: PROC [userProc: PROC [segNode: TreeIndex] RETURNS [stop: BOOL]];

  SubStringForSegmentNode: PROC [ss: String.SubString, segNode: TreeIndex];

  EnumerateCodePacks: PROC [
    segNode: TreeIndex, 
    userProc: PROC [cpNode: TreeIndex] RETURNS [stop: BOOL]];

  SubStringForCodePackNode: PROC [ss: String.SubString, cpNode: TreeIndex];

  HtiForCodePackNode: PROC [cpNode: TreeIndex] RETURNS [hti: HashTypes.HTIndex];

  IsDiscardCodePack: PROC [cpNode: TreeIndex] RETURNS [yes: BOOL];

  EnumerateModules: PROC [  -- each module's symbol table is loaded
    cpNode: TreeIndex,      -- (via ModuleSymbols.Load) before userProc 
    userProc: PROC [        -- is called (and unloaded afterwards)
      mti: BcdDefs.MTIndex, module: ModuleIndex] RETURNS [stop: BOOL]];

  -- return TRUE if any procedures are specified by a ModuleRecord
  AnyProcs: PROC [module: ModuleIndex] RETURNS [reply: BOOL];

  EnumerateProcs: PROC [
    module: ModuleIndex, 
    userProc: PROC [opi: PackageSymbols.OPIndex] RETURNS [stop: BOOL]];

  SubStringForOPIndex: PROC [ss: String.SubString, opi: PackageSymbols.OPIndex];

  }.