[3181] | 1 | /* util.h
|
---|
| 2 | *
|
---|
| 3 | * Copyright (C) 1991, 1992, 1993, 1999, 2001, 2002,
|
---|
| 4 | * by Larry Wall and others
|
---|
| 5 | *
|
---|
| 6 | * You may distribute under the terms of either the GNU General Public
|
---|
| 7 | * License or the Artistic License, as specified in the README file.
|
---|
| 8 | *
|
---|
| 9 | */
|
---|
| 10 |
|
---|
| 11 | #ifdef VMS
|
---|
| 12 | # define PERL_FILE_IS_ABSOLUTE(f) \
|
---|
| 13 | (*(f) == '/' \
|
---|
| 14 | || (strchr(f,':') \
|
---|
| 15 | || ((*(f) == '[' || *(f) == '<') \
|
---|
| 16 | && (isALNUM((f)[1]) || strchr("$-_]>",(f)[1])))))
|
---|
| 17 |
|
---|
| 18 | #else /* !VMS */
|
---|
| 19 | # if defined(WIN32) || defined(__CYGWIN__)
|
---|
| 20 | # define PERL_FILE_IS_ABSOLUTE(f) \
|
---|
| 21 | (*(f) == '/' || *(f) == '\\' /* UNC/rooted path */ \
|
---|
| 22 | || ((f)[0] && (f)[1] == ':')) /* drive name */
|
---|
| 23 | # else /* !WIN32 */
|
---|
| 24 | # ifdef NETWARE
|
---|
| 25 | # define PERL_FILE_IS_ABSOLUTE(f) \
|
---|
| 26 | (((f)[0] && (f)[1] == ':') /* drive name */ \
|
---|
| 27 | || ((f)[0] == '\\' && (f)[1] == '\\') /* UNC path */ \
|
---|
| 28 | || ((f)[3] == ':')) /* volume name, currently only sys */
|
---|
[3188] | 29 | # else /* !__NETWARE */
|
---|
| 30 | # if defined( __KLIBC__)
|
---|
[3181] | 31 | # define PERL_FILE_IS_ABSOLUTE(f) \
|
---|
[3188] | 32 | (*(f) == '/' || *(f) == '\\' \
|
---|
| 33 | || ((f)[1] == ':' && (f)[2] == '/') || ((f)[1] == ':' && (f)[2] == '\\')) /* drive name */
|
---|
| 34 | # else /* !__KLIBC__ */
|
---|
| 35 | # if defined( DOSISH) || defined(EPOC)
|
---|
| 36 | # define PERL_FILE_IS_ABSOLUTE(f) \
|
---|
[3181] | 37 | (*(f) == '/' \
|
---|
| 38 | || ((f)[0] && (f)[1] == ':')) /* drive name */
|
---|
| 39 | # else /* NEITHER DOSISH NOR EPOCISH */
|
---|
| 40 | # ifdef MACOS_TRADITIONAL
|
---|
| 41 | # define PERL_FILE_IS_ABSOLUTE(f) (strchr(f, ':') && *(f) != ':')
|
---|
| 42 | # else /* !MACOS_TRADITIONAL */
|
---|
| 43 | # define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/')
|
---|
| 44 | # endif /* MACOS_TRADITIONAL */
|
---|
| 45 | # endif /* DOSISH */
|
---|
| 46 | # endif /* NETWARE */
|
---|
[3188] | 47 | # endif /* __KLIBC__ */
|
---|
[3181] | 48 | # endif /* WIN32 */
|
---|
| 49 | #endif /* VMS */
|
---|