-- BWSUtil.mesa
-- DWR 	16-Jan-86 14:13:35
-- MEW   7-May-86 18:29:12

DIRECTORY
  MLoader,
  MFile,
  NSFile USING [Handle],
  NSString USING [String],
  Stream USING [Handle],
  String USING [SubStringDescriptor],
  XString USING [Reader];
  
BWSUtil: DEFINITIONS = {
  
  -- creates a stream on the file with the desired access.  File need not exist.
  -- the stream owns the file.
  
  Access: TYPE = MFile.Access;
  
  MakeStream: PROCEDURE [
    file: LONG STRING, access: Access ← readOnly,
    type: MFile.Type ← text]
    RETURNS [s: Stream.Handle ← NIL];
    
  MakeStreamReader: PROCEDURE [
    file: XString.Reader, access: Access ← readOnly,
    type: MFile.Type ← text]
    RETURNS [s: Stream.Handle ← NIL];
    
  MakeStreamNSString: PROCEDURE [
    file: NSString.String, access: Access ← readOnly,
    type: MFile.Type ← text]
    RETURNS [s: Stream.Handle ← NIL];
    
  SubStringFromXString: PROCEDURE [r: XString.Reader] RETURNS [String.SubStringDescriptor];
  
  NSFileStreamIsIt: PROCEDURE [s: Stream.Handle] RETURNS [BOOLEAN];
  
  AcquireFile:PROCEDURE[name:NSString.String] RETURNS[fh: NSFile.Handle];
  
  GetProgram: PROC [h: MLoader.Handle] RETURNS [PROGRAM];

   
}.