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

Diff of /code/trunk/pcre_internal.h

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

revision 848 by ph10, Wed Jan 4 16:34:01 2012 UTC revision 1011 by ph10, Sat Aug 25 11:36:15 2012 UTC
# Line 254  typedef unsigned char pcre_uchar; Line 254  typedef unsigned char pcre_uchar;
254    
255  #ifdef COMPILE_PCRE16  #ifdef COMPILE_PCRE16
256  #if USHRT_MAX != 65535  #if USHRT_MAX != 65535
257  /* This is a warning message. Change PCRE_SCHAR16 to a 16 bit data type in  /* This is a warning message. Change PCRE_UCHAR16 to a 16 bit data type in
258  pcre.h(.in) and disable (comment out) this message. */  pcre.h(.in) and disable (comment out) this message. */
259  #error Warning: PCRE_SCHAR16 is not a 16 bit data type.  #error Warning: PCRE_UCHAR16 is not a 16 bit data type.
260  #endif  #endif
261    
262  typedef pcre_uint16 pcre_uchar;  typedef pcre_uint16 pcre_uchar;
# Line 523  capturing parenthesis numbers in back re Line 523  capturing parenthesis numbers in back re
523    
524  #define PUT2INC(a,n,d)  PUT2(a,n,d), a += IMM2_SIZE  #define PUT2INC(a,n,d)  PUT2(a,n,d), a += IMM2_SIZE
525    
526    /* The maximum length of a MARK name is currently one data unit; it may be
527    changed in future to be a fixed number of bytes or to depend on LINK_SIZE. */
528    
529    #define MAX_MARK ((1 << (sizeof(pcre_uchar)*8)) - 1)
530    
531  /* When UTF encoding is being used, a character is no longer just a single  /* When UTF encoding is being used, a character is no longer just a single
532  character. The macros for character handling generate simple sequences when  character. The macros for character handling generate simple sequences when
533  used in character-mode, and more complicated ones for UTF characters.  used in character-mode, and more complicated ones for UTF characters.
# Line 887  time, run time, or study time, respectiv Line 892  time, run time, or study time, respectiv
892     PCRE_NO_START_OPTIMIZE)     PCRE_NO_START_OPTIMIZE)
893    
894  #define PUBLIC_STUDY_OPTIONS \  #define PUBLIC_STUDY_OPTIONS \
895     PCRE_STUDY_JIT_COMPILE     (PCRE_STUDY_JIT_COMPILE|PCRE_STUDY_JIT_PARTIAL_SOFT_COMPILE| \
896        PCRE_STUDY_JIT_PARTIAL_HARD_COMPILE)
897    
898  /* Magic number to provide a small check against being handed junk. */  /* Magic number to provide a small check against being handed junk. */
899    
# Line 1939  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4, Line 1945  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4,
1945         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
1946         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
1947         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
1948         ERR70, ERR71, ERR72, ERR73, ERR74, ERRCOUNT };         ERR70, ERR71, ERR72, ERR73, ERR74, ERR75, ERR76, ERRCOUNT };
1949    
1950    /* JIT compiling modes. The function list is indexed by them. */
1951    enum { JIT_COMPILE, JIT_PARTIAL_SOFT_COMPILE, JIT_PARTIAL_HARD_COMPILE,
1952           JIT_NUMBER_OF_COMPILE_MODES };
1953    
1954  /* The real format of the start of the pcre block; the index of names and the  /* The real format of the start of the pcre block; the index of names and the
1955  code vector run on as long as necessary after the end. We store an explicit  code vector run on as long as necessary after the end. We store an explicit
# Line 1958  fields are present. Currently PCRE alway Line 1968  fields are present. Currently PCRE alway
1968  NOTE NOTE NOTE  NOTE NOTE NOTE
1969  */  */
1970    
1971  typedef struct real_pcre {  #ifdef COMPILE_PCRE8
1972    #define REAL_PCRE real_pcre
1973    #else
1974    #define REAL_PCRE real_pcre16
1975    #endif
1976    
1977    typedef struct REAL_PCRE {
1978    pcre_uint32 magic_number;    pcre_uint32 magic_number;
1979    pcre_uint32 size;               /* Total that was malloced */    pcre_uint32 size;               /* Total that was malloced */
1980    pcre_uint32 options;            /* Public options */    pcre_uint32 options;            /* Public options */
1981    pcre_uint16 flags;              /* Private flags */    pcre_uint16 flags;              /* Private flags */
1982    pcre_uint16 dummy1;             /* For future use */    pcre_uint16 max_lookbehind;     /* Longest lookbehind (characters) */
1983    pcre_uint16 top_bracket;    pcre_uint16 top_bracket;        /* Highest numbered group */
1984    pcre_uint16 top_backref;    pcre_uint16 top_backref;        /* Highest numbered back reference */
1985    pcre_uint16 first_char;         /* Starting character */    pcre_uint16 first_char;         /* Starting character */
1986    pcre_uint16 req_char;           /* This character must be seen */    pcre_uint16 req_char;           /* This character must be seen */
1987    pcre_uint16 name_table_offset;  /* Offset to name table that follows */    pcre_uint16 name_table_offset;  /* Offset to name table that follows */
1988    pcre_uint16 name_entry_size;    /* Size of any name items */    pcre_uint16 name_entry_size;    /* Size of any name items */
1989    pcre_uint16 name_count;         /* Number of name items */    pcre_uint16 name_count;         /* Number of name items */
1990    pcre_uint16 ref_count;          /* Reference count */    pcre_uint16 ref_count;          /* Reference count */
   
1991    const pcre_uint8 *tables;       /* Pointer to tables or NULL for std */    const pcre_uint8 *tables;       /* Pointer to tables or NULL for std */
1992    const pcre_uint8 *nullpad;      /* NULL padding */    const pcre_uint8 *nullpad;      /* NULL padding */
1993  } real_pcre;  } REAL_PCRE;
1994    
1995  /* The format of the block used to store data from pcre_study(). The same  /* The format of the block used to store data from pcre_study(). The same
1996  remark (see NOTE above) about extending this structure applies. */  remark (see NOTE above) about extending this structure applies. */
# Line 2018  typedef struct compile_data { Line 2033  typedef struct compile_data {
2033    int  workspace_size;              /* Size of workspace */    int  workspace_size;              /* Size of workspace */
2034    int  bracount;                    /* Count of capturing parens as we compile */    int  bracount;                    /* Count of capturing parens as we compile */
2035    int  final_bracount;              /* Saved value after first pass */    int  final_bracount;              /* Saved value after first pass */
2036      int  max_lookbehind;              /* Maximum lookbehind (characters) */
2037    int  top_backref;                 /* Maximum back reference */    int  top_backref;                 /* Maximum back reference */
2038    unsigned int backref_map;         /* Bitmap of low back refs */    unsigned int backref_map;         /* Bitmap of low back refs */
2039    int  assert_depth;                /* Depth of nested assertions */    int  assert_depth;                /* Depth of nested assertions */
# Line 2025  typedef struct compile_data { Line 2041  typedef struct compile_data {
2041    int  external_flags;              /* External flag bits to be set */    int  external_flags;              /* External flag bits to be set */
2042    int  req_varyopt;                 /* "After variable item" flag for reqbyte */    int  req_varyopt;                 /* "After variable item" flag for reqbyte */
2043    BOOL had_accept;                  /* (*ACCEPT) encountered */    BOOL had_accept;                  /* (*ACCEPT) encountered */
2044      BOOL had_pruneorskip;             /* (*PRUNE) or (*SKIP) encountered */
2045    BOOL check_lookbehind;            /* Lookbehinds need later checking */    BOOL check_lookbehind;            /* Lookbehinds need later checking */
2046    int  nltype;                      /* Newline type */    int  nltype;                      /* Newline type */
2047    int  nllen;                       /* Newline string length */    int  nllen;                       /* Newline string length */
# Line 2119  typedef struct match_data { Line 2136  typedef struct match_data {
2136    const  pcre_uchar *mark;        /* Mark pointer to pass back on success */    const  pcre_uchar *mark;        /* Mark pointer to pass back on success */
2137    const  pcre_uchar *nomatch_mark;/* Mark pointer to pass back on failure */    const  pcre_uchar *nomatch_mark;/* Mark pointer to pass back on failure */
2138    const  pcre_uchar *once_target; /* Where to back up to for atomic groups */    const  pcre_uchar *once_target; /* Where to back up to for atomic groups */
2139    #ifdef NO_RECURSE
2140      void  *match_frames_base;       /* For remembering malloc'd frames */
2141    #endif
2142  } match_data;  } match_data;
2143    
2144  /* A similar structure is used for the same purpose by the DFA matching  /* A similar structure is used for the same purpose by the DFA matching
# Line 2173  total length. */ Line 2193  total length. */
2193  #define ctypes_offset (cbits_offset + cbit_length)  #define ctypes_offset (cbits_offset + cbit_length)
2194  #define tables_length (ctypes_offset + 256)  #define tables_length (ctypes_offset + 256)
2195    
2196  /* Internal function prefix */  /* Internal function and data prefixes. */
2197    
2198  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
2199    #ifndef PUBL
2200  #define PUBL(name) pcre_##name  #define PUBL(name) pcre_##name
2201    #endif
2202    #ifndef PRIV
2203  #define PRIV(name) _pcre_##name  #define PRIV(name) _pcre_##name
2204  #else  #endif
2205    #else /* COMPILE_PCRE8 */
2206  #ifdef COMPILE_PCRE16  #ifdef COMPILE_PCRE16
2207    #ifndef PUBL
2208  #define PUBL(name) pcre16_##name  #define PUBL(name) pcre16_##name
2209    #endif
2210    #ifndef PRIV
2211  #define PRIV(name) _pcre16_##name  #define PRIV(name) _pcre16_##name
2212    #endif
2213  #else  #else
2214  #error Unsupported compiling mode  #error Unsupported compiling mode
2215  #endif /* COMPILE_PCRE16 */  #endif /* COMPILE_PCRE16 */
# Line 2274  extern BOOL              PRIV(was_newlin Line 2302  extern BOOL              PRIV(was_newlin
2302  extern BOOL              PRIV(xclass)(int, const pcre_uchar *, BOOL);  extern BOOL              PRIV(xclass)(int, const pcre_uchar *, BOOL);
2303    
2304  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
2305  extern void              PRIV(jit_compile)(const real_pcre *, pcre_extra *);  extern void              PRIV(jit_compile)(const REAL_PCRE *,
2306  extern int               PRIV(jit_exec)(const real_pcre *, void *,                             PUBL(extra) *, int);
2307                             const pcre_uchar *, int, int, int, int, int *, int);  extern int               PRIV(jit_exec)(const REAL_PCRE *, const PUBL(extra) *,
2308                               const pcre_uchar *, int, int, int, int *, int);
2309  extern void              PRIV(jit_free)(void *);  extern void              PRIV(jit_free)(void *);
2310  extern int               PRIV(jit_get_size)(void *);  extern int               PRIV(jit_get_size)(void *);
2311    extern const char*       PRIV(jit_get_target)(void);
2312  #endif  #endif
2313    
2314  /* Unicode character database (UCD) */  /* Unicode character database (UCD) */
2315    
2316  typedef struct {  typedef struct {
2317    pcre_uint8 script;    pcre_uint8 script;     /* ucp_Arabic, etc. */
2318    pcre_uint8 chartype;    pcre_uint8 chartype;   /* ucp_Cc, etc. (general categories) */
2319    pcre_int32 other_case;    pcre_uint8 gbprop;     /* ucp_gbControl, etc. (grapheme break property) */
2320      pcre_int32 other_case; /* offset to other case, or zero if none */
2321  } ucd_record;  } ucd_record;
2322    
2323  extern const ucd_record  PRIV(ucd_records)[];  extern const ucd_record  PRIV(ucd_records)[];
2324  extern const pcre_uint8  PRIV(ucd_stage1)[];  extern const pcre_uint8  PRIV(ucd_stage1)[];
2325  extern const pcre_uint16 PRIV(ucd_stage2)[];  extern const pcre_uint16 PRIV(ucd_stage2)[];
2326  extern const int         PRIV(ucp_gentype)[];  extern const int         PRIV(ucp_gentype)[];
2327    extern const pcre_uint8  PRIV(ucp_gbtable)[];
2328  #ifdef SUPPORT_JIT  #ifdef SUPPORT_JIT
2329  extern const int         PRIV(ucp_typerange)[];  extern const int         PRIV(ucp_typerange)[];
2330  #endif  #endif
# Line 2305  extern const int         PRIV(ucp_typera Line 2337  extern const int         PRIV(ucp_typera
2337          PRIV(ucd_stage2)[PRIV(ucd_stage1)[(ch) / UCD_BLOCK_SIZE] * \          PRIV(ucd_stage2)[PRIV(ucd_stage1)[(ch) / UCD_BLOCK_SIZE] * \
2338          UCD_BLOCK_SIZE + (ch) % UCD_BLOCK_SIZE])          UCD_BLOCK_SIZE + (ch) % UCD_BLOCK_SIZE])
2339    
2340  #define UCD_CHARTYPE(ch)  GET_UCD(ch)->chartype  #define UCD_CHARTYPE(ch)    GET_UCD(ch)->chartype
2341  #define UCD_SCRIPT(ch)    GET_UCD(ch)->script  #define UCD_SCRIPT(ch)      GET_UCD(ch)->script
2342  #define UCD_CATEGORY(ch)  PRIV(ucp_gentype)[UCD_CHARTYPE(ch)]  #define UCD_CATEGORY(ch)    PRIV(ucp_gentype)[UCD_CHARTYPE(ch)]
2343  #define UCD_OTHERCASE(ch) (ch + GET_UCD(ch)->other_case)  #define UCD_GRAPHBREAK(ch)  GET_UCD(ch)->gbprop
2344    #define UCD_OTHERCASE(ch)   (ch + GET_UCD(ch)->other_case)
2345    
2346  #endif /* SUPPORT_UCP */  #endif /* SUPPORT_UCP */
2347    

Legend:
Removed from v.848  
changed lines
  Added in v.1011

  ViewVC Help
Powered by ViewVC 1.1.5