/[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 199 by ph10, Tue Jul 31 14:39:09 2007 UTC revision 211 by ph10, Thu Aug 9 09:52:43 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. */  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
363    support is omitted, we don't even define it. */
364    
365  #ifndef SUPPORT_UTF8  #ifndef SUPPORT_UTF8
366  #define GETCHAR(c, eptr) c = *eptr;  #define GETCHAR(c, eptr) c = *eptr;
# Line 366  byte-mode, and more complicated ones for Line 368  byte-mode, and more complicated ones for
368  #define GETCHARINC(c, eptr) c = *eptr++;  #define GETCHARINC(c, eptr) c = *eptr++;
369  #define GETCHARINCTEST(c, eptr) c = *eptr++;  #define GETCHARINCTEST(c, eptr) c = *eptr++;
370  #define GETCHARLEN(c, eptr, len) c = *eptr;  #define GETCHARLEN(c, eptr, len) c = *eptr;
371  #define BACKCHAR(eptr)  /* #define BACKCHAR(eptr) */
372    
373  #else   /* SUPPORT_UTF8 */  #else   /* SUPPORT_UTF8 */
374    
# Line 459  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. Called only in UTF-8 mode. */  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. */
466    
467  #define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--;  #define BACKCHAR(eptr) while((*eptr & 0xc0) == 0x80) eptr--
468    
469  #endif  #endif
470    
# Line 605  enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, E Line 608  enum { ESC_A = 1, ESC_G, ESC_K, ESC_B, E
608         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 };
609    
610    
611  /* 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  
612  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.
613    
 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.  
   
614  *** NOTE NOTE NOTE *** Whenever this list is updated, the two macro definitions  *** NOTE NOTE NOTE *** Whenever this list is updated, the two macro definitions
615  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
616  "coptable" in pcre_dfa_exec.c that must be updated. */  "coptable" in pcre_dfa_exec.c that must be updated. */
# Line 755  enum { Line 753  enum {
753    OP_DEF,            /* 101 The DEFINE condition */    OP_DEF,            /* 101 The DEFINE condition */
754    
755    OP_BRAZERO,        /* 102 These two must remain together and in this */    OP_BRAZERO,        /* 102 These two must remain together and in this */
756    OP_BRAMINZERO      /* 103 order. */    OP_BRAMINZERO,     /* 103 order. */
757    
758      /* These are backtracking control verbs */
759    
760      OP_PRUNE,          /* 104 */
761      OP_SKIP,           /* 105 */
762      OP_THEN,           /* 106 */
763      OP_COMMIT,         /* 107 */
764    
765      /* These are forced failure and success verbs */
766    
767      OP_FAIL,           /* 108 */
768      OP_ACCEPT          /* 109 */
769  };  };
770    
771    
# Line 779  for debugging. The macro is referenced o Line 789  for debugging. The macro is referenced o
789    "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not",     \    "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not",     \
790    "AssertB", "AssertB not", "Reverse",                            \    "AssertB", "AssertB not", "Reverse",                            \
791    "Once", "Bra", "CBra", "Cond", "SBra", "SCBra", "SCond",        \    "Once", "Bra", "CBra", "Cond", "SBra", "SCBra", "SCond",        \
792    "Cond ref", "Cond rec", "Cond def", "Brazero", "Braminzero"    "Cond ref", "Cond rec", "Cond def", "Brazero", "Braminzero",    \
793      "*PRUNE", "*SKIP", "*THEN", "*COMMIT", "*FAIL", "*ACCEPT"
794    
795    
796  /* 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 843  in UTF-8 mode. The code that uses this t Line 854  in UTF-8 mode. The code that uses this t
854    3,                             /* RREF                                   */ \    3,                             /* RREF                                   */ \
855    1,                             /* DEF                                    */ \    1,                             /* DEF                                    */ \
856    1, 1,                          /* BRAZERO, BRAMINZERO                    */ \    1, 1,                          /* BRAZERO, BRAMINZERO                    */ \
857      1, 1, 1, 1,                    /* PRUNE, SKIP, THEN, COMMIT,             */ \
858      1, 1                           /* FAIL, ACCEPT                           */
859    
860    
861  /* 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 857  enum { ERR0, ERR1, ERR2, ERR3, ERR4, Line 870  enum { ERR0, ERR1, ERR2, ERR3, ERR4,
870         ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29,         ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29,
871         ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,         ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39,
872         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,         ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49,
873         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58 };         ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59,
874           ERR60 };
875    
876  /* 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
877  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 926  typedef struct compile_data { Line 940  typedef struct compile_data {
940    int  external_options;        /* External (initial) options */    int  external_options;        /* External (initial) options */
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 nopartial;               /* Set TRUE if partial won't work */
943      BOOL had_accept;              /* (*ACCEPT) encountered */
944    int  nltype;                  /* Newline type */    int  nltype;                  /* Newline type */
945    int  nllen;                   /* Newline string length */    int  nllen;                   /* Newline string length */
946    uschar nl[4];                 /* Newline string when fixed length */    uschar nl[4];                 /* Newline string when fixed length */

Legend:
Removed from v.199  
changed lines
  Added in v.211

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12