Line data Source code
1 : /* RCS $Id: dirbrk.c,v 1.4 2007-10-15 15:52:59 ihi Exp $
2 : --
3 : -- SYNOPSIS
4 : -- Define the directory separator string.
5 : --
6 : -- DESCRIPTION
7 : -- Define this string for any character that may appear in a path name
8 : -- and can be used as a directory separator. Also provide a function
9 : -- to indicate if a given path begins at the root of the file system.
10 : --
11 : -- AUTHOR
12 : -- Dennis Vadura, dvadura@dmake.wticorp.com
13 : --
14 : -- WWW
15 : -- http://dmake.wticorp.com/
16 : --
17 : -- COPYRIGHT
18 : -- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
19 : --
20 : -- This program is NOT free software; you can redistribute it and/or
21 : -- modify it under the terms of the Software License Agreement Provided
22 : -- in the file <distribution-root>/readme/license.txt.
23 : --
24 : -- LOG
25 : -- Use cvs log to obtain detailed change logs.
26 : */
27 :
28 : #include "extern.h"
29 :
30 : #ifdef __EMX__
31 : /* os2 uses /, \, and : */
32 : /* FIXME: The OS/2 port most probably wants to use the HAVE_DRIVE_LETTERS
33 : * macro, see extern.h. */
34 : char* DirBrkStr = "/\\:";
35 : #else
36 : /* Unix only uses / */
37 : char* DirBrkStr = "/";
38 : #endif
39 :
40 : /*
41 : ** Return TRUE if the name is the full specification of a path name to a file
42 : ** starting at the root of the file system, otherwise return FALSE
43 : */
44 : PUBLIC int
45 41741 : If_root_path(name)
46 : char *name;
47 : {
48 41741 : return( strchr(DirBrkStr, *name) != NIL(char)
49 : #ifdef HAVE_DRIVE_LETTERS
50 : || (*name && name[1] == ':' && isalpha(*name))
51 : #endif
52 : );
53 : }
|