/[pcre]/code/tags/pcre-4.5/internal.h
ViewVC logotype

Diff of /code/tags/pcre-4.5/internal.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 23 by nigel, Sat Feb 24 21:38:41 2007 UTC revision 37 by nigel, Sat Feb 24 21:39:09 2007 UTC
# Line 3  Line 3 
3  *************************************************/  *************************************************/
4    
5    
6  #define PCRE_VERSION       "2.00 24-Sep-1998"  #define PCRE_VERSION       "2.07 29-Jul-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
# Line 12  the file Tech.Notes for some information Line 12  the file Tech.Notes for some information
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
# Line 28  restrictions: Line 28  restrictions:
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    
# Line 63  Standard C system should have one. */ Line 67  Standard C system should have one. */
67    
68  #define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)  #define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)
69    
70  /* Private options flags start at the most significant end of the two bytes.  /* Private options flags start at the most significant end of the four bytes,
71  The public options defined in pcre.h start at the least significant end. Make  but skip the top bit so we can use ints for convenience without getting tangled
72  sure they don't overlap! */  with negative values. The public options defined in pcre.h start at the least
73    significant end. Make sure they don't overlap, though now that we have expanded
74  #define PCRE_FIRSTSET           0x8000  /* first_char is set */  to four bytes there is plenty of space. */
75  #define PCRE_STARTLINE          0x4000  /* start after \n for multiline */  
76  #define PCRE_INGROUP            0x2000  /* compiling inside a group */  #define PCRE_FIRSTSET      0x40000000  /* first_char is set */
77    #define PCRE_REQCHSET      0x20000000  /* req_char is set */
78    #define PCRE_STARTLINE     0x10000000  /* start after \n for multiline */
79    #define PCRE_INGROUP       0x08000000  /* compiling inside a group */
80    #define PCRE_ICHANGED      0x04000000  /* i option changes within regex */
81    
82  /* Options for the "extra" block produced by pcre_study(). */  /* Options for the "extra" block produced by pcre_study(). */
83    
# Line 82  time, run time or study time, respective Line 90  time, run time or study time, respective
90    (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \    (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \
91     PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY)     PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY)
92    
93  #define PUBLIC_EXEC_OPTIONS (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL)  #define PUBLIC_EXEC_OPTIONS \
94      (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY)
95    
96  #define PUBLIC_STUDY_OPTIONS 0   /* None defined */  #define PUBLIC_STUDY_OPTIONS 0   /* None defined */
97    
98  /* Magic number to provide a small check against being handed junk. */  /* Magic number to provide a small check against being handed junk. */
99    
100  #define MAGIC_NUMBER  0x50435245   /* 'PCRE' */  #define MAGIC_NUMBER  0x50435245UL   /* 'PCRE' */
101    
102  /* Miscellaneous definitions */  /* Miscellaneous definitions */
103    
# Line 258  typedef unsigned char uschar; Line 267  typedef unsigned char uschar;
267  runs on as long as necessary after the end. */  runs on as long as necessary after the end. */
268    
269  typedef struct real_pcre {  typedef struct real_pcre {
270    unsigned int  magic_number;    unsigned long int magic_number;
271    unsigned short int options;    const unsigned char *tables;
272    unsigned char top_bracket;    unsigned long int options;
273    unsigned char top_backref;    uschar top_bracket;
274    unsigned char first_char;    uschar top_backref;
275    unsigned char code[1];    uschar first_char;
276      uschar req_char;
277      uschar code[1];
278  } real_pcre;  } real_pcre;
279    
280  /* The real format of the extra block returned by pcre_study(). */  /* The real format of the extra block returned by pcre_study(). */
281    
282  typedef struct real_pcre_extra {  typedef struct real_pcre_extra {
283    unsigned char options;    uschar options;
284    unsigned char start_bits[32];    uschar start_bits[32];
285  } real_pcre_extra;  } real_pcre_extra;
286    
 /* Global tables from chartables.c */  
287    
288  extern uschar pcre_lcc[];  /* Structure for passing "static" information around between the functions
289  extern uschar pcre_fcc[];  doing the compiling, so that they are thread-safe. */
290  extern uschar pcre_cbits[];  
291  extern uschar pcre_ctypes[];  typedef struct compile_data {
292      const uschar *lcc;            /* Points to lower casing table */
293      const uschar *fcc;            /* Points to case-flipping table */
294      const uschar *cbits;          /* Points to character type table */
295      const uschar *ctypes;         /* Points to table of type maps */
296    } compile_data;
297    
298    /* Structure for passing "static" information around between the functions
299    doing the matching, so that they are thread-safe. */
300    
301    typedef struct match_data {
302      int    errorcode;             /* As it says */
303      int   *offset_vector;         /* Offset vector */
304      int    offset_end;            /* One past the end */
305      int    offset_max;            /* The maximum usable for return data */
306      const uschar *lcc;            /* Points to lower casing table */
307      const uschar *ctypes;         /* Points to table of type maps */
308      BOOL   offset_overflow;       /* Set if too many extractions */
309      BOOL   notbol;                /* NOTBOL flag */
310      BOOL   noteol;                /* NOTEOL flag */
311      BOOL   endonly;               /* Dollar not before final \n */
312      BOOL   notempty;              /* Empty string match not wanted */
313      const uschar *start_subject;  /* Start of the subject string */
314      const uschar *end_subject;    /* End of the subject string */
315      const uschar *start_match;    /* Start of this match attempt */
316      const uschar *end_match_ptr;  /* Subject position at end match */
317      int     end_offset_top;       /* Highwater mark at end of match */
318    } match_data;
319    
320  /* Bit definitions for entries in pcre_ctypes[]. */  /* Bit definitions for entries in the pcre_ctypes table. */
321    
322  #define ctype_space   0x01  #define ctype_space   0x01
323  #define ctype_letter  0x02  #define ctype_letter  0x02
# Line 289  extern uschar pcre_ctypes[]; Line 326  extern uschar pcre_ctypes[];
326  #define ctype_word    0x10   /* alphameric or '_' */  #define ctype_word    0x10   /* alphameric or '_' */
327  #define ctype_meta    0x80   /* regexp meta char or zero (end pattern) */  #define ctype_meta    0x80   /* regexp meta char or zero (end pattern) */
328    
329  /* Offsets for the bitmap tables */  /* Offsets for the bitmap tables in pcre_cbits. Each table contains a set
330    of bits for a class map. */
331    
332  #define cbit_digit    0  #define cbit_digit    0      /* for \d */
333  #define cbit_letter  32  #define cbit_word    32      /* for \w */
334  #define cbit_word    64  #define cbit_space   64      /* for \s */
335  #define cbit_space   96  #define cbit_length  96      /* Length of the cbits table */
336  #define cbit_length 128      /* Length of the cbits table */  
337    /* Offsets of the various tables from the base tables pointer, and
338    total length. */
339    
340    #define lcc_offset      0
341    #define fcc_offset    256
342    #define cbits_offset  512
343    #define ctypes_offset (cbits_offset + cbit_length)
344    #define tables_length (ctypes_offset + 256)
345    
346  /* End of internal.h */  /* End of internal.h */

Legend:
Removed from v.23  
changed lines
  Added in v.37

  ViewVC Help
Powered by ViewVC 1.1.5