| 7 |
and semantics are as close as possible to those of the Perl 5 language. |
and semantics are as close as possible to those of the Perl 5 language. |
| 8 |
|
|
| 9 |
Written by Philip Hazel |
Written by Philip Hazel |
| 10 |
Copyright (c) 1997-2008 University of Cambridge |
Copyright (c) 1997-2009 University of Cambridge |
| 11 |
|
|
| 12 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 13 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 132 |
# endif |
# endif |
| 133 |
#endif |
#endif |
| 134 |
|
|
| 135 |
|
/* When compiling with the MSVC compiler, it is sometimes necessary to include |
| 136 |
|
a "calling convention" before exported function names. (This is secondhand |
| 137 |
|
information; I know nothing about MSVC myself). For example, something like |
| 138 |
|
|
| 139 |
|
void __cdecl function(....) |
| 140 |
|
|
| 141 |
|
might be needed. In order so make this easy, all the exported functions have |
| 142 |
|
PCRE_CALL_CONVENTION just before their names. It is rarely needed; if not |
| 143 |
|
set, we ensure here that it has no effect. */ |
| 144 |
|
|
| 145 |
|
#ifndef PCRE_CALL_CONVENTION |
| 146 |
|
#define PCRE_CALL_CONVENTION |
| 147 |
|
#endif |
| 148 |
|
|
| 149 |
/* We need to have types that specify unsigned 16-bit and 32-bit integers. We |
/* We need to have types that specify unsigned 16-bit and 32-bit integers. We |
| 150 |
cannot determine these outside the compilation (e.g. by running a program as |
cannot determine these outside the compilation (e.g. by running a program as |
| 151 |
part of "configure") because PCRE is often cross-compiled for use on other |
part of "configure") because PCRE is often cross-compiled for use on other |
| 381 |
support is omitted, we don't even define it. */ |
support is omitted, we don't even define it. */ |
| 382 |
|
|
| 383 |
#ifndef SUPPORT_UTF8 |
#ifndef SUPPORT_UTF8 |
|
#define NEXTCHAR(p) p++; |
|
| 384 |
#define GETCHAR(c, eptr) c = *eptr; |
#define GETCHAR(c, eptr) c = *eptr; |
| 385 |
#define GETCHARTEST(c, eptr) c = *eptr; |
#define GETCHARTEST(c, eptr) c = *eptr; |
| 386 |
#define GETCHARINC(c, eptr) c = *eptr++; |
#define GETCHARINC(c, eptr) c = *eptr++; |
| 390 |
|
|
| 391 |
#else /* SUPPORT_UTF8 */ |
#else /* SUPPORT_UTF8 */ |
| 392 |
|
|
|
/* Advance a character pointer one byte in non-UTF-8 mode and by one character |
|
|
in UTF-8 mode. */ |
|
|
|
|
|
#define NEXTCHAR(p) \ |
|
|
p++; \ |
|
|
if (utf8) { while((*p & 0xc0) == 0x80) p++; } |
|
|
|
|
| 393 |
/* Get the next UTF-8 character, not advancing the pointer. This is called when |
/* Get the next UTF-8 character, not advancing the pointer. This is called when |
| 394 |
we know we are in UTF-8 mode. */ |
we know we are in UTF-8 mode. */ |
| 395 |
|
|
| 559 |
#define REQ_CASELESS 0x0100 /* indicates caselessness */ |
#define REQ_CASELESS 0x0100 /* indicates caselessness */ |
| 560 |
#define REQ_VARY 0x0200 /* reqbyte followed non-literal item */ |
#define REQ_VARY 0x0200 /* reqbyte followed non-literal item */ |
| 561 |
|
|
| 562 |
/* Miscellaneous definitions */ |
/* Miscellaneous definitions. The #ifndef is to pacify compiler warnings in |
| 563 |
|
environments where these macros are defined elsewhere. Unfortunately, there |
| 564 |
|
is no way to do the same for the typedef. */ |
| 565 |
|
|
| 566 |
typedef int BOOL; |
typedef int BOOL; |
| 567 |
|
|
| 568 |
|
#ifndef FALSE |
| 569 |
#define FALSE 0 |
#define FALSE 0 |
| 570 |
#define TRUE 1 |
#define TRUE 1 |
| 571 |
|
#endif |
| 572 |
|
|
| 573 |
/* Escape items that are just an encoding of a particular data value. */ |
/* Escape items that are just an encoding of a particular data value. */ |
| 574 |
|
|