Commit | Line | Data |
a0d0e21e |
1 | /* util.h |
a687059c |
2 | * |
3f774658 |
3 | * Copyright (c) 1991-2002, Larry Wall |
a687059c |
4 | * |
d48672a2 |
5 | * You may distribute under the terms of either the GNU General Public |
6 | * License or the Artistic License, as specified in the README file. |
8d063cd8 |
7 | * |
8d063cd8 |
8 | */ |
57843af0 |
9 | |
10 | #ifdef VMS |
11 | # define PERL_FILE_IS_ABSOLUTE(f) \ |
12 | (*(f) == '/' \ |
13 | || (strchr(f,':') \ |
14 | || ((*(f) == '[' || *(f) == '<') \ |
15 | && (isALNUM((f)[1]) || strchr("$-_]>",(f)[1]))))) |
16 | |
17 | #else /* !VMS */ |
18 | # ifdef WIN32 |
19 | # define PERL_FILE_IS_ABSOLUTE(f) \ |
f2ed23b0 |
20 | (*(f) == '/' || *(f) == '\\' /* UNC/rooted path */ \ |
21 | || ((f)[0] && (f)[1] == ':')) /* drive name */ |
57843af0 |
22 | # else /* !WIN32 */ |
2986a63f |
23 | # ifdef NETWARE |
24 | # define PERL_FILE_IS_ABSOLUTE(f) \ |
25 | (((f)[0] && (f)[1] == ':') /* drive name */ \ |
26 | || ((f)[0] == '\\' && (f)[1] == '\\') /* UNC path */ \ |
27 | || ((f)[3] == ':')) /* volume name, currently only sys */ |
28 | # else /* !NETWARE */ |
ed79a026 |
29 | # if defined( DOSISH) || defined(EPOC) |
57843af0 |
30 | # define PERL_FILE_IS_ABSOLUTE(f) \ |
31 | (*(f) == '/' \ |
32 | || ((f)[0] && (f)[1] == ':')) /* drive name */ |
ed79a026 |
33 | # else /* NEITHER DOSISH NOR EPOCISH */ |
bf4acbe4 |
34 | # ifdef MACOS_TRADITIONAL |
084592ab |
35 | # define PERL_FILE_IS_ABSOLUTE(f) (strchr(f, ':') && *(f) != ':') |
bf4acbe4 |
36 | # else /* !MACOS_TRADITIONAL */ |
37 | # define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/') |
38 | # endif /* MACOS_TRADITIONAL */ |
57843af0 |
39 | # endif /* DOSISH */ |
2986a63f |
40 | # endif /* NETWARE */ |
57843af0 |
41 | # endif /* WIN32 */ |
42 | #endif /* VMS */ |