3 |
*************************************************/ |
*************************************************/ |
4 |
|
|
5 |
|
|
6 |
#define PCRE_VERSION "2.00 24-Sep-1998" |
#define PCRE_VERSION "2.02 14-Jan-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 |
259 |
|
|
260 |
typedef struct real_pcre { |
typedef struct real_pcre { |
261 |
unsigned int magic_number; |
unsigned int magic_number; |
262 |
|
const unsigned char *tables; |
263 |
unsigned short int options; |
unsigned short int options; |
264 |
unsigned char top_bracket; |
unsigned char top_bracket; |
265 |
unsigned char top_backref; |
unsigned char top_backref; |
274 |
unsigned char start_bits[32]; |
unsigned char start_bits[32]; |
275 |
} real_pcre_extra; |
} real_pcre_extra; |
276 |
|
|
|
/* Global tables from chartables.c */ |
|
277 |
|
|
278 |
extern uschar pcre_lcc[]; |
/* Structure for passing "static" information around between the functions |
279 |
extern uschar pcre_fcc[]; |
doing the compiling, so that they are thread-safe. */ |
|
extern uschar pcre_cbits[]; |
|
|
extern uschar pcre_ctypes[]; |
|
280 |
|
|
281 |
/* Bit definitions for entries in pcre_ctypes[]. */ |
typedef struct compile_data { |
282 |
|
const uschar *lcc; /* Points to lower casing table */ |
283 |
|
const uschar *fcc; /* Points to case-flippint table */ |
284 |
|
const uschar *cbits; /* Points to character type table */ |
285 |
|
const uschar *ctypes; /* Points to table of type maps */ |
286 |
|
} compile_data; |
287 |
|
|
288 |
|
/* Structure for passing "static" information around between the functions |
289 |
|
doing the matching, so that they are thread-safe. */ |
290 |
|
|
291 |
|
typedef struct match_data { |
292 |
|
int errorcode; /* As it says */ |
293 |
|
int *offset_vector; /* Offset vector */ |
294 |
|
int offset_end; /* One past the end */ |
295 |
|
int offset_max; /* The maximum usable for return data */ |
296 |
|
const uschar *lcc; /* Points to lower casing table */ |
297 |
|
const uschar *ctypes; /* Points to table of type maps */ |
298 |
|
BOOL offset_overflow; /* Set if too many extractions */ |
299 |
|
BOOL notbol; /* NOTBOL flag */ |
300 |
|
BOOL noteol; /* NOTEOL flag */ |
301 |
|
BOOL endonly; /* Dollar not before final \n */ |
302 |
|
const uschar *start_subject; /* Start of the subject string */ |
303 |
|
const uschar *end_subject; /* End of the subject string */ |
304 |
|
const uschar *end_match_ptr; /* Subject position at end match */ |
305 |
|
int end_offset_top; /* Highwater mark at end of match */ |
306 |
|
} match_data; |
307 |
|
|
308 |
|
/* Bit definitions for entries in the pcre_ctypes table. */ |
309 |
|
|
310 |
#define ctype_space 0x01 |
#define ctype_space 0x01 |
311 |
#define ctype_letter 0x02 |
#define ctype_letter 0x02 |
314 |
#define ctype_word 0x10 /* alphameric or '_' */ |
#define ctype_word 0x10 /* alphameric or '_' */ |
315 |
#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ |
#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) */ |
316 |
|
|
317 |
/* Offsets for the bitmap tables */ |
/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set |
318 |
|
of bits for a class map. */ |
319 |
|
|
320 |
#define cbit_digit 0 |
#define cbit_digit 0 /* for \d */ |
321 |
#define cbit_letter 32 |
#define cbit_word 32 /* for \w */ |
322 |
#define cbit_word 64 |
#define cbit_space 64 /* for \s */ |
323 |
#define cbit_space 96 |
#define cbit_length 96 /* Length of the cbits table */ |
324 |
#define cbit_length 128 /* Length of the cbits table */ |
|
325 |
|
/* Offsets of the various tables from the base tables pointer, and |
326 |
|
total length. */ |
327 |
|
|
328 |
|
#define lcc_offset 0 |
329 |
|
#define fcc_offset 256 |
330 |
|
#define cbits_offset 512 |
331 |
|
#define ctypes_offset (cbits_offset + cbit_length) |
332 |
|
#define tables_length (ctypes_offset + 256) |
333 |
|
|
334 |
/* End of internal.h */ |
/* End of internal.h */ |