/[pcre]/code/trunk/internal.h
ViewVC logotype

Diff of /code/trunk/internal.h

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

revision 39 by nigel, Sat Feb 24 21:39:13 2007 UTC revision 47 by nigel, Sat Feb 24 21:39:29 2007 UTC
# Line 9  the file Tech.Notes for some information Line 9  the file Tech.Notes for some information
9    
10  Written by: Philip Hazel <ph10@cam.ac.uk>  Written by: Philip Hazel <ph10@cam.ac.uk>
11    
12             Copyright (c) 1997-1999 University of Cambridge             Copyright (c) 1997-2000 University of Cambridge
13    
14  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
15  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 35  restrictions: Line 35  restrictions:
35  /* This header contains definitions that are shared between the different  /* This header contains definitions that are shared between the different
36  modules, but which are not relevant to the outside. */  modules, but which are not relevant to the outside. */
37    
38    /* Get the definitions provided by running "configure" */
39    
40    #include "config.h"
41    
42  /* To cope with SunOS4 and other systems that lack memmove() but have bcopy(),  /* To cope with SunOS4 and other systems that lack memmove() but have bcopy(),
43  define a macro for memmove() if USE_BCOPY is defined. */  define a macro for memmove() if HAVE_MEMMOVE is false, provided that HAVE_BCOPY
44    is set. Otherwise, include an emulating function for those systems that have
45    neither (there some non-Unix environments where this is the case). This assumes
46    that all calls to memmove are moving strings upwards in store, which is the
47    case in PCRE. */
48    
49  #ifdef USE_BCOPY  #if ! HAVE_MEMMOVE
50  #undef  memmove        /* some systems may have a macro */  #undef  memmove        /* some systems may have a macro */
51    #if HAVE_BCOPY
52  #define memmove(a, b, c) bcopy(b, a, c)  #define memmove(a, b, c) bcopy(b, a, c)
53    #else
54    void *
55    pcre_memmove(unsigned char *dest, const unsigned char *src, size_t n)
56    {
57    int i;
58    dest += n;
59    src += n;
60    for (i = 0; i < n; ++i) *(--dest) =  *(--src);
61    }
62    #define memmove(a, b, c) pcre_memmove(a, b, c)
63    #endif
64  #endif  #endif
65    
66  /* Standard C headers plus the external interface definition */  /* Standard C headers plus the external interface definition */
# Line 184  enum { Line 204  enum {
204    
205    OP_CLASS,          /* Match a character class */    OP_CLASS,          /* Match a character class */
206    OP_REF,            /* Match a back reference */    OP_REF,            /* Match a back reference */
207      OP_RECURSE,        /* Match this pattern recursively */
208    
209    OP_ALT,            /* Start of alternation */    OP_ALT,            /* Start of alternation */
210    OP_KET,            /* End of group that doesn't have an unbounded repeat */    OP_KET,            /* End of group that doesn't have an unbounded repeat */
# Line 250  just to accommodate the POSIX wrapper. * Line 271  just to accommodate the POSIX wrapper. *
271  #define ERR26 "malformed number after (?("  #define ERR26 "malformed number after (?("
272  #define ERR27 "conditional group contains more than two branches"  #define ERR27 "conditional group contains more than two branches"
273  #define ERR28 "assertion expected after (?("  #define ERR28 "assertion expected after (?("
274    #define ERR29 "(?p must be followed by )"
275    #define ERR30 "unknown POSIX class name"
276    #define ERR31 "POSIX collating elements are not supported"
277    
278  /* All character handling must be done as unsigned characters. Otherwise there  /* All character handling must be done as unsigned characters. Otherwise there
279  are problems with top-bit-set characters and functions such as isspace().  are problems with top-bit-set characters and functions such as isspace().
# Line 265  runs on as long as necessary after the e Line 289  runs on as long as necessary after the e
289    
290  typedef struct real_pcre {  typedef struct real_pcre {
291    unsigned long int magic_number;    unsigned long int magic_number;
292      size_t size;
293    const unsigned char *tables;    const unsigned char *tables;
294    unsigned long int options;    unsigned long int options;
295    uschar top_bracket;    uschar top_bracket;
# Line 307  typedef struct match_data { Line 332  typedef struct match_data {
332    BOOL   noteol;                /* NOTEOL flag */    BOOL   noteol;                /* NOTEOL flag */
333    BOOL   endonly;               /* Dollar not before final \n */    BOOL   endonly;               /* Dollar not before final \n */
334    BOOL   notempty;              /* Empty string match not wanted */    BOOL   notempty;              /* Empty string match not wanted */
335      const uschar *start_pattern;  /* For use when recursing */
336    const uschar *start_subject;  /* Start of the subject string */    const uschar *start_subject;  /* Start of the subject string */
337    const uschar *end_subject;    /* End of the subject string */    const uschar *end_subject;    /* End of the subject string */
338    const uschar *start_match;    /* Start of this match attempt */    const uschar *start_match;    /* Start of this match attempt */
339    const uschar *end_match_ptr;  /* Subject position at end match */    const uschar *end_match_ptr;  /* Subject position at end match */
340    int     end_offset_top;       /* Highwater mark at end of match */    int    end_offset_top;        /* Highwater mark at end of match */
341  } match_data;  } match_data;
342    
343  /* Bit definitions for entries in the pcre_ctypes table. */  /* Bit definitions for entries in the pcre_ctypes table. */
# Line 324  typedef struct match_data { Line 350  typedef struct match_data {
350  #define ctype_meta    0x80   /* regexp meta char or zero (end pattern) */  #define ctype_meta    0x80   /* regexp meta char or zero (end pattern) */
351    
352  /* Offsets for the bitmap tables in pcre_cbits. Each table contains a set  /* Offsets for the bitmap tables in pcre_cbits. Each table contains a set
353  of bits for a class map. */  of bits for a class map. Some classes are built by combining these tables. */
354    
355  #define cbit_digit    0      /* for \d */  #define cbit_space     0      /* [:space:] or \s */
356  #define cbit_word    32      /* for \w */  #define cbit_xdigit   32      /* [:xdigit:] */
357  #define cbit_space   64      /* for \s */  #define cbit_digit    64      /* [:digit:] or \d */
358  #define cbit_length  96      /* Length of the cbits table */  #define cbit_upper    96      /* [:upper:] */
359    #define cbit_lower   128      /* [:lower:] */
360    #define cbit_word    160      /* [:word:] or \w */
361    #define cbit_graph   192      /* [:graph:] */
362    #define cbit_print   224      /* [:print:] */
363    #define cbit_punct   256      /* [:punct:] */
364    #define cbit_cntrl   288      /* [:cntrl:] */
365    #define cbit_length  320      /* Length of the cbits table */
366    
367  /* Offsets of the various tables from the base tables pointer, and  /* Offsets of the various tables from the base tables pointer, and
368  total length. */  total length. */

Legend:
Removed from v.39  
changed lines
  Added in v.47

  ViewVC Help
Powered by ViewVC 1.1.5