?? internal.h
字號:
2, 2, 2, 2, 2, 2, /* *, *?, +, +?, ?, ?? ** minima in */ \ 4, 4, 4, /* upto, minupto, exact ** UTF-8 mode */ \ /* Negative single-char repeats - only for chars < 256 */ \ 2, 2, 2, 2, 2, 2, /* NOT *, *?, +, +?, ?, ?? */ \ 4, 4, 4, /* NOT upto, minupto, exact */ \ /* Positive type repeats */ \ 2, 2, 2, 2, 2, 2, /* Type *, *?, +, +?, ?, ?? */ \ 4, 4, 4, /* Type upto, minupto, exact */ \ /* Character class & ref repeats */ \ 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ \ 5, 5, /* CRRANGE, CRMINRANGE */ \ 33, /* CLASS */ \ 33, /* NCLASS */ \ 0, /* XCLASS - variable length */ \ 3, /* REF */ \ 1+LINK_SIZE, /* RECURSE */ \ 2+2*LINK_SIZE, /* CALLOUT */ \ 1+LINK_SIZE, /* Alt */ \ 1+LINK_SIZE, /* Ket */ \ 1+LINK_SIZE, /* KetRmax */ \ 1+LINK_SIZE, /* KetRmin */ \ 1+LINK_SIZE, /* Assert */ \ 1+LINK_SIZE, /* Assert not */ \ 1+LINK_SIZE, /* Assert behind */ \ 1+LINK_SIZE, /* Assert behind not */ \ 1+LINK_SIZE, /* Reverse */ \ 1+LINK_SIZE, /* Once */ \ 1+LINK_SIZE, /* COND */ \ 3, /* CREF */ \ 1, 1, /* BRAZERO, BRAMINZERO */ \ 3, /* BRANUMBER */ \ 1+LINK_SIZE /* BRA */ \/* A magic value for OP_CREF to indicate the "in recursion" condition. */#define CREF_RECURSE 0xffff/* The texts of compile-time error messages are defined as macros here so thatthey can be accessed by the POSIX wrapper and converted into error codes. Yes,I could have used error codes in the first place, but didn't feel like changingjust to accommodate the POSIX wrapper. */#define ERR1 "\\ at end of pattern"#define ERR2 "\\c at end of pattern"#define ERR3 "unrecognized character follows \\"#define ERR4 "numbers out of order in {} quantifier"#define ERR5 "number too big in {} quantifier"#define ERR6 "missing terminating ] for character class"#define ERR7 "invalid escape sequence in character class"#define ERR8 "range out of order in character class"#define ERR9 "nothing to repeat"#define ERR10 "operand of unlimited repeat could match the empty string"#define ERR11 "internal error: unexpected repeat"#define ERR12 "unrecognized character after (?"#define ERR13 "POSIX named classes are supported only within a class"#define ERR14 "missing )"#define ERR15 "reference to non-existent subpattern"#define ERR16 "erroffset passed as NULL"#define ERR17 "unknown option bit(s) set"#define ERR18 "missing ) after comment"#define ERR19 "parentheses nested too deeply"#define ERR20 "regular expression too large"#define ERR21 "failed to get memory"#define ERR22 "unmatched parentheses"#define ERR23 "internal error: code overflow"#define ERR24 "unrecognized character after (?<"#define ERR25 "lookbehind assertion is not fixed length"#define ERR26 "malformed number after (?("#define ERR27 "conditional group contains more than two branches"#define ERR28 "assertion expected after (?("#define ERR29 "(?R or (?digits must be followed by )"#define ERR30 "unknown POSIX class name"#define ERR31 "POSIX collating elements are not supported"#define ERR32 "this version of PCRE is not compiled with PCRE_UTF8 support"#define ERR33 "spare error"#define ERR34 "character value in \\x{...} sequence is too large"#define ERR35 "invalid condition (?(0)"#define ERR36 "\\C not allowed in lookbehind assertion"#define ERR37 "PCRE does not support \\L, \\l, \\N, \\U, or \\u"#define ERR38 "number after (?C is > 255"#define ERR39 "closing ) for (?C expected"#define ERR40 "recursive call could loop indefinitely"#define ERR41 "unrecognized character after (?P"#define ERR42 "syntax error after (?P"#define ERR43 "two named groups have the same name"#define ERR44 "invalid UTF-8 string"#define ERR45 "support for \\P, \\p, and \\X has not been compiled"#define ERR46 "malformed \\P or \\p sequence"#define ERR47 "unknown property name after \\P or \\p"/* The real format of the start of the pcre block; the index of names and thecode vector run on as long as necessary after the end. We store an explicitoffset to the name table so that if a regex is compiled on one host, saved, andthen run on another where the size of pointers is different, all might stillbe well. For the case of compiled-on-4 and run-on-8, we include an extrapointer that is always NULL. For future-proofing, we also include a few dummyfields - even though you can never get this planning right!NOTE NOTE NOTE:Because people can now save and re-use compiled patterns, any additions to thisstructure should be made at the end, and something earlier (e.g. a newflag in the options or one of the dummy fields) should indicate that the newfields are present. Currently PCRE always sets the dummy fields to zero.NOTE NOTE NOTE:*/typedef struct real_pcre { pcre_uint32 magic_number; pcre_uint32 size; /* Total that was malloced */ pcre_uint32 options; pcre_uint32 dummy1; /* For future use, maybe */ pcre_uint16 top_bracket; pcre_uint16 top_backref; pcre_uint16 first_byte; pcre_uint16 req_byte; pcre_uint16 name_table_offset; /* Offset to name table that follows */ pcre_uint16 name_entry_size; /* Size of any name items */ pcre_uint16 name_count; /* Number of name items */ pcre_uint16 dummy2; /* For future use, maybe */ const unsigned char *tables; /* Pointer to tables or NULL for std */ const unsigned char *nullpad; /* NULL padding */} real_pcre;/* The format of the block used to store data from pcre_study(). The sameremark (see NOTE above) about extending this structure applies. */typedef struct pcre_study_data { pcre_uint32 size; /* Total that was malloced */ pcre_uint32 options; uschar start_bits[32];} pcre_study_data;/* Structure for passing "static" information around between the functionsdoing the compiling, so that they are thread-safe. */typedef struct compile_data { const uschar *lcc; /* Points to lower casing table */ const uschar *fcc; /* Points to case-flipping table */ const uschar *cbits; /* Points to character type table */ const uschar *ctypes; /* Points to table of type maps */ const uschar *start_code; /* The start of the compiled code */ const uschar *start_pattern; /* The start of the pattern */ uschar *name_table; /* The name/number table */ int names_found; /* Number of entries so far */ int name_entry_size; /* Size of each entry */ int top_backref; /* Maximum back reference */ unsigned int backref_map; /* Bitmap of low back refs */ int req_varyopt; /* "After variable item" flag for reqbyte */ BOOL nopartial; /* Set TRUE if partial won't work */} compile_data;/* Structure for maintaining a chain of pointers to the currently incompletebranches, for testing for left recursion. */typedef struct branch_chain { struct branch_chain *outer; uschar *current;} branch_chain;/* Structure for items in a linked list that represents an explicit recursivecall within the pattern. */typedef struct recursion_info { struct recursion_info *prevrec; /* Previous recursion record (or NULL) */ int group_num; /* Number of group that was called */ const uschar *after_call; /* "Return value": points after the call in the expr */ const uschar *save_start; /* Old value of md->start_match */ int *offset_save; /* Pointer to start of saved offsets */ int saved_max; /* Number of saved offsets */} recursion_info;/* When compiling in a mode that doesn't use recursive calls to match(),a structure is used to remember local variables on the heap. It is defined inpcre.c, close to the match() function, so that it is easy to keep it in stepwith any changes of local variable. However, the pointer to the current framemust be saved in some "static" place over a longjmp(). We declare thestructure here so that we can put a pointer in the match_data structure.NOTE: This isn't used for a "normal" compilation of pcre. */struct heapframe;/* Structure for passing "static" information around between the functionsdoing the matching, so that they are thread-safe. */typedef struct match_data { unsigned long int match_call_count; /* As it says */ unsigned long int match_limit;/* As it says */ int *offset_vector; /* Offset vector */ int offset_end; /* One past the end */ int offset_max; /* The maximum usable for return data */ const uschar *lcc; /* Points to lower casing table */ const uschar *ctypes; /* Points to table of type maps */ BOOL offset_overflow; /* Set if too many extractions */ BOOL notbol; /* NOTBOL flag */ BOOL noteol; /* NOTEOL flag */ BOOL utf8; /* UTF8 flag */ BOOL endonly; /* Dollar not before final \n */ BOOL notempty; /* Empty string match not wanted */ BOOL partial; /* PARTIAL flag */ BOOL hitend; /* Hit the end of the subject at some point */ const uschar *start_code; /* For use when recursing */ const uschar *start_subject; /* Start of the subject string */ const uschar *end_subject; /* End of the subject string */ const uschar *start_match; /* Start of this match attempt */ const uschar *end_match_ptr; /* Subject position at end match */ int end_offset_top; /* Highwater mark at end of match */ int capture_last; /* Most recent capture number */ int start_offset; /* The start offset value */ recursion_info *recursive; /* Linked list of recursion data */ void *callout_data; /* To pass back to callouts */ struct heapframe *thisframe; /* Used only when compiling for no recursion */} match_data;/* Bit definitions for entries in the pcre_ctypes table. */#define ctype_space 0x01#define ctype_letter 0x02#define ctype_digit 0x04#define ctype_xdigit 0x08#define ctype_word 0x10 /* alphameric or '_' */#define ctype_meta 0x80 /* regexp meta char or zero (end pattern) *//* Offsets for the bitmap tables in pcre_cbits. Each table contains a setof bits for a class map. Some classes are built by combining these tables. */#define cbit_space 0 /* [:space:] or \s */#define cbit_xdigit 32 /* [:xdigit:] */#define cbit_digit 64 /* [:digit:] or \d */#define cbit_upper 96 /* [:upper:] */#define cbit_lower 128 /* [:lower:] */#define cbit_word 160 /* [:word:] or \w */#define cbit_graph 192 /* [:graph:] */#define cbit_print 224 /* [:print:] */#define cbit_punct 256 /* [:punct:] */#define cbit_cntrl 288 /* [:cntrl:] */#define cbit_length 320 /* Length of the cbits table *//* Offsets of the various tables from the base tables pointer, andtotal length. */#define lcc_offset 0#define fcc_offset 256#define cbits_offset 512#define ctypes_offset (cbits_offset + cbit_length)#define tables_length (ctypes_offset + 256)/* End of internal.h */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -