/[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 642 by ph10, Thu Jul 28 18:59:40 2011 UTC revision 835 by ph10, Wed Dec 28 16:10:09 2011 UTC
# Line 594  compatibility. */ Line 594  compatibility. */
594  #define PCRE_STARTLINE     0x0008  /* start after \n for multiline */  #define PCRE_STARTLINE     0x0008  /* start after \n for multiline */
595  #define PCRE_JCHANGED      0x0010  /* j option used in regex */  #define PCRE_JCHANGED      0x0010  /* j option used in regex */
596  #define PCRE_HASCRORLF     0x0020  /* explicit \r or \n in pattern */  #define PCRE_HASCRORLF     0x0020  /* explicit \r or \n in pattern */
597    #define PCRE_HASTHEN       0x0040  /* pattern contains (*THEN) */
598    
599  /* Flags for the "extra" block produced by pcre_study(). */  /* Flags for the "extra" block produced by pcre_study(). */
600    
# Line 624  time, run time, or study time, respectiv Line 625  time, run time, or study time, respectiv
625     PCRE_DFA_RESTART|PCRE_NEWLINE_BITS|PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE| \     PCRE_DFA_RESTART|PCRE_NEWLINE_BITS|PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE| \
626     PCRE_NO_START_OPTIMIZE)     PCRE_NO_START_OPTIMIZE)
627    
628  #define PUBLIC_STUDY_OPTIONS 0   /* None defined */  #define PUBLIC_STUDY_OPTIONS \
629       PCRE_STUDY_JIT_COMPILE
630    
631  /* Magic number to provide a small check against being handed junk. Also used  /* Magic number to provide a small check against being handed junk. Also used
632  to detect whether a pattern was compiled on a host of different endianness. */  to detect whether a pattern was compiled on a host of different endianness. */
# Line 1250  value such as \n. They must have non-zer Line 1252  value such as \n. They must have non-zer
1252  their negation. Also, they must appear in the same order as in the opcode  their negation. Also, they must appear in the same order as in the opcode
1253  definitions below, up to ESC_z. There's a dummy for OP_ALLANY because it  definitions below, up to ESC_z. There's a dummy for OP_ALLANY because it
1254  corresponds to "." in DOTALL mode rather than an escape sequence. It is also  corresponds to "." in DOTALL mode rather than an escape sequence. It is also
1255  used for [^] in JavaScript compatibility mode. In non-DOTALL mode, "." behaves  used for [^] in JavaScript compatibility mode, and for \C in non-utf8 mode. In
1256  like \N.  non-DOTALL mode, "." behaves like \N.
1257    
1258  The special values ESC_DU, ESC_du, etc. are used instead of ESC_D, ESC_d, etc.  The special values ESC_DU, ESC_du, etc. are used instead of ESC_D, ESC_d, etc.
1259  when PCRE_UCP is set, when replacement of \d etc by \p sequences is required.  when PCRE_UCP is set, when replacement of \d etc by \p sequences is required.
# Line 1454  enum { Line 1456  enum {
1456    OP_ASSERTBACK,     /* 121 Positive lookbehind */    OP_ASSERTBACK,     /* 121 Positive lookbehind */
1457    OP_ASSERTBACK_NOT, /* 122 Negative lookbehind */    OP_ASSERTBACK_NOT, /* 122 Negative lookbehind */
1458    
1459    /* ONCE, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately after the    /* ONCE, ONCE_NC, BRA, BRAPOS, CBRA, CBRAPOS, and COND must come immediately
1460    assertions, with ONCE first, as there's a test for >= ONCE for a subpattern    after the assertions, with ONCE first, as there's a test for >= ONCE for a
1461    that isn't an assertion. The POS versions must immediately follow the non-POS    subpattern that isn't an assertion. The POS versions must immediately follow
1462    versions in each case. */    the non-POS versions in each case. */
1463    
1464    OP_ONCE,           /* 123 Atomic group */    OP_ONCE,           /* 123 Atomic group, contains captures */
1465    OP_BRA,            /* 124 Start of non-capturing bracket */    OP_ONCE_NC,        /* 124 Atomic group containing no captures */
1466    OP_BRAPOS,         /* 125 Ditto, with unlimited, possessive repeat */    OP_BRA,            /* 125 Start of non-capturing bracket */
1467    OP_CBRA,           /* 126 Start of capturing bracket */    OP_BRAPOS,         /* 126 Ditto, with unlimited, possessive repeat */
1468    OP_CBRAPOS,        /* 127 Ditto, with unlimited, possessive repeat */    OP_CBRA,           /* 127 Start of capturing bracket */
1469    OP_COND,           /* 128 Conditional group */    OP_CBRAPOS,        /* 128 Ditto, with unlimited, possessive repeat */
1470      OP_COND,           /* 129 Conditional group */
1471    
1472    /* These five must follow the previous five, in the same order. There's a    /* These five must follow the previous five, in the same order. There's a
1473    check for >= SBRA to distinguish the two sets. */    check for >= SBRA to distinguish the two sets. */
1474    
1475    OP_SBRA,           /* 129 Start of non-capturing bracket, check empty  */    OP_SBRA,           /* 130 Start of non-capturing bracket, check empty  */
1476    OP_SBRAPOS,        /* 130 Ditto, with unlimited, possessive repeat */    OP_SBRAPOS,        /* 131 Ditto, with unlimited, possessive repeat */
1477    OP_SCBRA,          /* 131 Start of capturing bracket, check empty */    OP_SCBRA,          /* 132 Start of capturing bracket, check empty */
1478    OP_SCBRAPOS,       /* 132 Ditto, with unlimited, possessive repeat */    OP_SCBRAPOS,       /* 133 Ditto, with unlimited, possessive repeat */
1479    OP_SCOND,          /* 133 Conditional group, check empty */    OP_SCOND,          /* 134 Conditional group, check empty */
1480    
1481    /* The next two pairs must (respectively) be kept together. */    /* The next two pairs must (respectively) be kept together. */
1482    
1483    OP_CREF,           /* 134 Used to hold a capture number as condition */    OP_CREF,           /* 135 Used to hold a capture number as condition */
1484    OP_NCREF,          /* 135 Same, but generated by a name reference*/    OP_NCREF,          /* 136 Same, but generated by a name reference*/
1485    OP_RREF,           /* 136 Used to hold a recursion number as condition */    OP_RREF,           /* 137 Used to hold a recursion number as condition */
1486    OP_NRREF,          /* 137 Same, but generated by a name reference*/    OP_NRREF,          /* 138 Same, but generated by a name reference*/
1487    OP_DEF,            /* 138 The DEFINE condition */    OP_DEF,            /* 139 The DEFINE condition */
1488    
1489    OP_BRAZERO,        /* 139 These two must remain together and in this */    OP_BRAZERO,        /* 140 These two must remain together and in this */
1490    OP_BRAMINZERO,     /* 140 order. */    OP_BRAMINZERO,     /* 141 order. */
1491    OP_BRAPOSZERO,     /* 141 */    OP_BRAPOSZERO,     /* 142 */
1492    
1493    /* These are backtracking control verbs */    /* These are backtracking control verbs */
1494    
1495    OP_MARK,           /* 142 always has an argument */    OP_MARK,           /* 143 always has an argument */
1496    OP_PRUNE,          /* 143 */    OP_PRUNE,          /* 144 */
1497    OP_PRUNE_ARG,      /* 144 same, but with argument */    OP_PRUNE_ARG,      /* 145 same, but with argument */
1498    OP_SKIP,           /* 145 */    OP_SKIP,           /* 146 */
1499    OP_SKIP_ARG,       /* 146 same, but with argument */    OP_SKIP_ARG,       /* 147 same, but with argument */
1500    OP_THEN,           /* 147 */    OP_THEN,           /* 148 */
1501    OP_THEN_ARG,       /* 148 same, but with argument */    OP_THEN_ARG,       /* 149 same, but with argument */
1502    OP_COMMIT,         /* 149 */    OP_COMMIT,         /* 150 */
1503    
1504    /* These are forced failure and success verbs */    /* These are forced failure and success verbs */
1505    
1506    OP_FAIL,           /* 150 */    OP_FAIL,           /* 151 */
1507    OP_ACCEPT,         /* 151 */    OP_ACCEPT,         /* 152 */
1508    OP_ASSERT_ACCEPT,  /* 152 Used inside assertions */    OP_ASSERT_ACCEPT,  /* 153 Used inside assertions */
1509    OP_CLOSE,          /* 153 Used before OP_ACCEPT to close open captures */    OP_CLOSE,          /* 154 Used before OP_ACCEPT to close open captures */
1510    
1511    /* This is used to skip a subpattern with a {0} quantifier */    /* This is used to skip a subpattern with a {0} quantifier */
1512    
1513    OP_SKIPZERO,       /* 154 */    OP_SKIPZERO,       /* 155 */
1514    
1515    /* This is not an opcode, but is used to check that tables indexed by opcode    /* This is not an opcode, but is used to check that tables indexed by opcode
1516    are the correct length, in order to catch updating errors - there have been    are the correct length, in order to catch updating errors - there have been
# Line 1551  some cases doesn't actually use these na Line 1554  some cases doesn't actually use these na
1554    "Recurse", "Callout",                                           \    "Recurse", "Callout",                                           \
1555    "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos",                  \    "Alt", "Ket", "KetRmax", "KetRmin", "KetRpos",                  \
1556    "Reverse", "Assert", "Assert not", "AssertB", "AssertB not",    \    "Reverse", "Assert", "Assert not", "AssertB", "AssertB not",    \
1557    "Once",                                                         \    "Once", "Once_NC",                                              \
1558    "Bra", "BraPos", "CBra", "CBraPos",                             \    "Bra", "BraPos", "CBra", "CBraPos",                             \
1559    "Cond",                                                         \    "Cond",                                                         \
1560    "SBra", "SBraPos", "SCBra", "SCBraPos",                         \    "SBra", "SBraPos", "SCBra", "SCBraPos",                         \
# Line 1625  in UTF-8 mode. The code that uses this t Line 1628  in UTF-8 mode. The code that uses this t
1628    1+LINK_SIZE,                   /* Assert behind                          */ \    1+LINK_SIZE,                   /* Assert behind                          */ \
1629    1+LINK_SIZE,                   /* Assert behind not                      */ \    1+LINK_SIZE,                   /* Assert behind not                      */ \
1630    1+LINK_SIZE,                   /* ONCE                                   */ \    1+LINK_SIZE,                   /* ONCE                                   */ \
1631      1+LINK_SIZE,                   /* ONCE_NC                                */ \
1632    1+LINK_SIZE,                   /* BRA                                    */ \    1+LINK_SIZE,                   /* BRA                                    */ \
1633    1+LINK_SIZE,                   /* BRAPOS                                 */ \    1+LINK_SIZE,                   /* BRAPOS                                 */ \
1634    3+LINK_SIZE,                   /* CBRA                                   */ \    3+LINK_SIZE,                   /* CBRA                                   */ \
# Line 1641  in UTF-8 mode. The code that uses this t Line 1645  in UTF-8 mode. The code that uses this t
1645    1, 1, 1,                       /* BRAZERO, BRAMINZERO, BRAPOSZERO        */ \    1, 1, 1,                       /* BRAZERO, BRAMINZERO, BRAPOSZERO        */ \
1646    3, 1, 3,                       /* MARK, PRUNE, PRUNE_ARG                 */ \    3, 1, 3,                       /* MARK, PRUNE, PRUNE_ARG                 */ \
1647    1, 3,                          /* SKIP, SKIP_ARG                         */ \    1, 3,                          /* SKIP, SKIP_ARG                         */ \
1648    1+LINK_SIZE, 3+LINK_SIZE,      /* THEN, THEN_ARG                         */ \    1, 3,                          /* THEN, THEN_ARG                         */ \
1649    1, 1, 1, 1,                    /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT    */ \    1, 1, 1, 1,                    /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT    */ \
1650    3, 1                           /* CLOSE, SKIPZERO  */    3, 1                           /* CLOSE, SKIPZERO  */
1651    
# Line 1661  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4, Line 1665  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4,
1665         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
1666         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
1667         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,         ERR60, ERR61, ERR62, ERR63, ERR64, ERR65, ERR66, ERR67, ERR68, ERR69,
1668         ERRCOUNT };         ERR70, ERRCOUNT };
1669    
1670  /* 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
1671  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 1741  typedef struct compile_data { Line 1745  typedef struct compile_data {
1745    int  final_bracount;          /* Saved value after first pass */    int  final_bracount;          /* Saved value after first pass */
1746    int  top_backref;             /* Maximum back reference */    int  top_backref;             /* Maximum back reference */
1747    unsigned int backref_map;     /* Bitmap of low back refs */    unsigned int backref_map;     /* Bitmap of low back refs */
1748    int  assert_depth;            /* Depth of nested assertions */    int  assert_depth;            /* Depth of nested assertions */
1749    int  external_options;        /* External (initial) options */    int  external_options;        /* External (initial) options */
1750    int  external_flags;          /* External flag bits to be set */    int  external_flags;          /* External flag bits to be set */
1751    int  req_varyopt;             /* "After variable item" flag for reqbyte */    int  req_varyopt;             /* "After variable item" flag for reqbyte */
# Line 1768  typedef struct recursion_info { Line 1772  typedef struct recursion_info {
1772    int group_num;                  /* Number of group that was called */    int group_num;                  /* Number of group that was called */
1773    int *offset_save;               /* Pointer to start of saved offsets */    int *offset_save;               /* Pointer to start of saved offsets */
1774    int saved_max;                  /* Number of saved offsets */    int saved_max;                  /* Number of saved offsets */
1775    USPTR subject_position;         /* Position at start of recursion */    USPTR subject_position;         /* Position at start of recursion */
1776  } recursion_info;  } recursion_info;
1777    
1778  /* A similar structure for pcre_dfa_exec(). */  /* A similar structure for pcre_dfa_exec(). */
# Line 1781  typedef struct dfa_recursion_info { Line 1785  typedef struct dfa_recursion_info {
1785    
1786  /* Structure for building a chain of data for holding the values of the subject  /* Structure for building a chain of data for holding the values of the subject
1787  pointer at the start of each subpattern, so as to detect when an empty string  pointer at the start of each subpattern, so as to detect when an empty string
1788  has been matched by a subpattern - to break infinite loops; used by  has been matched by a subpattern - to break infinite loops; used by
1789  pcre_exec(). */  pcre_exec(). */
1790    
1791  typedef struct eptrblock {  typedef struct eptrblock {
# Line 1819  typedef struct match_data { Line 1823  typedef struct match_data {
1823    BOOL   notempty_atstart;      /* Empty string match at start not wanted */    BOOL   notempty_atstart;      /* Empty string match at start not wanted */
1824    BOOL   hitend;                /* Hit the end of the subject at some point */    BOOL   hitend;                /* Hit the end of the subject at some point */
1825    BOOL   bsr_anycrlf;           /* \R is just any CRLF, not full Unicode */    BOOL   bsr_anycrlf;           /* \R is just any CRLF, not full Unicode */
1826      BOOL   hasthen;               /* Pattern contains (*THEN) */
1827    const  uschar *start_code;    /* For use when recursing */    const  uschar *start_code;    /* For use when recursing */
1828    USPTR  start_subject;         /* Start of the subject string */    USPTR  start_subject;         /* Start of the subject string */
1829    USPTR  end_subject;           /* End of the subject string */    USPTR  end_subject;           /* End of the subject string */
# Line 1835  typedef struct match_data { Line 1840  typedef struct match_data {
1840    recursion_info *recursive;    /* Linked list of recursion data */    recursion_info *recursive;    /* Linked list of recursion data */
1841    void  *callout_data;          /* To pass back to callouts */    void  *callout_data;          /* To pass back to callouts */
1842    const  uschar *mark;          /* Mark pointer to pass back */    const  uschar *mark;          /* Mark pointer to pass back */
1843    const  uschar *once_target;   /* Where to back up to for atomic groups */    const  uschar *once_target;   /* Where to back up to for atomic groups */
1844  } match_data;  } match_data;
1845    
1846  /* 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 1854  typedef struct dfa_match_data { Line 1859  typedef struct dfa_match_data {
1859    int    nllen;                  /* Newline string length */    int    nllen;                  /* Newline string length */
1860    uschar nl[4];                  /* Newline string when fixed */    uschar nl[4];                  /* Newline string when fixed */
1861    void  *callout_data;           /* To pass back to callouts */    void  *callout_data;           /* To pass back to callouts */
1862    dfa_recursion_info *recursive; /* Linked list of recursion data */    dfa_recursion_info *recursive; /* Linked list of recursion data */
1863  } dfa_match_data;  } dfa_match_data;
1864    
1865  /* Bit definitions for entries in the pcre_ctypes table. */  /* Bit definitions for entries in the pcre_ctypes table. */
# Line 1912  extern const int    _pcre_utf8_table2[]; Line 1917  extern const int    _pcre_utf8_table2[];
1917  extern const int    _pcre_utf8_table3[];  extern const int    _pcre_utf8_table3[];
1918  extern const uschar _pcre_utf8_table4[];  extern const uschar _pcre_utf8_table4[];
1919    
1920    #ifdef SUPPORT_JIT
1921    extern const uschar _pcre_utf8_char_sizes[];
1922    #endif
1923    
1924  extern const int    _pcre_utf8_table1_size;  extern const int    _pcre_utf8_table1_size;
1925    
1926  extern const char   _pcre_utt_names[];  extern const char   _pcre_utt_names[];
# Line 1936  extern int           _pcre_valid_utf8(US Line 1945  extern int           _pcre_valid_utf8(US
1945  extern BOOL          _pcre_was_newline(USPTR, int, USPTR, int *, BOOL);  extern BOOL          _pcre_was_newline(USPTR, int, USPTR, int *, BOOL);
1946  extern BOOL          _pcre_xclass(int, const uschar *);  extern BOOL          _pcre_xclass(int, const uschar *);
1947    
1948    #ifdef SUPPORT_JIT
1949    extern void          _pcre_jit_compile(const real_pcre *, pcre_extra *);
1950    extern int           _pcre_jit_exec(const real_pcre *, void *, PCRE_SPTR,
1951                            int, int, int, int, int *, int);
1952    extern void          _pcre_jit_free(void *);
1953    #endif
1954    
1955  /* Unicode character database (UCD) */  /* Unicode character database (UCD) */
1956    
# Line 1949  extern const ucd_record  _pcre_ucd_recor Line 1964  extern const ucd_record  _pcre_ucd_recor
1964  extern const uschar      _pcre_ucd_stage1[];  extern const uschar      _pcre_ucd_stage1[];
1965  extern const pcre_uint16 _pcre_ucd_stage2[];  extern const pcre_uint16 _pcre_ucd_stage2[];
1966  extern const int         _pcre_ucp_gentype[];  extern const int         _pcre_ucp_gentype[];
1967    #ifdef SUPPORT_JIT
1968    extern const int         _pcre_ucp_typerange[];
1969    #endif
1970    
1971  /* UCD access macros */  /* UCD access macros */
1972    

Legend:
Removed from v.642  
changed lines
  Added in v.835

  ViewVC Help
Powered by ViewVC 1.1.5