-- ScriptHash.mesa  Edited by
-- Sweet,	10-Aug-82 10:40:58
-- Karlton,	16-Aug-82 15:07:31


ScriptHash: DEFINITIONS =
  BEGIN
  
  Object: TYPE;
  Handle: TYPE = LONG POINTER TO Object;
  valSize: CARDINAL = 1;
  Val: TYPE = ARRAY [0..valSize) OF CARDINAL;
  nullVal: Val = ALL[0];
  
  Hash: TYPE [1];
  nullHash: Hash = LOOPHOLE[0];
  
  Create: PROC [
    z: UNCOUNTED ZONE,
    buckets: [1..128], 
    expItems, aveItemSize: CARDINAL,
    caseHeed: BOOLEAN] 
    RETURNS [Handle];
  Destroy: PROC [h: Handle];
  
  AppendId: PROC [h: Handle, s: REF TEXT, hash: Hash];
  GetId: PROC [h: Handle, hash: Hash] RETURNS [REF TEXT];
           -- returned string to be deallocated by client
  Enter: PROC [h: Handle, s: REF TEXT, val: Val] RETURNS [Hash];
  Enumerate: PROC [h: Handle, action: PROC [hash: Hash] RETURNS [done: BOOLEAN]] 
    RETURNS [Hash];
  Lookup: PROC [h: Handle, s: REF TEXT] RETURNS [Hash];
  SetValue: PROC [h: Handle, hash: Hash, val: Val];
  Value: PROC [h: Handle, hash: Hash] RETURNS [Val];
  ValueForString: PROC [h: Handle, s: REF TEXT] RETURNS [Val];
  
  END.