(* Copyright (C) 1990, Digital Equipment Corporation. *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* Last modified on Wed Jun 13 02:48:46 1990 by muller *) (* modified on Thu Apr 19 13:13:55 PDT 1990 by swart *) (* modified on Fri Jan 20 15:27:49 PST 1989 by glassman *) (* modified on Wed Apr 22 17:34:04 1987 by roberts *) (* modified on Tue Nov 25 11:48:02 1986 by brooks *) INTERFACE POSPath; IMPORT Text, Rd, POS; PROCEDURE Root(path: TEXT) : TEXT RAISES {}; (* Returns the root part of the path and is equivalent *) (* to the :r substitution in the C shell. *) PROCEDURE Extension(path: TEXT) : TEXT RAISES {}; (* Returns the extension part of the path and is *) (* equivalent to the :e substitution in the C shell. *) PROCEDURE Head(path: TEXT) : TEXT RAISES {}; (* Returns the head part of the path and is equivalent *) (* to the :h substitution in the C shell. *) PROCEDURE Tail(path: TEXT) : TEXT RAISES {}; (* Returns the tail part of the path and is equivalent *) (* to the :t substitution in the C shell. *) PROCEDURE DefaultExtension(path, ext: TEXT) : TEXT RAISES {}; (* Adds an extension to a path if none already *) (* exists. Alternatively, if the extension field begins *) (* with a *, any old extension in the first path is *) (* replaced with the given extension. *) PROCEDURE ExpandTilde(path: TEXT) : TEXT RAISES {POS.Error}; (* Expands the ~ character at the beginning of a file *) (* name to be the appropriate directory path. For ~/ *) (* this is taken from the HOME environment variable; *) (* ~user/ is converted by looking up the users home directory. *) TYPE FilePredicate = PROCEDURE(name: TEXT) : BOOLEAN RAISES {}; PROCEDURE SearchPath( searchPath, path: TEXT; pred: FilePredicate := NIL) : TEXT RAISES {POS.Error}; (* Most clients will not specify a filepred argument *) (* and will use this simply to find the first file *) (* that exists along a given search path. More *) (* generally, SearchPath returns a path to the *) (* first instance of path in the list of *) (* directories specified by the search path for which the *) (* filepred returns TRUE. If none exist, SearchPath *) (* returns NIL. *) END POSPath.