home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / DMAKE38C.ZIP / TOS / DIRBRK.C < prev    next >
C/C++ Source or Header  |  1992-01-23  |  2KB  |  54 lines

  1. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/tos/dirbrk.c,v 1.1 1992/01/24 03:27:11 dvadura Exp $
  2. -- SYNOPSIS -- define the directory separator string.
  3. -- 
  4. -- DESCRIPTION
  5. --     Define this string for any character that may appear in a path name
  6. --    and can be used as a directory separator.  Also provide a function
  7. --    to indicate if a given path begins at the root of the file system.
  8. --
  9. -- AUTHOR
  10. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  11. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  12. --
  13. -- COPYRIGHT
  14. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  15. -- 
  16. --      This program is free software; you can redistribute it and/or
  17. --      modify it under the terms of the GNU General Public License
  18. --      (version 1), as published by the Free Software Foundation, and
  19. --      found in the file 'LICENSE' included with this distribution.
  20. -- 
  21. --      This program is distributed in the hope that it will be useful,
  22. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  23. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24. --      GNU General Public License for more details.
  25. -- 
  26. --      You should have received a copy of the GNU General Public License
  27. --      along with this program;  if not, write to the Free Software
  28. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29. --
  30. -- LOG
  31. --     $Log: dirbrk.c,v $
  32.  * Revision 1.1  1992/01/24  03:27:11  dvadura
  33.  * dmake Version 3.8, Initial revision
  34.  *
  35. */
  36.  
  37. #include "extern.h"
  38. #include <ctype.h>
  39.  
  40. /* tos uses /, \, and : */
  41. char*    DirBrkStr = "/\\:";
  42.  
  43. /*
  44. ** Return TRUE if the name is the full specification of a path name to a file
  45. ** starting at the root of the file system, otherwise return FALSE
  46. */
  47. int
  48. If_root_path(name)
  49. char *name;
  50. {
  51.    return( (strchr(DirBrkStr, *name) != NIL(char)) ||
  52.            (isalpha(*name) && name[1] == ':') );
  53. }
  54.