#include <ctype.h>#include <limits.h>#include <setjmp.h>#include <stdarg.h>#include <stddef.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "pcre.h"#include "ucp.h"Go to the source code of this file.
|
|
Definition at line 1064 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1057 of file pcre_internal.h. Referenced by pcre_maketables(), and set_start_bits(). |
|
|
Definition at line 1061 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1065 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1059 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1062 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1063 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1055 of file pcre_internal.h. Referenced by pcre_maketables(), and set_start_bits(). |
|
|
Definition at line 1058 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1060 of file pcre_internal.h. Referenced by pcre_maketables(), and set_start_bits(). |
|
|
Definition at line 1056 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 1072 of file pcre_internal.h. Referenced by pcre_compile2(), and pcre_study(). |
|
|
Definition at line 1047 of file pcre_internal.h. Referenced by check_escape(). |
|
|
Definition at line 1046 of file pcre_internal.h. Referenced by check_posix_syntax(), and set_bit(). |
|
|
Definition at line 1050 of file pcre_internal.h. |
|
|
Definition at line 1045 of file pcre_internal.h. Referenced by check_auto_possessive(). |
|
|
Definition at line 1049 of file pcre_internal.h. |
|
|
Definition at line 1048 of file pcre_internal.h. |
|
|
Definition at line 1073 of file pcre_internal.h. Referenced by internal_dfa_exec(), pcre_compile2(), pcre_exec(), and pcre_study(). |
|
|
Definition at line 71 of file pcre_internal.h. Referenced by compile_branch(), internal_dfa_exec(), match(), and pcre_compile2(). |
|
|
Definition at line 564 of file pcre_internal.h. |
|
|
Definition at line 568 of file pcre_internal.h. |
|
|
Definition at line 572 of file pcre_internal.h. |
|
|
Definition at line 576 of file pcre_internal.h. |
|
|
Definition at line 583 of file pcre_internal.h. |
|
|
|
Definition at line 1071 of file pcre_internal.h. Referenced by internal_dfa_exec(), pcre_compile2(), and pcre_study(). |
|
|
Definition at line 361 of file pcre_internal.h. Referenced by could_be_empty_branch(), find_bracket(), find_fixedlength(), is_anchored(), is_startline(), and match(). |
|
|
Definition at line 374 of file pcre_internal.h. Referenced by _pcre_is_newline(), and _pcre_was_newline(). |
|
|
Definition at line 376 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 377 of file pcre_internal.h. Referenced by check_escape(). |
|
|
Definition at line 378 of file pcre_internal.h. |
|
|
Definition at line 375 of file pcre_internal.h. |
|
|
Value: ((NLBLOCK->nltype != NLTYPE_FIXED)? \ ((p) < NLBLOCK->PSEND && \ _pcre_is_newline((p), NLBLOCK->nltype, NLBLOCK->PSEND, &(NLBLOCK->nllen),\ utf8)) \ : \ ((p) <= NLBLOCK->PSEND - NLBLOCK->nllen && \ (p)[0] == NLBLOCK->nl[0] && \ (NLBLOCK->nllen == 1 || (p)[1] == NLBLOCK->nl[1]) \ ) \ ) Definition at line 192 of file pcre_internal.h. |
|
|
Definition at line 1070 of file pcre_internal.h. Referenced by internal_dfa_exec(), pcre_compile2(), pcre_exec(), and pcre_study(). |
|
|
Definition at line 534 of file pcre_internal.h. Referenced by _pcre_try_flipped(), main(), pcre_compile2(), pcre_dfa_exec(), pcre_exec(), pcre_fullinfo(), pcre_info(), and pcre_study(). |
|
|
|
Definition at line 187 of file pcre_internal.h. Referenced by pcre_compile2(). |
|
|
Definition at line 188 of file pcre_internal.h. Referenced by _pcre_is_newline(), _pcre_was_newline(), and pcre_compile2(). |
|
|
Definition at line 186 of file pcre_internal.h. Referenced by pcre_compile2(). |
|
|
Definition at line 178 of file pcre_internal.h. |
|
|
Definition at line 484 of file pcre_internal.h. |
|
|
Definition at line 816 of file pcre_internal.h. |
|
|
Value: "End", "\\A", "\\G", "\\K", "\\B", "\\b", "\\D", "\\d", \ "\\S", "\\s", "\\W", "\\w", "Any", "Anybyte", \ "notprop", "prop", "\\R", "\\H", "\\h", "\\V", "\\v", \ "extuni", "\\Z", "\\z", \ "Opt", "^", "$", "char", "charnc", "not", \ "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ "*+","++", "?+", "{", \ "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ "*+","++", "?+", "{", \ "*", "*?", "+", "+?", "?", "??", "{", "{", "{", \ "*+","++", "?+", "{", \ "*", "*?", "+", "+?", "?", "??", "{", "{", \ "class", "nclass", "xclass", "Ref", "Recurse", "Callout", \ "Alt", "Ket", "KetRmax", "KetRmin", "Assert", "Assert not", \ "AssertB", "AssertB not", "Reverse", \ "Once", "Bra", "CBra", "Cond", "SBra", "SCBra", "SCond", \ "Cond ref", "Cond rec", "Cond def", "Brazero", "Braminzero", \ "*PRUNE", "*SKIP", "*THEN", "*COMMIT", "*FAIL", "*ACCEPT" Definition at line 786 of file pcre_internal.h. |
|
|
Definition at line 132 of file pcre_internal.h. |
|
|
Definition at line 135 of file pcre_internal.h. |
|
|
Definition at line 499 of file pcre_internal.h. Referenced by pcre_compile2(), pcre_fullinfo(), pcre_info(), and pcre_study(). |
|
|
Definition at line 503 of file pcre_internal.h. Referenced by pcre_fullinfo(). |
|
|
Definition at line 490 of file pcre_internal.h. |
|
|
Definition at line 502 of file pcre_internal.h. Referenced by get_first_set(), and pcre_fullinfo(). |
|
|
Value: Definition at line 512 of file pcre_internal.h. Referenced by pcre_compile2(), pcre_dfa_exec(), and pcre_exec(). |
|
|
Definition at line 498 of file pcre_internal.h. Referenced by pcre_compile2(), and pcre_fullinfo(). |
|
|
Definition at line 500 of file pcre_internal.h. Referenced by pcre_compile2(), and pcre_fullinfo(). |
|
|
Definition at line 231 of file pcre_internal.h. |
|
|
Definition at line 501 of file pcre_internal.h. Referenced by pcre_compile2(), pcre_exec(), pcre_fullinfo(), pcre_info(), and pcre_study(). |
|
|
Definition at line 507 of file pcre_internal.h. Referenced by pcre_fullinfo(), and pcre_study(). |
|
|
Definition at line 588 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 590 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 589 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 591 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 592 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Value: (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \ PCRE_PARTIAL|PCRE_DFA_SHORTEST|PCRE_DFA_RESTART|PCRE_NEWLINE_BITS) Definition at line 525 of file pcre_internal.h. Referenced by pcre_dfa_exec(). |
|
|
Value: (PCRE_ANCHORED|PCRE_NOTBOL|PCRE_NOTEOL|PCRE_NOTEMPTY|PCRE_NO_UTF8_CHECK| \ PCRE_PARTIAL|PCRE_NEWLINE_BITS) Definition at line 521 of file pcre_internal.h. Referenced by pcre_exec(). |
|
|
Value: (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \ PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY|PCRE_UTF8| \ PCRE_NO_AUTO_CAPTURE|PCRE_NO_UTF8_CHECK|PCRE_AUTO_CALLOUT|PCRE_FIRSTLINE| \ PCRE_DUPNAMES|PCRE_NEWLINE_BITS) Definition at line 515 of file pcre_internal.h. Referenced by pcre_compile2(), pcre_fullinfo(), and pcre_info(). |
|
|
Definition at line 529 of file pcre_internal.h. Referenced by pcre_study(). |
|
|
Value: a[n] = (d) >> 8; \ a[(n)+1] = (d) & 255 Definition at line 357 of file pcre_internal.h. |
|
|
Definition at line 364 of file pcre_internal.h. |
|
|
Definition at line 350 of file pcre_internal.h. |
|
|
Definition at line 544 of file pcre_internal.h. |
|
|
Definition at line 549 of file pcre_internal.h. Referenced by compile_branch(), find_firstassertedchar(), and pcre_compile2(). |
|
|
Definition at line 539 of file pcre_internal.h. |
|
|
Definition at line 538 of file pcre_internal.h. Referenced by compile_branch(), and compile_regex(). |
|
|
Definition at line 550 of file pcre_internal.h. Referenced by pcre_compile2(). |
|
|
Definition at line 874 of file pcre_internal.h. |
|
|
Definition at line 1074 of file pcre_internal.h. Referenced by pcre_maketables(). |
|
|
Definition at line 558 of file pcre_internal.h. Referenced by _pcre_is_newline(), _pcre_was_newline(), check_escape(), check_posix_syntax(), compile_single_pattern(), could_be_empty(), could_be_empty_branch(), do_after_lines(), find_firstassertedchar(), handle_option(), is_anchored(), is_counted_repeat(), is_startline(), match(), match_ref(), P4Available(), pcre_compile2(), pcregrep(), regexec(), and set_start_bits(). |
|
|
Definition at line 232 of file pcre_internal.h. Referenced by match(), match_ref(), and pcre_exec(). |
|
|
Value: ((NLBLOCK->nltype != NLTYPE_FIXED)? \ ((p) > NLBLOCK->PSSTART && \ _pcre_was_newline((p), NLBLOCK->nltype, NLBLOCK->PSSTART, \ &(NLBLOCK->nllen), utf8)) \ : \ ((p) >= NLBLOCK->PSSTART + NLBLOCK->nllen && \ (p)[-NLBLOCK->nllen] == NLBLOCK->nl[0] && \ (NLBLOCK->nllen == 1 || (p)[-NLBLOCK->nllen+1] == NLBLOCK->nl[1]) \ ) \ ) Definition at line 206 of file pcre_internal.h. |
|
|
Definition at line 600 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 598 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 597 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 604 of file pcre_internal.h. |
|
|
Definition at line 603 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 602 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 601 of file pcre_internal.h. Referenced by _pcre_xclass(). |
|
|
Definition at line 554 of file pcre_internal.h. |
|
|
Definition at line 172 of file pcre_internal.h. |
|
|
Definition at line 617 of file pcre_internal.h. 00617 { ESC_A = 1, ESC_G, ESC_K, ESC_B, ESC_b, ESC_D, ESC_d, ESC_S, ESC_s, 00618 ESC_W, ESC_w, ESC_dum1, ESC_C, ESC_P, ESC_p, ESC_R, ESC_H, ESC_h, 00619 ESC_V, ESC_v, ESC_X, ESC_Z, ESC_z, ESC_E, ESC_Q, ESC_k, ESC_REF };
|
|
|
Definition at line 629 of file pcre_internal.h. 00629 { 00630 OP_END, /* 0 End of pattern */ 00631 00632 /* Values corresponding to backslashed metacharacters */ 00633 00634 OP_SOD, /* 1 Start of data: \A */ 00635 OP_SOM, /* 2 Start of match (subject + offset): \G */ 00636 OP_SET_SOM, /* 3 Set start of match (\K) */ 00637 OP_NOT_WORD_BOUNDARY, /* 4 \B */ 00638 OP_WORD_BOUNDARY, /* 5 \b */ 00639 OP_NOT_DIGIT, /* 6 \D */ 00640 OP_DIGIT, /* 7 \d */ 00641 OP_NOT_WHITESPACE, /* 8 \S */ 00642 OP_WHITESPACE, /* 9 \s */ 00643 OP_NOT_WORDCHAR, /* 10 \W */ 00644 OP_WORDCHAR, /* 11 \w */ 00645 OP_ANY, /* 12 Match any character */ 00646 OP_ANYBYTE, /* 13 Match any byte (\C); different to OP_ANY for UTF-8 */ 00647 OP_NOTPROP, /* 14 \P (not Unicode property) */ 00648 OP_PROP, /* 15 \p (Unicode property) */ 00649 OP_ANYNL, /* 16 \R (any newline sequence) */ 00650 OP_NOT_HSPACE, /* 17 \H (not horizontal whitespace) */ 00651 OP_HSPACE, /* 18 \h (horizontal whitespace) */ 00652 OP_NOT_VSPACE, /* 19 \V (not vertical whitespace) */ 00653 OP_VSPACE, /* 20 \v (vertical whitespace) */ 00654 OP_EXTUNI, /* 21 \X (extended Unicode sequence */ 00655 OP_EODN, /* 22 End of data or \n at end of data: \Z. */ 00656 OP_EOD, /* 23 End of data: \z */ 00657 00658 OP_OPT, /* 24 Set runtime options */ 00659 OP_CIRC, /* 25 Start of line - varies with multiline switch */ 00660 OP_DOLL, /* 26 End of line - varies with multiline switch */ 00661 OP_CHAR, /* 27 Match one character, casefully */ 00662 OP_CHARNC, /* 28 Match one character, caselessly */ 00663 OP_NOT, /* 29 Match one character, not the following one */ 00664 00665 OP_STAR, /* 30 The maximizing and minimizing versions of */ 00666 OP_MINSTAR, /* 31 these six opcodes must come in pairs, with */ 00667 OP_PLUS, /* 32 the minimizing one second. */ 00668 OP_MINPLUS, /* 33 This first set applies to single characters.*/ 00669 OP_QUERY, /* 34 */ 00670 OP_MINQUERY, /* 35 */ 00671 00672 OP_UPTO, /* 36 From 0 to n matches */ 00673 OP_MINUPTO, /* 37 */ 00674 OP_EXACT, /* 38 Exactly n matches */ 00675 00676 OP_POSSTAR, /* 39 Possessified star */ 00677 OP_POSPLUS, /* 40 Possessified plus */ 00678 OP_POSQUERY, /* 41 Posesssified query */ 00679 OP_POSUPTO, /* 42 Possessified upto */ 00680 00681 OP_NOTSTAR, /* 43 The maximizing and minimizing versions of */ 00682 OP_NOTMINSTAR, /* 44 these six opcodes must come in pairs, with */ 00683 OP_NOTPLUS, /* 45 the minimizing one second. They must be in */ 00684 OP_NOTMINPLUS, /* 46 exactly the same order as those above. */ 00685 OP_NOTQUERY, /* 47 This set applies to "not" single characters. */ 00686 OP_NOTMINQUERY, /* 48 */ 00687 00688 OP_NOTUPTO, /* 49 From 0 to n matches */ 00689 OP_NOTMINUPTO, /* 50 */ 00690 OP_NOTEXACT, /* 51 Exactly n matches */ 00691 00692 OP_NOTPOSSTAR, /* 52 Possessified versions */ 00693 OP_NOTPOSPLUS, /* 53 */ 00694 OP_NOTPOSQUERY, /* 54 */ 00695 OP_NOTPOSUPTO, /* 55 */ 00696 00697 OP_TYPESTAR, /* 56 The maximizing and minimizing versions of */ 00698 OP_TYPEMINSTAR, /* 57 these six opcodes must come in pairs, with */ 00699 OP_TYPEPLUS, /* 58 the minimizing one second. These codes must */ 00700 OP_TYPEMINPLUS, /* 59 be in exactly the same order as those above. */ 00701 OP_TYPEQUERY, /* 60 This set applies to character types such as \d */ 00702 OP_TYPEMINQUERY, /* 61 */ 00703 00704 OP_TYPEUPTO, /* 62 From 0 to n matches */ 00705 OP_TYPEMINUPTO, /* 63 */ 00706 OP_TYPEEXACT, /* 64 Exactly n matches */ 00707 00708 OP_TYPEPOSSTAR, /* 65 Possessified versions */ 00709 OP_TYPEPOSPLUS, /* 66 */ 00710 OP_TYPEPOSQUERY, /* 67 */ 00711 OP_TYPEPOSUPTO, /* 68 */ 00712 00713 OP_CRSTAR, /* 69 The maximizing and minimizing versions of */ 00714 OP_CRMINSTAR, /* 70 all these opcodes must come in pairs, with */ 00715 OP_CRPLUS, /* 71 the minimizing one second. These codes must */ 00716 OP_CRMINPLUS, /* 72 be in exactly the same order as those above. */ 00717 OP_CRQUERY, /* 73 These are for character classes and back refs */ 00718 OP_CRMINQUERY, /* 74 */ 00719 OP_CRRANGE, /* 75 These are different to the three sets above. */ 00720 OP_CRMINRANGE, /* 76 */ 00721 00722 OP_CLASS, /* 77 Match a character class, chars < 256 only */ 00723 OP_NCLASS, /* 78 Same, but the bitmap was created from a negative 00724 class - the difference is relevant only when a UTF-8 00725 character > 255 is encountered. */ 00726 00727 OP_XCLASS, /* 79 Extended class for handling UTF-8 chars within the 00728 class. This does both positive and negative. */ 00729 00730 OP_REF, /* 80 Match a back reference */ 00731 OP_RECURSE, /* 81 Match a numbered subpattern (possibly recursive) */ 00732 OP_CALLOUT, /* 82 Call out to external function if provided */ 00733 00734 OP_ALT, /* 83 Start of alternation */ 00735 OP_KET, /* 84 End of group that doesn't have an unbounded repeat */ 00736 OP_KETRMAX, /* 85 These two must remain together and in this */ 00737 OP_KETRMIN, /* 86 order. They are for groups the repeat for ever. */ 00738 00739 /* The assertions must come before BRA, CBRA, ONCE, and COND.*/ 00740 00741 OP_ASSERT, /* 87 Positive lookahead */ 00742 OP_ASSERT_NOT, /* 88 Negative lookahead */ 00743 OP_ASSERTBACK, /* 89 Positive lookbehind */ 00744 OP_ASSERTBACK_NOT, /* 90 Negative lookbehind */ 00745 OP_REVERSE, /* 91 Move pointer back - used in lookbehind assertions */ 00746 00747 /* ONCE, BRA, CBRA, and COND must come after the assertions, with ONCE first, 00748 as there's a test for >= ONCE for a subpattern that isn't an assertion. */ 00749 00750 OP_ONCE, /* 92 Atomic group */ 00751 OP_BRA, /* 93 Start of non-capturing bracket */ 00752 OP_CBRA, /* 94 Start of capturing bracket */ 00753 OP_COND, /* 95 Conditional group */ 00754 00755 /* These three must follow the previous three, in the same order. There's a 00756 check for >= SBRA to distinguish the two sets. */ 00757 00758 OP_SBRA, /* 96 Start of non-capturing bracket, check empty */ 00759 OP_SCBRA, /* 97 Start of capturing bracket, check empty */ 00760 OP_SCOND, /* 98 Conditional group, check empty */ 00761 00762 OP_CREF, /* 99 Used to hold a capture number as condition */ 00763 OP_RREF, /* 100 Used to hold a recursion number as condition */ 00764 OP_DEF, /* 101 The DEFINE condition */ 00765 00766 OP_BRAZERO, /* 102 These two must remain together and in this */ 00767 OP_BRAMINZERO, /* 103 order. */ 00768 00769 /* These are backtracking control verbs */ 00770 00771 OP_PRUNE, /* 104 */ 00772 OP_SKIP, /* 105 */ 00773 OP_THEN, /* 106 */ 00774 OP_COMMIT, /* 107 */ 00775 00776 /* These are forced failure and success verbs */ 00777 00778 OP_FAIL, /* 108 */ 00779 OP_ACCEPT /* 109 */ 00780 };
|
|
|
Definition at line 879 of file pcre_internal.h. 00879 { ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9, 00880 ERR10, ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17, ERR18, ERR19, 00881 ERR20, ERR21, ERR22, ERR23, ERR24, ERR25, ERR26, ERR27, ERR28, ERR29, 00882 ERR30, ERR31, ERR32, ERR33, ERR34, ERR35, ERR36, ERR37, ERR38, ERR39, 00883 ERR40, ERR41, ERR42, ERR43, ERR44, ERR45, ERR46, ERR47, ERR48, ERR49, 00884 ERR50, ERR51, ERR52, ERR53, ERR54, ERR55, ERR56, ERR57, ERR58, ERR59, 00885 ERR60, ERR61 };
|
|
||||||||||||||||||||||||
|
Definition at line 75 of file pcre_newline.cpp. References FALSE, GETCHAR, NLTYPE_ANYCRLF, and TRUE. 00077 { 00078 int c; 00079 if (utf8) { GETCHAR(c, ptr); } else c = *ptr; 00080 00081 if (type == NLTYPE_ANYCRLF) switch(c) 00082 { 00083 case 0x000a: *lenptr = 1; return TRUE; /* LF */ 00084 case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1; 00085 return TRUE; /* CR */ 00086 default: return FALSE; 00087 } 00088 00089 /* NLTYPE_ANY */ 00090 00091 else switch(c) 00092 { 00093 case 0x000a: /* LF */ 00094 case 0x000b: /* VT */ 00095 case 0x000c: *lenptr = 1; return TRUE; /* FF */ 00096 case 0x000d: *lenptr = (ptr < endptr - 1 && ptr[1] == 0x0a)? 2 : 1; 00097 return TRUE; /* CR */ 00098 case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */ 00099 case 0x2028: /* LS */ 00100 case 0x2029: *lenptr = 3; return TRUE; /* PS */ 00101 default: return FALSE; 00102 } 00103 }
|
|
||||||||||||
|
Definition at line 66 of file pcre_ord2utf8.cpp. References _pcre_utf8_table1, _pcre_utf8_table1_size, and util::threadpool::i. 00067 { 00068 #ifdef SUPPORT_UTF8 00069 register int i, j; 00070 for (i = 0; i < _pcre_utf8_table1_size; i++) 00071 if (cvalue <= _pcre_utf8_table1[i]) break; 00072 buffer += i; 00073 for (j = i; j > 0; j--) 00074 { 00075 *buffer-- = 0x80 | (cvalue & 0x3f); 00076 cvalue >>= 6; 00077 } 00078 *buffer = _pcre_utf8_table2[i] | cvalue; 00079 return i + 1; 00080 #else 00081 return 0; /* Keep compiler happy; this function won't ever be */ 00082 #endif /* called when SUPPORT_UTF8 is not defined. */ 00083 }
|
|
||||||||||||||||||||
|
Definition at line 102 of file pcre_try_flipped.cpp. References byteflip(), real_pcre::first_byte, real_pcre::magic_number, MAGIC_NUMBER, real_pcre::name_count, real_pcre::name_entry_size, real_pcre::name_table_offset, NULL, real_pcre::options, pcre_study_data::options, real_pcre::req_byte, real_pcre::size, pcre_study_data::size, real_pcre::top_backref, and real_pcre::top_bracket. Referenced by pcre_dfa_exec(), pcre_exec(), pcre_fullinfo(), and pcre_info(). 00104 { 00105 if (byteflip(re->magic_number, sizeof(re->magic_number)) != MAGIC_NUMBER) 00106 return NULL; 00107 00108 *internal_re = *re; /* To copy other fields */ 00109 internal_re->size = byteflip(re->size, sizeof(re->size)); 00110 internal_re->options = byteflip(re->options, sizeof(re->options)); 00111 internal_re->top_bracket = 00112 (pcre_uint16)byteflip(re->top_bracket, sizeof(re->top_bracket)); 00113 internal_re->top_backref = 00114 (pcre_uint16)byteflip(re->top_backref, sizeof(re->top_backref)); 00115 internal_re->first_byte = 00116 (pcre_uint16)byteflip(re->first_byte, sizeof(re->first_byte)); 00117 internal_re->req_byte = 00118 (pcre_uint16)byteflip(re->req_byte, sizeof(re->req_byte)); 00119 internal_re->name_table_offset = 00120 (pcre_uint16)byteflip(re->name_table_offset, sizeof(re->name_table_offset)); 00121 internal_re->name_entry_size = 00122 (pcre_uint16)byteflip(re->name_entry_size, sizeof(re->name_entry_size)); 00123 internal_re->name_count = 00124 (pcre_uint16)byteflip(re->name_count, sizeof(re->name_count)); 00125 00126 if (study != NULL) 00127 { 00128 *internal_study = *study; /* To copy other fields */ 00129 internal_study->size = byteflip(study->size, sizeof(study->size)); 00130 internal_study->options = byteflip(study->options, sizeof(study->options)); 00131 } 00132 00133 return internal_re; 00134 }
|
|
||||||||||||||||
|
Referenced by _pcre_xclass(). |
|
|
|
|
||||||||||||
|
Definition at line 78 of file pcre_valid_utf8.cpp. References _pcre_utf8_table4. Referenced by pcre_compile2(). 00079 { 00080 #ifdef SUPPORT_UTF8 00081 register const uschar *p; 00082 00083 if (length < 0) 00084 { 00085 for (p = string; *p != 0; p++){ /*nothing*/ } 00086 length = p - string; 00087 } 00088 00089 for (p = string; length-- > 0; p++) 00090 { 00091 register int ab; 00092 register int c = *p; 00093 if (c < 128) continue; 00094 if (c < 0xc0) return p - string; 00095 ab = _pcre_utf8_table4[c & 0x3f]; /* Number of additional bytes */ 00096 if (length < ab || ab > 3) return p - string; 00097 length -= ab; 00098 00099 /* Check top bits in the second byte */ 00100 if ((*(++p) & 0xc0) != 0x80) return p - string; 00101 00102 /* Check for overlong sequences for each different length, and for the 00103 excluded range 0xd000 to 0xdfff. */ 00104 00105 switch (ab) 00106 { 00107 /* Check for xx00 000x (overlong sequence) */ 00108 00109 case 1: 00110 if ((c & 0x3e) == 0) return p - string; 00111 continue; /* We know there aren't any more bytes to check */ 00112 00113 /* Check for 1110 0000, xx0x xxxx (overlong sequence) or 00114 1110 1101, 1010 xxxx (0xd000 - 0xdfff) */ 00115 00116 case 2: 00117 if ((c == 0xe0 && (*p & 0x20) == 0) || 00118 (c == 0xed && *p >= 0xa0)) 00119 return p - string; 00120 break; 00121 00122 /* Check for 1111 0000, xx00 xxxx (overlong sequence) or 00123 greater than 0x0010ffff (f4 8f bf bf) */ 00124 00125 case 3: 00126 if ((c == 0xf0 && (*p & 0x30) == 0) || 00127 (c > 0xf4 ) || 00128 (c == 0xf4 && *p > 0x8f)) 00129 return p - string; 00130 break; 00131 00132 #if 0 00133 /* These cases can no longer occur, as we restrict to a maximum of four 00134 bytes nowadays. Leave the code here in case we ever want to add an option 00135 for longer sequences. */ 00136 00137 /* Check for 1111 1000, xx00 0xxx */ 00138 case 4: 00139 if (c == 0xf8 && (*p & 0x38) == 0) return p - string; 00140 break; 00141 00142 /* Check for leading 0xfe or 0xff, and then for 1111 1100, xx00 00xx */ 00143 case 5: 00144 if (c == 0xfe || c == 0xff || 00145 (c == 0xfc && (*p & 0x3c) == 0)) return p - string; 00146 break; 00147 #endif 00148 00149 } 00150 00151 /* Check for valid bytes after the 2nd, if any; all must start 10 */ 00152 while (--ab > 0) 00153 { 00154 if ((*(++p) & 0xc0) != 0x80) return p - string; 00155 } 00156 } 00157 #endif 00158 00159 return -1; 00160 }
|
|
||||||||||||||||||||||||
|
Definition at line 125 of file pcre_newline.cpp. References FALSE, GETCHAR, NLTYPE_ANYCRLF, and TRUE. 00127 { 00128 int c; 00129 ptr--; 00130 #ifdef SUPPORT_UTF8 00131 if (utf8) 00132 { 00133 BACKCHAR(ptr); 00134 GETCHAR(c, ptr); 00135 } 00136 else c = *ptr; 00137 #else /* no UTF-8 support */ 00138 c = *ptr; 00139 #endif /* SUPPORT_UTF8 */ 00140 00141 if (type == NLTYPE_ANYCRLF) switch(c) 00142 { 00143 case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1; 00144 return TRUE; /* LF */ 00145 case 0x000d: *lenptr = 1; return TRUE; /* CR */ 00146 default: return FALSE; 00147 } 00148 00149 else switch(c) 00150 { 00151 case 0x000a: *lenptr = (ptr > startptr && ptr[-1] == 0x0d)? 2 : 1; 00152 return TRUE; /* LF */ 00153 case 0x000b: /* VT */ 00154 case 0x000c: /* FF */ 00155 case 0x000d: *lenptr = 1; return TRUE; /* CR */ 00156 case 0x0085: *lenptr = utf8? 2 : 1; return TRUE; /* NEL */ 00157 case 0x2028: /* LS */ 00158 case 0x2029: *lenptr = 3; return TRUE; /* PS */ 00159 default: return FALSE; 00160 } 00161 }
|
|
||||||||||||
|
Definition at line 68 of file pcre_xclass.cpp. References _pcre_ucp_findprop(), FALSE, GETCHARINC, PT_ANY, PT_GC, PT_LAMP, PT_PC, PT_SC, ucp_Ll, ucp_Lt, ucp_Lu, XCL_END, XCL_MAP, XCL_NOT, XCL_PROP, XCL_RANGE, and XCL_SINGLE. 00069 { 00070 int t; 00071 BOOL negated = (*data & XCL_NOT) != 0; 00072 00073 /* Character values < 256 are matched against a bitmap, if one is present. If 00074 not, we still carry on, because there may be ranges that start below 256 in the 00075 additional data. */ 00076 00077 if (c < 256) 00078 { 00079 if ((*data & XCL_MAP) != 0 && (data[1 + c/8] & (1 << (c&7))) != 0) 00080 return !negated; /* char found */ 00081 } 00082 00083 /* First skip the bit map if present. Then match against the list of Unicode 00084 properties or large chars or ranges that end with a large char. We won't ever 00085 encounter XCL_PROP or XCL_NOTPROP when UCP support is not compiled. */ 00086 00087 if ((*data++ & XCL_MAP) != 0) data += 32; 00088 00089 while ((t = *data++) != XCL_END) 00090 { 00091 int x, y; 00092 if (t == XCL_SINGLE) 00093 { 00094 GETCHARINC(x, data); 00095 if (c == x) return !negated; 00096 } 00097 else if (t == XCL_RANGE) 00098 { 00099 GETCHARINC(x, data); 00100 GETCHARINC(y, data); 00101 if (c >= x && c <= y) return !negated; 00102 } 00103 00104 #ifdef SUPPORT_UCP 00105 else /* XCL_PROP & XCL_NOTPROP */ 00106 { 00107 int chartype, script; 00108 int category = _pcre_ucp_findprop(c, &chartype, &script); 00109 00110 switch(*data) 00111 { 00112 case PT_ANY: 00113 if (t == XCL_PROP) return !negated; 00114 break; 00115 00116 case PT_LAMP: 00117 if ((chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == 00118 (t == XCL_PROP)) return !negated; 00119 break; 00120 00121 case PT_GC: 00122 if ((data[1] == category) == (t == XCL_PROP)) return !negated; 00123 break; 00124 00125 case PT_PC: 00126 if ((data[1] == chartype) == (t == XCL_PROP)) return !negated; 00127 break; 00128 00129 case PT_SC: 00130 if ((data[1] == script) == (t == XCL_PROP)) return !negated; 00131 break; 00132 00133 /* This should never occur, but compilers may mutter if there is no 00134 default. */ 00135 00136 default: 00137 return FALSE; 00138 } 00139 00140 data += 2; 00141 } 00142 #endif /* SUPPORT_UCP */ 00143 } 00144 00145 return negated; /* char did not match */ 00146 }
|
|
||||||||||||||||
|
Definition at line 267 of file pcre_internal.h. References util::threadpool::i. 00268 { 00269 size_t i; 00270 unsigned char *dest = (unsigned char *)d; 00271 const unsigned char *src = (const unsigned char *)s; 00272 if (dest > src) 00273 { 00274 dest += n; 00275 src += n; 00276 for (i = 0; i < n; ++i) *(--dest) = *(--src); 00277 return (void *)dest; 00278 } 00279 else 00280 { 00281 for (i = 0; i < n; ++i) *dest++ = *src++; 00282 return (void *)(dest - n); 00283 } 00284 }
|
|
|
Definition at line 29 of file pcre_chartables.cpp. Referenced by pcre_compile2(), pcre_exec(), and pcre_fullinfo(). |
|
|
Definition at line 57 of file pcre_tables.cpp. |
|
|
Definition at line 70 of file pcre_tables.cpp. |
|
|
Definition at line 73 of file pcre_tables.cpp. |
|
|
Definition at line 78 of file pcre_tables.cpp. |
|
|
Definition at line 79 of file pcre_tables.cpp. |
|
|
Definition at line 84 of file pcre_tables.cpp. |
|
|
Definition at line 93 of file pcre_tables.cpp. |
|
|
Definition at line 201 of file pcre_tables.cpp. |
1.4.6