beta-0.89.2
[luatex.git] / source / texk / kpathsea / c-pathch.h
blob76352f82a6dfd665e7f7663a875bcc5f39dd6270
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/>. */
20 #ifndef C_PATHCH_H
21 #define C_PATHCH_H
23 #include <kpathsea/c-ctype.h>
25 /* What separates filename components? */
26 #ifndef DIR_SEP
27 # if defined(VMS)
28 # define DIR_SEP ':'
29 # define DIR_SEP_STRING ":"
30 # elif defined(DOSISH) /* not VMS */
31 /* Either \'s or 's work. Wayne Sullivan's web2pc prefers /, so we'll
32 go with that. */
33 # define DIR_SEP '/'
34 # define DIR_SEP_STRING "/"
35 # define IS_DEVICE_SEP(ch) ((ch) == ':')
36 # define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1]))
37 /* On DOS, it's good to allow both \ and / between directories. */
38 # define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\')
39 # ifdef WIN32
40 /* On win32, UNC names are authorized */
41 # define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name) \
42 && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
43 /* Used after converting '\\' into '/' */
44 # define IS_DIR_SEP_CH(ch) ((ch) == '/')
45 # endif
46 # elif defined(AMIGA) /* not DOSISH */
47 # define DIR_SEP '/'
48 # define DIR_SEP_STRING "/"
49 # define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == ':')
50 # define IS_DEVICE_SEP(ch) ((ch) == ':')
51 # elif defined(VMCMS) /* not AMIGA */
52 # define DIR_SEP ' '
53 # define DIR_SEP_STRING " "
54 # else /* not VMCMS */
55 # define DIR_SEP '/'
56 # define DIR_SEP_STRING "/"
57 # endif /* not VMCMS */
58 #endif /* not DIR_SEP */
60 #ifndef IS_DIR_SEP
61 #define IS_DIR_SEP(ch) ((ch) == DIR_SEP)
62 #endif
63 #ifndef IS_DIR_SEP_CH
64 #define IS_DIR_SEP_CH(ch) IS_DIR_SEP(ch)
65 #endif
66 #ifndef IS_DEVICE_SEP /* No `devices' on, e.g., Unix. */
67 #define IS_DEVICE_SEP(ch) 0
68 #endif
69 #ifndef NAME_BEGINS_WITH_DEVICE
70 #define NAME_BEGINS_WITH_DEVICE(name) 0
71 #endif
72 #ifndef IS_UNC_NAME /* Unc names are in practice found on Win32 only. */
73 #define IS_UNC_NAME(name) 0
74 #endif
76 /* What separates elements in environment variable path lists? */
77 #ifndef ENV_SEP
78 #ifdef VMS
79 # define ENV_SEP ','
80 # define ENV_SEP_STRING ","
81 #elif defined (DOSISH)
82 # define ENV_SEP ';'
83 # define ENV_SEP_STRING ";"
84 #elif defined (AMIGA)
85 # define ENV_SEP ';'
86 # define ENV_SEP_STRING ";"
87 #elif defined (VMCMS)
88 # define ENV_SEP ' '
89 # define ENV_SEP_STRING " "
90 #else
91 # define ENV_SEP ':'
92 # define ENV_SEP_STRING ":"
93 #endif
94 #endif /* not ENV_SEP */
96 #ifndef IS_ENV_SEP
97 #define IS_ENV_SEP(ch) ((ch) == ENV_SEP)
98 #endif
100 #endif /* not C_PATHCH_H */