/[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 207 by ph10, Mon Aug 6 09:32:14 2007 UTC revision 230 by ph10, Mon Sep 10 13:23:56 2007 UTC
# Line 358  capturing parenthesis numbers in back re Line 358  capturing parenthesis numbers in back re
358    
359  /* When UTF-8 encoding is being used, a character is no longer just a single  /* When UTF-8 encoding is being used, a character is no longer just a single
360  byte. The macros for character handling generate simple sequences when used in  byte. The macros for character handling generate simple sequences when used in
361  byte-mode, and more complicated ones for UTF-8 characters. BACKCHAR should  byte-mode, and more complicated ones for UTF-8 characters. BACKCHAR should
362  never be called in byte mode. To make sure it can never even appear when UTF-8  never be called in byte mode. To make sure it can never even appear when UTF-8
363  support is omitted, we don't even define it. */  support is omitted, we don't even define it. */
364    
365  #ifndef SUPPORT_UTF8  #ifndef SUPPORT_UTF8
# Line 461  if there are extra bytes. This is called Line 461  if there are extra bytes. This is called
461      }      }
462    
463  /* If the pointer is not at the start of a character, move it back until  /* If the pointer is not at the start of a character, move it back until
464  it is. This is called only in UTF-8 mode - we don't put a test within the macro  it is. This is called only in UTF-8 mode - we don't put a test within the macro
465  because almost all calls are already within a block of UTF-8 only code. */  because almost all calls are already within a block of UTF-8 only code. */
466    
467  #define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--  #define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--
# Line 481  Standard C system should have one. */ Line 481  Standard C system should have one. */
481    
482  #define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)  #define PCRE_IMS (PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL)
483    
484  /* Private options flags start at the most significant end of the four bytes.  /* Private flags containing information about the compiled regex. They used to
485  The public options defined in pcre.h start at the least significant end. Make  live at the top end of the options word, but that got almost full, so now they
486  sure they don't overlap! The bits are getting a bit scarce now -- when we run  are in a 16-bit flags word. */
487  out, there is a dummy word in the structure that could be used for the private  
488  bits. */  #define PCRE_NOPARTIAL     0x0001  /* can't use partial with this regex */
489    #define PCRE_FIRSTSET      0x0002  /* first_byte is set */
490  #define PCRE_NOPARTIAL     0x80000000  /* can't use partial with this regex */  #define PCRE_REQCHSET      0x0004  /* req_byte is set */
491  #define PCRE_FIRSTSET      0x40000000  /* first_byte is set */  #define PCRE_STARTLINE     0x0008  /* start after \n for multiline */
492  #define PCRE_REQCHSET      0x20000000  /* req_byte is set */  #define PCRE_JCHANGED      0x0010  /* j option used in regex */
493  #define PCRE_STARTLINE     0x10000000  /* start after \n for multiline */  #define PCRE_HASCRORLF     0x0020  /* explicit \r or \n in pattern */
 #define PCRE_JCHANGED      0x08000000  /* j option changes within regex */  
494    
495  /* Options for the "extra" block produced by pcre_study(). */  /* Options for the "extra" block produced by pcre_study(). */
496    
# Line 608  enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, E Line 607  enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, E
607         ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z, ESC_E, ESC_Q, ESC_k, ESC_REF };         ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z, ESC_E, ESC_Q, ESC_k, ESC_REF };
608    
609    
610  /* Opcode table: OP_BRA must be last, as all values >= it are used for brackets  /* Opcode table: Starting from 1 (i.e. after OP_END), the values up to
 that extract substrings. Starting from 1 (i.e. after OP_END), the values up to  
611  OP_EOD must correspond in order to the list of escapes immediately above.  OP_EOD must correspond in order to the list of escapes immediately above.
612    
 To keep stored, compiled patterns compatible, new opcodes should be added  
 immediately before OP_BRA, where (since release 7.0) a gap is left for this  
 purpose.  
   
613  *** NOTE NOTE NOTE *** Whenever this list is updated, the two macro definitions  *** NOTE NOTE NOTE *** Whenever this list is updated, the two macro definitions
614  that follow must also be updated to match. There is also a table called  that follow must also be updated to match. There is also a table called
615  "coptable" in pcre_dfa_exec.c that must be updated. */  "coptable" in pcre_dfa_exec.c that must be updated. */
# Line 758  enum { Line 752  enum {
752    OP_DEF,            /* 101 The DEFINE condition */    OP_DEF,            /* 101 The DEFINE condition */
753    
754    OP_BRAZERO,        /* 102 These two must remain together and in this */    OP_BRAZERO,        /* 102 These two must remain together and in this */
755    OP_BRAMINZERO      /* 103 order. */    OP_BRAMINZERO,     /* 103 order. */
756    
757      /* These are backtracking control verbs */
758    
759      OP_PRUNE,          /* 104 */
760      OP_SKIP,           /* 105 */
761      OP_THEN,           /* 106 */
762      OP_COMMIT,         /* 107 */
763    
764      /* These are forced failure and success verbs */
765    
766      OP_FAIL,           /* 108 */
767      OP_ACCEPT          /* 109 */
768  };  };
769    
770    
# Line 782  for debugging. The macro is referenced o Line 788  for debugging. The macro is referenced o
788    "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not",     \    "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not",     \
789    "AssertB", "AssertB not", "Reverse",                            \    "AssertB", "AssertB not", "Reverse",                            \
790    "Once", "Bra", "CBra", "Cond", "SBra", "SCBra", "SCond",        \    "Once", "Bra", "CBra", "Cond", "SBra", "SCBra", "SCond",        \
791    "Cond ref", "Cond rec", "Cond def", "Brazero", "Braminzero"    "Cond ref", "Cond rec", "Cond def", "Brazero", "Braminzero",    \
792      "*PRUNE", "*SKIP", "*THEN", "*COMMIT", "*FAIL", "*ACCEPT"
793    
794    
795  /* This macro defines the length of fixed length operations in the compiled  /* This macro defines the length of fixed length operations in the compiled
# Line 846  in UTF-8 mode. The code that uses this t Line 853  in UTF-8 mode. The code that uses this t
853    3,                             /* RREF                                   */ \    3,                             /* RREF                                   */ \
854    1,                             /* DEF                                    */ \    1,                             /* DEF                                    */ \
855    1, 1,                          /* BRAZERO, BRAMINZERO                    */ \    1, 1,                          /* BRAZERO, BRAMINZERO                    */ \
856      1, 1, 1, 1,                    /* PRUNE, SKIP, THEN, COMMIT,             */ \
857      1, 1                           /* FAIL, ACCEPT                           */
858    
859    
860  /* A magic value for OP_RREF to indicate the "any recursion" condition. */  /* A magic value for OP_RREF to indicate the "any recursion" condition. */
# Line 860  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4, Line 869  enum { ERR0,  ERR1,  ERR2,  ERR3,  ERR4,
869         ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29,         ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29,
870         ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,         ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,
871         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
872         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58 };         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
873           ERR60, ERR61 };
874    
875  /* 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
876  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 882  NOTE NOTE NOTE: Line 892  NOTE NOTE NOTE:
892  typedef struct real_pcre {  typedef struct real_pcre {
893    pcre_uint32 magic_number;    pcre_uint32 magic_number;
894    pcre_uint32 size;               /* Total that was malloced */    pcre_uint32 size;               /* Total that was malloced */
895    pcre_uint32 options;    pcre_uint32 options;            /* Public options */
896    pcre_uint32 dummy1;             /* For future use, maybe */    pcre_uint16 flags;              /* Private flags */
897      pcre_uint16 dummy1;             /* For future use */
898    pcre_uint16 top_bracket;    pcre_uint16 top_bracket;
899    pcre_uint16 top_backref;    pcre_uint16 top_backref;
900    pcre_uint16 first_byte;    pcre_uint16 first_byte;
# Line 927  typedef struct compile_data { Line 937  typedef struct compile_data {
937    int  top_backref;             /* Maximum back reference */    int  top_backref;             /* Maximum back reference */
938    unsigned int backref_map;     /* Bitmap of low back refs */    unsigned int backref_map;     /* Bitmap of low back refs */
939    int  external_options;        /* External (initial) options */    int  external_options;        /* External (initial) options */
940      int  external_flags;          /* External flag bits to be set */
941    int  req_varyopt;             /* "After variable item" flag for reqbyte */    int  req_varyopt;             /* "After variable item" flag for reqbyte */
942    BOOL nopartial;               /* Set TRUE if partial won't work */    BOOL had_accept;              /* (*ACCEPT) encountered */
943    int  nltype;                  /* Newline type */    int  nltype;                  /* Newline type */
944    int  nllen;                   /* Newline string length */    int  nllen;                   /* Newline string length */
945    uschar nl[4];                 /* Newline string when fixed length */    uschar nl[4];                 /* Newline string when fixed length */

Legend:
Removed from v.207  
changed lines
  Added in v.230

  ViewVC Help
Powered by ViewVC 1.1.5