-- SMProj.mesa
-- last edit by Satterthwaite, August 4, 1983 1:37 pm

DIRECTORY
  CompilerOps: TYPE USING [Transaction],
  File: TYPE USING [Capability, nullCapability],
  FileSegment: TYPE USING [Span, nullSpan],
  Rope: TYPE USING [Text],
  TimeStamp: TYPE USING [Stamp];
	
SMProj: CEDAR DEFINITIONS~{
  
 -- projection objects are centrally managed
 -- do not change contents without acquiring the monitor lock of SMProjImpl

  Proj: TYPE~REF ProjInfo;
  ProjInfo: TYPE~RECORD[
   -- the key (encodes all inputs by hashing)
    stamp: TimeStamp.Stamp←,	-- version stamp, not create
   -- links for RedBlackTree package
    rbLLink, rbRLink: Proj←NIL,
    rbColor: BOOL←FALSE,
   -- version map (defer until CFS?)
    host: Rope.Text←NIL,		-- @[host]<directory>shortname!version
    directory: Rope.Text←NIL,		-- in the file system
    shortName: Rope.Text←NIL,
    version: LONG CARDINAL←0,
   -- hints
    state: {empty, analyzed, opened}←$empty,
    interface: BOOL←FALSE,
    symbolPages: FileSegment.Span←FileSegment.nullSpan,
    localName: Rope.Text←NIL,	-- for the local disk
    capability: File.Capability←File.nullCapability
    ];	
	
  Analyzed: PROC[proj: Proj] RETURNS[BOOL];
  
  Available: PROC[proj: Proj] RETURNS[BOOL];
  
  Erase: PROC[proj: Proj];	-- clears cache
  
  Fill: PROC[proj: Proj, localName: Rope.Text, new: BOOL];
  
  Find: PROC[stamp: TimeStamp.Stamp] RETURNS[Proj];
  
  Flush: PROC;

  Rename: PROC[proj: Proj, newName: Rope.Text];
  
  Reset: PROC;	-- erases local file system info
  
  Update: PROC[proj: Proj, parms: POINTER TO READONLY CompilerOps.Transaction];
  
  }.