1 /* c-pathch.h: define the characters which separate components of
2 filenames and environment variable paths.
4 Copyright 1992, 1993, 1995, 1997, 2008 Karl Berry.
5 Copyright 1997, 1999, 2001, 2005 Olaf Weber.
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with this library; if not, see <http://www.gnu.org/licenses/>. */
23 #include <kpathsea/c-ctype.h>
25 /* What separates filename components? */
29 #define DIR_SEP_STRING ":"
32 /* Either \'s or 's work. Wayne Sullivan's web2pc prefers /, so we'll
35 #define DIR_SEP_STRING "/"
36 #define IS_DEVICE_SEP(ch) ((ch) == ':')
37 #define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1]))
38 /* On DOS, it's good to allow both \ and / between directories. */
39 #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\')
40 /* On win32, UNC names are authorized */
42 #define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name) \
43 && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
48 #define DIR_SEP_STRING "/"
49 #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == ':')
50 #define IS_DEVICE_SEP(ch) ((ch) == ':')
54 #define DIR_SEP_STRING " "
57 #define DIR_SEP_STRING "/"
58 #endif /* not VM/CMS */
59 #endif /* not AMIGA */
60 #endif /* not DOSISH */
62 #endif /* not DIR_SEP */
65 #define IS_DIR_SEP(ch) ((ch) == DIR_SEP)
67 #ifndef IS_DEVICE_SEP /* No `devices' on, e.g., Unix. */
68 #define IS_DEVICE_SEP(ch) 0
70 #ifndef NAME_BEGINS_WITH_DEVICE
71 #define NAME_BEGINS_WITH_DEVICE(name) 0
73 #ifndef IS_UNC_NAME /* Unc names are in practice found on Win32 only. */
74 #define IS_UNC_NAME(name) 0
77 /* What separates elements in environment variable path lists? */
81 #define ENV_SEP_STRING ","
85 #define ENV_SEP_STRING ";"
89 #define ENV_SEP_STRING ";"
93 #define ENV_SEP_STRING " "
96 #define ENV_SEP_STRING ":"
97 #endif /* not VM/CMS */
98 #endif /* not AMIGA */
101 #endif /* not ENV_SEP */
104 #define IS_ENV_SEP(ch) ((ch) == ENV_SEP)
107 #endif /* not C_PATHCH_H */