-- MakeImageOps.Mesa  Edited by Sandman on November 20, 1979  1:30 PM
-- Copyright  Xerox Corporation 1979, 1980

DIRECTORY
  AltoDefs: FROM "altodefs" USING [PageNumber],
  AltoFileDefs: FROM "altofiledefs" USING [vDA],
  ControlDefs: FROM "controldefs" USING [GFTIndex, GlobalFrameHandle],
  ImageDefs: FROM "imagedefs" USING [FileRequest],
  ImageFormat: FROM "imageformat" USING [ImageHeader],
  LoadStateFormat: FROM "loadstateformat" USING [ConfigIndex, ModuleTable],
  SegmentDefs: FROM "segmentdefs" USING [FileHandle, FileSegmentHandle];

MakeImageOps: DEFINITIONS =
  BEGIN OPEN LoadStateFormat, ControlDefs, SegmentDefs, ImageDefs;

  -- file requests


  InitFileRequest: PROCEDURE;
  AddFileRequest: PROCEDURE [r: POINTER TO FileRequest];
  DropFileRequest: PROCEDURE [f: FileHandle];
  ProcessFileRequests: PROCEDURE;

  -- space allocation


  InitSpace: PROCEDURE;
  GetSpace: PROCEDURE [n: CARDINAL] RETURNS [p: POINTER];
  GetString: PROCEDURE [oldstring: STRING] RETURNS [newstring: STRING];
  FreeAllSpace: PROCEDURE;

  -- image file management


  LockCodeSegment: PROCEDURE [GlobalFrameHandle];
  UnlockCodeSegment: PROCEDURE [GlobalFrameHandle];
  KDSegment: PROCEDURE RETURNS [FileSegmentHandle];
  DAofPage: PROCEDURE [file: FileHandle, page: AltoDefs.PageNumber]
    RETURNS [next: AltoFileDefs.vDA];
  FillInCAs: PROCEDURE [
    Image: POINTER TO ImageFormat.ImageHeader, mapindex: CARDINAL, ca: POINTER];
  SwapOutUnlockedCode: PROCEDURE [f: GlobalFrameHandle] RETURNS [BOOLEAN];
  SwapOutUnlocked: PROCEDURE [s: FileSegmentHandle] RETURNS [BOOLEAN];
  BashHint: PROCEDURE [s: FileSegmentHandle] RETURNS [BOOLEAN];
  BashFile: PROCEDURE [f: FileHandle] RETURNS [BOOLEAN];
  PatchUpGFT: PROCEDURE;
  InitModuleTable: PROCEDURE [
    mt: ModuleTable, merge: BOOLEAN, nbcds: ConfigIndex];
  NumberGFIInConfig: PROCEDURE [mt: ModuleTable, con: ConfigIndex]
    RETURNS [ngfi: GFTIndex];

  ProcessBcds: PROCEDURE [initstateseg: FileSegmentHandle, merge: BOOLEAN]
    RETURNS [maxbcdsize: CARDINAL];
  InitLoadStates: PROCEDURE [lsseg: FileSegmentHandle];

  END.