| 3 |
*************************************************/ |
*************************************************/ |
| 4 |
|
|
| 5 |
|
|
| 6 |
#define PCRE_VERSION "2.00 24-Sep-1998" |
#define PCRE_VERSION "2.05 21-Apr-1999" |
| 7 |
|
|
| 8 |
|
|
| 9 |
/* This is a library of functions to support regular expressions whose syntax |
/* This is a library of functions to support regular expressions whose syntax |
| 12 |
|
|
| 13 |
Written by: Philip Hazel <ph10@cam.ac.uk> |
Written by: Philip Hazel <ph10@cam.ac.uk> |
| 14 |
|
|
| 15 |
Copyright (c) 1998 University of Cambridge |
Copyright (c) 1997-1999 University of Cambridge |
| 16 |
|
|
| 17 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 18 |
Permission is granted to anyone to use this software for any purpose on any |
Permission is granted to anyone to use this software for any purpose on any |
| 28 |
|
|
| 29 |
3. Altered versions must be plainly marked as such, and must not be |
3. Altered versions must be plainly marked as such, and must not be |
| 30 |
misrepresented as being the original software. |
misrepresented as being the original software. |
| 31 |
|
|
| 32 |
|
4. If PCRE is embedded in any software that is released under the GNU |
| 33 |
|
General Purpose Licence (GPL), then the terms of that licence shall |
| 34 |
|
supersede any condition above with which it is incompatible. |
| 35 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 36 |
*/ |
*/ |
| 37 |
|
|
| 92 |
|
|
| 93 |
/* Magic number to provide a small check against being handed junk. */ |
/* Magic number to provide a small check against being handed junk. */ |
| 94 |
|
|
| 95 |
#define MAGIC_NUMBER 0x50435245 /* 'PCRE' */ |
#define MAGIC_NUMBER 0x50435245UL /* 'PCRE' */ |
| 96 |
|
|
| 97 |
/* Miscellaneous definitions */ |
/* Miscellaneous definitions */ |
| 98 |
|
|
| 262 |
runs on as long as necessary after the end. */ |
runs on as long as necessary after the end. */ |
| 263 |
|
|
| 264 |
typedef struct real_pcre { |
typedef struct real_pcre { |
| 265 |
unsigned int magic_number; |
unsigned long int magic_number; |
| 266 |
|
const unsigned char *tables; |
| 267 |
unsigned short int options; |
unsigned short int options; |
| 268 |
unsigned char top_bracket; |
unsigned char top_bracket; |
| 269 |
unsigned char top_backref; |
unsigned char top_backref; |
| 278 |
unsigned char start_bits[32]; |
unsigned char start_bits[32]; |
| 279 |
} real_pcre_extra; |
} real_pcre_extra; |
| 280 |
|
|
|
/* Global tables from chartables.c */ |
|
| 281 |
|
|
| 282 |
extern uschar pcre_lcc[]; |
/* Structure for passing "static" information around between the functions |
| 283 |
extern uschar pcre_fcc[]; |
doing the compiling, so that they are thread-safe. */ |
| 284 |
extern uschar pcre_cbits[]; |
|
| 285 |
extern uschar pcre_ctypes[]; |
typedef struct compile_data { |
| 286 |
|
const uschar *lcc; /* Points to lower casing table */ |
| 287 |
|
const uschar *fcc; /* Points to case-flippint table */ |
| 288 |
|
const uschar *cbits; /* Points to character type table */ |
| 289 |
|
const uschar *ctypes; /* Points to table of type maps */ |
| 290 |
|
} compile_data; |
| 291 |
|
|
| 292 |
|
/* Structure for passing "static" information around between the functions |
| 293 |
|
doing the matching, so that they are thread-safe. */ |
| 294 |
|
|
| 295 |
|
typedef struct match_data { |
| 296 |
|
int errorcode; /* As it says */ |
| 297 |
|
int *offset_vector; /* Offset vector */ |
| 298 |
|
int offset_end; /* One past the end */ |
| 299 |
|
int offset_max; /* The maximum usable for return data */ |
| 300 |
|
const uschar *lcc; /* Points to lower casing table */ |
| 301 |
|
const uschar *ctypes; /* Points to table of type maps */ |
| 302 |
|
BOOL offset_overflow; /* Set if too many extractions */ |
| 303 |
|
BOOL notbol; /* NOTBOL flag */ |
| 304 |
|
BOOL noteol; /* NOTEOL flag */ |
| 305 |
|
BOOL endonly; /* Dollar not before final \n */ |
| 306 |
|
const uschar *start_subject; /* Start of the subject string */ |
| 307 |
|
const uschar *end_subject; /* End of the subject string */ |
| 308 |
|
const uschar *end_match_ptr; /* Subject position at end match */ |
| 309 |
|
int end_offset_top; /* Highwater mark at end of match */ |
| 310 |
|
} match_data; |
| 311 |
|
|
| 312 |
/* Bit definitions for entries in pcre_ctypes[]. */ |
/* Bit definitions for entries in the pcre_ctypes table. */ |
| 313 |
|
|
| 314 |
#define ctype_space 0x01 |
#define ctype_space 0x01 |
| 315 |
#define ctype_letter 0x02 |
#define ctype_letter 0x02 |
| 318 |
#define ctype_word 0x10 /* alphameric or '_' */ |
#define ctype_word 0x10 /* alphameric or '_' */ |
| 319 |
#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ |
#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ |
| 320 |
|
|
| 321 |
/* Offsets for the bitmap tables */ |
/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set |
| 322 |
|
of bits for a class map. */ |
| 323 |
|
|
| 324 |
#define cbit_digit 0 |
#define cbit_digit 0 /* for \d */ |
| 325 |
#define cbit_letter 32 |
#define cbit_word 32 /* for \w */ |
| 326 |
#define cbit_word 64 |
#define cbit_space 64 /* for \s */ |
| 327 |
#define cbit_space 96 |
#define cbit_length 96 /* Length of the cbits table */ |
| 328 |
#define cbit_length 128 /* Length of the cbits table */ |
|
| 329 |
|
/* Offsets of the various tables from the base tables pointer, and |
| 330 |
|
total length. */ |
| 331 |
|
|
| 332 |
|
#define lcc_offset 0 |
| 333 |
|
#define fcc_offset 256 |
| 334 |
|
#define cbits_offset 512 |
| 335 |
|
#define ctypes_offset (cbits_offset + cbit_length) |
| 336 |
|
#define tables_length (ctypes_offset + 256) |
| 337 |
|
|
| 338 |
/* End of internal.h */ |
/* End of internal.h */ |