-- VultureOps.mesa
-- Scavanger for Mail Archive files.
-- Maurice Herlihy August 7, 1982


DIRECTORY
 BodyDefs,
 Rope,
 Space,
 VultureDefs;

VultureOps: DEFINITIONS
IMPORTS Rope, Space, BodyDefs
 = {
  
-- Public types.
 Item: TYPE = LONG POINTER TO BodyDefs.ItemHeader;

-- Opaque types
 ItemStream: TYPE = REF ItemStreamRep;
 ItemStreamRep: TYPE;
 DirStream: TYPE = REF DirStreamRep;
 DirStreamRep: TYPE;

ROPE: TYPE = Rope.ROPE;
EndOfStream: ERROR;
BadFormat: ERROR;
OpenDirStream: PROC [space: Space.Handle] RETURNS [dirstream: DirStream] -- Signals EndOfStream --;
-- Creates a DirStream from given space. EndOfStream => file VERY broken.
NextDirectory: PROC [dirSteam: DirStream] RETURNS [directory: VultureDefs.Directory]
-- Signals EndOfStream --;
-- Return next directory in stream.
CloseDirStream: PROC [dirSteam: DirStream];
-- Mark any unseen directories as deleted.
OpenItemStream: PROC [space: Space.Handle] RETURNS [ItemStream]-- Signals EndOfStream --;
-- Creates an item stream from given space.
NextItem: PROC [stream: ItemStream] RETURNS [item: Item] -- Signals EndOfStream, BadFormat --;
-- Returns next item in stream.
FindPostmark: PROC [stream: ItemStream] RETURNS [INT] -- Signals EndOfStream --;
-- Moves stream ahead to next apparent postmark item.
NoMoreItems: PROC [stream: ItemStream] RETURNS [BOOL];
-- Any items left in the stream?
ParseItem: PUBLIC PROC [item: Item] RETURNS [ROPE];
-- Prints item type.
Reset: PUBLIC PROC [stream: ItemStream, address: INT] -- signals EndOfStream--;
-- Sets current stream address to address.
Current: PUBLIC PROC [stream: ItemStream] RETURNS [INT];
-- Current stream address
 }.