(*
  Title:	Dir
  $Header: Dir.def,v 1.3 85/01/04 10:23:39 mjj Exp $
  		Copyright (C) 1984 by Acorn Research Centre
*)

DEFINITION MODULE Dir;

IMPORT Strings;

EXPORT QUALIFIED
    NullDir, DirHandle, DirExists, OpenDir, 
    NextDirEntry, CloseDir, IsCurrentDirectoryName;

TYPE
    DirHandle;

PROCEDURE NullDir(d: DirHandle): BOOLEAN;
(* TRUE if 'd' represents the null handle
*)

PROCEDURE DirExists(name: ARRAY OF CHAR; VAR id: INTEGER): BOOLEAN;
(*  Returns TRUE if the directory 'name' exists and returns
a unique-id for it in 'id'.  This is intended to allow recognition
of aliases in systems which support such features.
*)

PROCEDURE OpenDir (name: ARRAY OF CHAR): DirHandle;
(* Open a directory for reading *)

PROCEDURE NextDirEntry (d: DirHandle; VAR name: ARRAY OF CHAR): BOOLEAN;
(* Read the next directory entry in d to name.
RETURN FALSE if no more entries. 
*)

PROCEDURE CloseDir (d: DirHandle);

PROCEDURE IsCurrentDirectoryName(name: Strings.String): BOOLEAN;
(* knows the representation of the target directory and
returns TRUE iff 'name' is it.
*)


END Dir.

(*
$Log:	Dir.def,v $
Revision 1.3  85/01/04  10:23:39  mjj
Change IsTargetDirectoryName -> IsCurrentDirectoryName

Revision 1.2  84/11/30  16:52:45  mjj
finger trouble when changing to RCS

Revision 1.1  84/11/30  15:59:01  mjj
Initial revision

*)

