Commit | Line | Data |
---|---|---|
a0d0e21e | 1 | /* util.h |
a687059c | 2 | * |
663f364b NC |
3 | * Copyright (C) 1991, 1992, 1993, 1999, 2001, 2002, 2003, 2004, 2005, |
4 | * 2007, by Larry Wall and others | |
a687059c | 5 | * |
d48672a2 LW |
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. | |
8d063cd8 | 8 | * |
8d063cd8 | 9 | */ |
57843af0 GS |
10 | |
11 | #ifdef VMS | |
12 | # define PERL_FILE_IS_ABSOLUTE(f) \ | |
13 | (*(f) == '/' \ | |
14 | || (strchr(f,':') \ | |
15 | || ((*(f) == '[' || *(f) == '<') \ | |
0eb30aeb | 16 | && (isWORDCHAR((f)[1]) || strchr("$-_]>",(f)[1]))))) |
57843af0 GS |
17 | |
18 | #else /* !VMS */ | |
546cd220 | 19 | # if defined(WIN32) || defined(__CYGWIN__) |
57843af0 | 20 | # define PERL_FILE_IS_ABSOLUTE(f) \ |
f2ed23b0 GS |
21 | (*(f) == '/' || *(f) == '\\' /* UNC/rooted path */ \ |
22 | || ((f)[0] && (f)[1] == ':')) /* drive name */ | |
57843af0 | 23 | # else /* !WIN32 */ |
2986a63f JH |
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 */ | |
739a0b84 | 30 | # if defined(DOSISH) || defined(__SYMBIAN32__) |
57843af0 GS |
31 | # define PERL_FILE_IS_ABSOLUTE(f) \ |
32 | (*(f) == '/' \ | |
33 | || ((f)[0] && (f)[1] == ':')) /* drive name */ | |
739a0b84 | 34 | # else /* NEITHER DOSISH NOR SYMBIANISH */ |
e37778c2 | 35 | # define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/') |
57843af0 | 36 | # endif /* DOSISH */ |
2986a63f | 37 | # endif /* NETWARE */ |
57843af0 GS |
38 | # endif /* WIN32 */ |
39 | #endif /* VMS */ | |
e9a8c099 MHM |
40 | |
41 | /* | |
e6226b18 KW |
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 | ||
cb4d37a7 NC |
55 | /* outside the core, perl.h undefs HAS_QUAD if IV isn't 64-bit |
56 | We can't swap this to HAS_QUAD, because the logic here affects the type of | |
57 | perl_drand48_t below, and that is visible outside of the core. */ | |
9ea40801 | 58 | #if defined(U64TYPE) && !defined(USING_MSVC6) |
63835f79 SH |
59 | /* use a faster implementation when quads are available, |
60 | * but not with VC6 on Windows */ | |
61 | # define PERL_DRAND48_QUAD | |
3be8f094 TC |
62 | #endif |
63 | ||
64 | #ifdef PERL_DRAND48_QUAD | |
65 | ||
66 | /* U64 is only defined under PERL_CORE, but this needs to be visible | |
67 | * elsewhere so the definition of PerlInterpreter is complete. | |
68 | */ | |
69 | typedef U64TYPE perl_drand48_t; | |
70 | ||
71 | #else | |
72 | ||
73 | struct PERL_DRAND48_T { | |
74 | U16 seed[3]; | |
75 | }; | |
76 | ||
77 | typedef struct PERL_DRAND48_T perl_drand48_t; | |
78 | ||
79 | #endif | |
80 | ||
81 | #define PL_RANDOM_STATE_TYPE perl_drand48_t | |
82 | ||
83 | #define Perl_drand48_init(seed) (Perl_drand48_init_r(&PL_random_state, (seed))) | |
84 | #define Perl_drand48() (Perl_drand48_r(&PL_random_state)) | |
e6226b18 KW |
85 | |
86 | /* | |
e9a8c099 MHM |
87 | * Local variables: |
88 | * c-indentation-style: bsd | |
89 | * c-basic-offset: 4 | |
14d04a33 | 90 | * indent-tabs-mode: nil |
e9a8c099 MHM |
91 | * End: |
92 | * | |
14d04a33 | 93 | * ex: set ts=8 sts=4 sw=4 et: |
e9a8c099 | 94 | */ |