dvitomp fix from Akira
[mplib] / src / texk / kpathsea / c-pathch.h
1 /* c-pathch.h: define the characters which separate components of
2    filenames and environment variable paths.
3
4    Copyright 1992, 1993, 1995, 1997, 2008 Karl Berry.
5    Copyright 1997, 1999, 2001, 2005 Olaf Weber.
6
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.
11
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.
16
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/>.  */
19
20 #ifndef C_PATHCH_H
21 #define C_PATHCH_H
22
23 #include <kpathsea/c-ctype.h>
24
25 /* What separates filename components?  */
26 #ifndef DIR_SEP
27 #ifdef VMS
28 #define DIR_SEP ':'
29 #define DIR_SEP_STRING ":"
30 #else
31 #ifdef DOSISH
32 /* Either \'s or 's work.  Wayne Sullivan's web2pc prefers /, so we'll
33    go with that.  */
34 #define DIR_SEP '/'
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 */
41 #ifdef WIN32
42 #define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name)  \
43                             && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
44 #endif
45 #else
46 #ifdef AMIGA
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 #else
52 #ifdef VMCMS
53 #define DIR_SEP ' '
54 #define DIR_SEP_STRING " "
55 #else
56 #define DIR_SEP '/'
57 #define DIR_SEP_STRING "/"
58 #endif /* not VM/CMS */
59 #endif /* not AMIGA */
60 #endif /* not DOSISH */
61 #endif /* not VMS */
62 #endif /* not DIR_SEP */
63
64 #ifndef IS_DIR_SEP
65 #define IS_DIR_SEP(ch) ((ch) == DIR_SEP)
66 #endif
67 #ifndef IS_DEVICE_SEP /* No `devices' on, e.g., Unix.  */
68 #define IS_DEVICE_SEP(ch) 0 
69 #endif
70 #ifndef NAME_BEGINS_WITH_DEVICE
71 #define NAME_BEGINS_WITH_DEVICE(name) 0 
72 #endif
73 #ifndef IS_UNC_NAME /* Unc names are in practice found on Win32 only. */
74 #define IS_UNC_NAME(name) 0
75 #endif
76
77 /* What separates elements in environment variable path lists?  */
78 #ifndef ENV_SEP
79 #ifdef VMS
80 #define ENV_SEP ','
81 #define ENV_SEP_STRING ","
82 #else
83 #ifdef DOSISH
84 #define ENV_SEP ';'
85 #define ENV_SEP_STRING ";"
86 #else
87 #ifdef AMIGA
88 #define ENV_SEP ';'
89 #define ENV_SEP_STRING ";"
90 #else
91 #ifdef VMCMS
92 #define ENV_SEP ' '
93 #define ENV_SEP_STRING " "
94 #else
95 #define ENV_SEP ':'
96 #define ENV_SEP_STRING ":"
97 #endif /* not VM/CMS */
98 #endif /* not AMIGA */
99 #endif /* not DOS */
100 #endif /* not VMS */
101 #endif /* not ENV_SEP */
102
103 #ifndef IS_ENV_SEP
104 #define IS_ENV_SEP(ch) ((ch) == ENV_SEP)
105 #endif
106
107 #endif /* not C_PATHCH_H */