xref: /openbsd-src/gnu/usr.bin/perl/util.h (revision 50b7afb2c2c0993b0894d4e34bf857cb13ed9c80)
1 /*    util.h
2  *
3  *    Copyright (C) 1991, 1992, 1993, 1999, 2001, 2002, 2003, 2004, 2005,
4  *    2007, 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 		 && (isWORDCHAR((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 */
29 #  else		/* !NETWARE */
30 #    if defined(DOSISH) || defined(__SYMBIAN32__)
31 #      define PERL_FILE_IS_ABSOLUTE(f) \
32 	(*(f) == '/'							\
33 	 || ((f)[0] && (f)[1] == ':'))		/* drive name */
34 #    else	/* NEITHER DOSISH NOR SYMBIANISH */
35 #      define PERL_FILE_IS_ABSOLUTE(f)	(*(f) == '/')
36 #    endif	/* DOSISH */
37 #   endif	/* NETWARE */
38 #  endif	/* WIN32 */
39 #endif		/* VMS */
40 
41 /*
42 =for apidoc ibcmp
43 
44 This is a synonym for (! foldEQ())
45 
46 =for apidoc ibcmp_locale
47 
48 This is a synonym for (! foldEQ_locale())
49 
50 =cut
51 */
52 #define ibcmp(s1, s2, len)         cBOOL(! foldEQ(s1, s2, len))
53 #define ibcmp_locale(s1, s2, len)  cBOOL(! foldEQ_locale(s1, s2, len))
54 
55 
56 /*
57  * Local variables:
58  * c-indentation-style: bsd
59  * c-basic-offset: 4
60  * indent-tabs-mode: nil
61  * End:
62  *
63  * ex: set ts=8 sts=4 sw=4 et:
64  */
65