• Home
  • Raw
  • Download

Lines Matching refs:cd

49 #define NLBLOCK cd             /* Block containing newline information */
1137 find_parens_sub(uschar **ptrptr, compile_data *cd, const uschar *name, int lorn, in find_parens_sub() argument
1227 for (; ptr < cd->end_pattern; ptr++) in find_parens_sub()
1276 (cd->external_options & PCRE_JAVASCRIPT_COMPAT) == 0) in find_parens_sub()
1304 if (IS_NEWLINE(ptr)) { ptr += cd->nllen - 1; break; } in find_parens_sub()
1318 int rc = find_parens_sub(&ptr, cd, name, lorn, xmode, utf8, count); in find_parens_sub()
1370 find_parens(compile_data *cd, const uschar *name, int lorn, BOOL xmode, in find_parens() argument
1373 uschar *ptr = (uschar *)cd->start_pattern; in find_parens()
1384 rc = find_parens_sub(&ptr, cd, name, lorn, xmode, utf8, &count); in find_parens()
1488 find_fixedlength(uschar *code, int options, BOOL atend, compile_data *cd) in find_fixedlength() argument
1509 d = find_fixedlength(cc + ((op == OP_CBRA)? 2:0), options, atend, cd); in find_fixedlength()
1538 cs = ce = (uschar *)cd->start_code + GET(cc, 1); /* Start subpattern */ in find_fixedlength()
1541 d = find_fixedlength(cs + 2, options, atend, cd); in find_fixedlength()
1932 compile_data *cd) in could_be_empty_branch() argument
1969 const uschar *scode = cd->start_code + GET(code, 1); in could_be_empty_branch()
1973 if (could_be_empty_branch(scode, endcode, utf8, cd)) in could_be_empty_branch()
2003 if (!empty_branch && could_be_empty_branch(code, endcode, utf8, cd)) in could_be_empty_branch()
2184 BOOL utf8, compile_data *cd) in could_be_empty() argument
2188 if (!could_be_empty_branch(bcptr->current_branch, endcode, utf8, cd)) in could_be_empty()
2313 adjust_recurse(uschar *group, int adjust, BOOL utf8, compile_data *cd, in adjust_recurse() argument
2326 for (hc = save_hwm; hc < cd->hwm; hc += LINK_SIZE) in adjust_recurse()
2329 if (cd->start_code + offset == ptr + 1) in adjust_recurse()
2339 if (hc >= cd->hwm) in adjust_recurse()
2342 if (cd->start_code + offset >= group) PUT(ptr, 1, offset + adjust); in adjust_recurse()
2367 auto_callout(uschar *code, const uschar *ptr, compile_data *cd) in auto_callout() argument
2371 PUT(code, 0, (int)(ptr - cd->start_pattern)); /* Pattern offset */ in auto_callout()
2395 complete_callout(uschar *previous_callout, const uschar *ptr, compile_data *cd) in complete_callout() argument
2397 int length = (int)(ptr - cd->start_pattern - GET(previous_callout, 2)); in complete_callout()
2534 int options, compile_data *cd) in check_auto_possessive() argument
2545 while ((cd->ctypes[*ptr] & ctype_space) != 0) ptr++; in check_auto_possessive()
2551 if (IS_NEWLINE(ptr)) { ptr += cd->nllen; break; } in check_auto_possessive()
2568 next = check_escape(&ptr, &temperrorcode, cd->bracount, options, FALSE); in check_auto_possessive()
2573 else if ((cd->ctypes[*ptr] & ctype_meta) == 0) in check_auto_possessive()
2589 while ((cd->ctypes[*ptr] & ctype_space) != 0) ptr++; in check_auto_possessive()
2595 if (IS_NEWLINE(ptr)) { ptr += cd->nllen; break; } in check_auto_possessive()
2640 if (next < 128) othercase = cd->fcc[next]; else in check_auto_possessive()
2650 return (c != cd->fcc[next]); /* Non-UTF-8 mode */ in check_auto_possessive()
2661 if (next < 128) othercase = cd->fcc[next]; else in check_auto_possessive()
2671 return (c == cd->fcc[next]); /* Non-UTF-8 mode */ in check_auto_possessive()
2677 return next > 127 || (cd->ctypes[next] & ctype_digit) == 0; in check_auto_possessive()
2680 return next <= 127 && (cd->ctypes[next] & ctype_digit) != 0; in check_auto_possessive()
2683 return next > 127 || (cd->ctypes[next] & ctype_space) == 0; in check_auto_possessive()
2686 return next <= 127 && (cd->ctypes[next] & ctype_space) != 0; in check_auto_possessive()
2689 return next > 127 || (cd->ctypes[next] & ctype_word) == 0; in check_auto_possessive()
2692 return next <= 127 && (cd->ctypes[next] & ctype_word) != 0; in check_auto_possessive()
2770 return c > 127 || (cd->ctypes[c] & ctype_digit) == 0; in check_auto_possessive()
2773 return c <= 127 && (cd->ctypes[c] & ctype_digit) != 0; in check_auto_possessive()
2776 return c > 127 || (cd->ctypes[c] & ctype_space) == 0; in check_auto_possessive()
2779 return c <= 127 && (cd->ctypes[c] & ctype_space) != 0; in check_auto_possessive()
2782 return c > 127 || (cd->ctypes[c] & ctype_word) == 0; in check_auto_possessive()
2785 return c <= 127 && (cd->ctypes[c] & ctype_word) != 0; in check_auto_possessive()
2959 compile_data *cd, int *lengthptr) in compile_branch() argument
3067 if (code > cd->hwm) cd->hwm = code; /* High water info */ in compile_branch()
3069 if (code > cd->start_workspace + WORK_SIZE_CHECK) /* Check for overrun */ in compile_branch()
3118 else if (cd->hwm > cd->start_workspace + WORK_SIZE_CHECK) in compile_branch()
3139 complete_callout(previous_callout, ptr, cd); in compile_branch()
3145 code = auto_callout(code, ptr, cd); in compile_branch()
3162 complete_callout(previous_callout, ptr, cd); in compile_branch()
3170 if ((cd->ctypes[c] & ctype_space) != 0) continue; in compile_branch()
3176 if (IS_NEWLINE(ptr)) { ptr += cd->nllen - 1; break; } in compile_branch()
3194 code = auto_callout(code, ptr, cd); in compile_branch()
3266 if ((cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0) in compile_branch()
3316 (cd->external_options & PCRE_JAVASCRIPT_COMPAT) != 0) in compile_branch()
3402 register const uschar *cbits = cd->cbits; in compile_branch()
3503 c = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE); in compile_branch()
3520 register const uschar *cbits = cd->cbits; in compile_branch()
3741 if (c == CHAR_CR || c == CHAR_NL) cd->external_flags |= PCRE_HASCRORLF; in compile_branch()
3784 d = check_escape(&ptr, errorcodeptr, cd->bracount, options, TRUE); in compile_branch()
3812 if (d == CHAR_CR || d == CHAR_NL) cd->external_flags |= PCRE_HASCRORLF; in compile_branch()
3905 int uc = cd->fcc[c]; /* flip case */ in compile_branch()
3949 c = cd->fcc[c]; /* flip case */ in compile_branch()
4188 if (repeat_min > 1) reqbyte = c | req_caseopt | cd->req_varyopt; in compile_branch()
4198 check_auto_possessive(previous, utf8, ptr + 1, options, cd)) in compile_branch()
4219 check_auto_possessive(previous, utf8, ptr + 1, options, cd)) in compile_branch()
4243 check_auto_possessive(previous, utf8, ptr + 1, options, cd)) in compile_branch()
4510 adjust_recurse(previous, 1, utf8, cd, save_hwm); in compile_branch()
4533 adjust_recurse(previous, 2 + LINK_SIZE, utf8, cd, save_hwm); in compile_branch()
4588 uschar *this_hwm = cd->hwm; in compile_branch()
4592 PUT(cd->hwm, 0, GET(hc, 0) + len); in compile_branch()
4593 cd->hwm += LINK_SIZE; in compile_branch()
4640 uschar *this_hwm = cd->hwm; in compile_branch()
4659 PUT(cd->hwm, 0, GET(hc, 0) + len + ((i != 0)? 2+LINK_SIZE : 1)); in compile_branch()
4660 cd->hwm += LINK_SIZE; in compile_branch()
4703 if (could_be_empty_branch(scode, ketcode, utf8, cd)) in compile_branch()
4783 adjust_recurse(tempcode, 1 + LINK_SIZE, utf8, cd, save_hwm); in compile_branch()
4801 cd->req_varyopt |= reqvary; in compile_branch()
4814 save_hwm = cd->hwm; in compile_branch()
4820 ((cd->ctypes[ptr[1]] & ctype_letter) != 0 || ptr[1] == ':')) in compile_branch()
4828 while ((cd->ctypes[*++ptr] & ctype_letter) != 0) {}; in compile_branch()
4834 while ((cd->ctypes[*ptr] & (ctype_letter|ctype_digit)) != 0 in compile_branch()
4857 cd->had_accept = TRUE; in compile_branch()
4858 for (oc = cd->open_caps; oc != NULL; oc = oc->next) in compile_branch()
5009 if ((cd->ctypes[ptr[1]] & ctype_word) == 0) in compile_branch()
5020 while ((cd->ctypes[*ptr] & ctype_word) != 0) in compile_branch()
5053 cd->bracount - recno + 1 : recno +cd->bracount; in compile_branch()
5054 if (recno <= 0 || recno > cd->final_bracount) in compile_branch()
5069 slot = cd->name_table; in compile_branch()
5070 for (i = 0; i < cd->names_found; i++) in compile_branch()
5073 slot += cd->name_entry_size; in compile_branch()
5078 if (i < cd->names_found) in compile_branch()
5087 else if ((i = find_parens(cd, name, namelen, in compile_branch()
5138 else if (recno > 0 && recno <= cd->final_bracount) in compile_branch()
5188 if ((cd->ctypes[ptr[1]] & ctype_word) != 0) goto DEFINE_NAME; in compile_branch()
5223 PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */ in compile_branch()
5256 while ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++; in compile_branch()
5268 if (cd->names_found >= MAX_NAME_COUNT) in compile_branch()
5273 if (namelen + 3 > cd->name_entry_size) in compile_branch()
5275 cd->name_entry_size = namelen + 3; in compile_branch()
5300 slot = cd->name_table; in compile_branch()
5302 for (i = 0; i < cd->names_found; i++) in compile_branch()
5309 if (GET2(slot, 0) != cd->bracount + 1 && in compile_branch()
5327 memmove(slot + cd->name_entry_size, slot, in compile_branch()
5328 (cd->names_found - i) * cd->name_entry_size); in compile_branch()
5334 slot += cd->name_entry_size; in compile_branch()
5342 uschar *cslot = cd->name_table; in compile_branch()
5343 for (i = 0; i < cd->names_found; i++) in compile_branch()
5347 if (GET2(cslot, 0) == cd->bracount + 1) in compile_branch()
5354 cslot += cd->name_entry_size; in compile_branch()
5358 PUT2(slot, 0, cd->bracount + 1); in compile_branch()
5367 cd->names_found++; in compile_branch()
5386 while ((cd->ctypes[*ptr] & ctype_word) != 0) ptr++; in compile_branch()
5425 temp = cd->end_pattern; in compile_branch()
5426 cd->end_pattern = ptr; in compile_branch()
5427 recno = find_parens(cd, name, namelen, in compile_branch()
5429 cd->end_pattern = temp; in compile_branch()
5440 slot = cd->name_table; in compile_branch()
5441 for (i = 0; i < cd->names_found; i++) in compile_branch()
5446 slot += cd->name_entry_size; in compile_branch()
5449 if (i < cd->names_found) /* Back reference */ in compile_branch()
5454 find_parens(cd, name, namelen, in compile_branch()
5524 recno = cd->bracount - recno + 1; in compile_branch()
5538 recno += cd->bracount; in compile_branch()
5546 called = cd->start_code; in compile_branch()
5559 called = _pcre_find_bracket(cd->start_code, utf8, recno); in compile_branch()
5565 if (find_parens(cd, NULL, recno, in compile_branch()
5576 called = cd->start_code + recno; in compile_branch()
5577 PUTINC(cd->hwm, 0, (int)(code + 2 + LINK_SIZE - cd->start_code)); in compile_branch()
5585 could_be_empty(called, code, bcptr, utf8, cd)) in compile_branch()
5601 PUT(code, 1, (int)(called - cd->start_code)); in compile_branch()
5631 cd->external_flags |= PCRE_JCHANGED; in compile_branch()
5675 if (code == cd->start_code + 1 + LINK_SIZE && in compile_branch()
5678 cd->external_options = newoptions; in compile_branch()
5726 cd->bracount += 1; in compile_branch()
5727 PUT2(code, 1+LINK_SIZE, cd->bracount); in compile_branch()
5740 tempreqvary = cd->req_varyopt; /* Save value before bracket */ in compile_branch()
5756 cd, /* Tables block */ in compile_branch()
5914 c = check_escape(&ptr, errorcodeptr, cd->bracount, options, FALSE); in compile_branch()
5950 save_hwm = cd->hwm; /* Normally this is set when '(' is read */ in compile_branch()
5969 if ((cd->ctypes[*p] & ctype_digit) == 0) isnumber = FALSE; in compile_branch()
5970 if ((cd->ctypes[*p] & ctype_word) == 0) break; in compile_branch()
6026 cd->backref_map |= (recno < 32)? (1 << recno) : 1; in compile_branch()
6027 if (recno > cd->top_backref) cd->top_backref = recno; in compile_branch()
6033 for (oc = cd->open_caps; oc != NULL; oc = oc->next) in compile_branch()
6138 cd->external_flags |= PCRE_HASCRORLF; in compile_branch()
6156 if (mclength != 1) reqbyte = code[-1] | cd->req_varyopt; in compile_branch()
6169 reqbyte = code[-1] | req_caseopt | cd->req_varyopt; in compile_branch()
6227 int *firstbyteptr, int *reqbyteptr, branch_chain *bcptr, compile_data *cd, in compile_regex() argument
6242 int old_external_options = cd->external_options; in compile_regex()
6272 capitem.next = cd->open_caps; in compile_regex()
6274 cd->open_caps = &capitem; in compile_regex()
6284 orig_bracount = max_bracount = cd->bracount; in compile_regex()
6290 if (reset_bracount) cd->bracount = orig_bracount; in compile_regex()
6315 &branchreqbyte, &bc, cd, (lengthptr == NULL)? NULL : &length)) in compile_regex()
6327 if (old_external_options != cd->external_options) in compile_regex()
6328 oldims = cd->external_options & PCRE_IMS; in compile_regex()
6333 if (cd->bracount > max_bracount) max_bracount = cd->bracount; in compile_regex()
6390 fixed_length = find_fixedlength(last_branch, options, FALSE, cd); in compile_regex()
6394 cd->check_lookbehind = TRUE; in compile_regex()
6442 if (cd->open_caps->flag) in compile_regex()
6454 cd->open_caps = cd->open_caps->next; in compile_regex()
6468 cd->bracount = max_bracount; in compile_regex()
6830 compile_data *cd = &compile_block; in pcre_compile2() local
6870 cd->lcc = tables + lcc_offset; in pcre_compile2()
6871 cd->fcc = tables + fcc_offset; in pcre_compile2()
6872 cd->cbits = tables + cbits_offset; in pcre_compile2()
6873 cd->ctypes = tables + ctypes_offset; in pcre_compile2()
6980 cd->nltype = NLTYPE_ANYCRLF; in pcre_compile2()
6984 cd->nltype = NLTYPE_ANY; in pcre_compile2()
6988 cd->nltype = NLTYPE_FIXED; in pcre_compile2()
6991 cd->nllen = 2; in pcre_compile2()
6992 cd->nl[0] = (newline >> 8) & 255; in pcre_compile2()
6993 cd->nl[1] = newline & 255; in pcre_compile2()
6997 cd->nllen = 1; in pcre_compile2()
6998 cd->nl[0] = newline; in pcre_compile2()
7006 cd->top_backref = 0; in pcre_compile2()
7007 cd->backref_map = 0; in pcre_compile2()
7021 cd->bracount = cd->final_bracount = 0; in pcre_compile2()
7022 cd->names_found = 0; in pcre_compile2()
7023 cd->name_entry_size = 0; in pcre_compile2()
7024 cd->name_table = NULL; in pcre_compile2()
7025 cd->start_workspace = cworkspace; in pcre_compile2()
7026 cd->start_code = cworkspace; in pcre_compile2()
7027 cd->hwm = cworkspace; in pcre_compile2()
7028 cd->start_pattern = (const uschar *)pattern; in pcre_compile2()
7029 cd->end_pattern = (const uschar *)(pattern + strlen(pattern)); in pcre_compile2()
7030 cd->req_varyopt = 0; in pcre_compile2()
7031 cd->external_options = options; in pcre_compile2()
7032 cd->external_flags = 0; in pcre_compile2()
7033 cd->open_caps = NULL; in pcre_compile2()
7044 (void)compile_regex(cd->external_options, cd->external_options & PCRE_IMS, in pcre_compile2()
7045 &code, &ptr, &errorcode, FALSE, FALSE, 0, &firstbyte, &reqbyte, NULL, cd, in pcre_compile2()
7050 cd->hwm - cworkspace)); in pcre_compile2()
7063 size = length + sizeof(real_pcre) + cd->names_found * (cd->name_entry_size + 3); in pcre_compile2()
7080 re->options = cd->external_options; in pcre_compile2()
7081 re->flags = cd->external_flags; in pcre_compile2()
7086 re->name_entry_size = cd->name_entry_size; in pcre_compile2()
7087 re->name_count = cd->names_found; in pcre_compile2()
7099 cd->final_bracount = cd->bracount; /* Save for checking forward references */ in pcre_compile2()
7100 cd->bracount = 0; in pcre_compile2()
7101 cd->names_found = 0; in pcre_compile2()
7102 cd->name_table = (uschar *)re + re->name_table_offset; in pcre_compile2()
7103 codestart = cd->name_table + re->name_entry_size * re->name_count; in pcre_compile2()
7104 cd->start_code = codestart; in pcre_compile2()
7105 cd->hwm = cworkspace; in pcre_compile2()
7106 cd->req_varyopt = 0; in pcre_compile2()
7107 cd->had_accept = FALSE; in pcre_compile2()
7108 cd->check_lookbehind = FALSE; in pcre_compile2()
7109 cd->open_caps = NULL; in pcre_compile2()
7119 &errorcode, FALSE, FALSE, 0, &firstbyte, &reqbyte, NULL, cd, NULL); in pcre_compile2()
7120 re->top_bracket = cd->bracount; in pcre_compile2()
7121 re->top_backref = cd->top_backref; in pcre_compile2()
7122 re->flags = cd->external_flags; in pcre_compile2()
7124 if (cd->had_accept) reqbyte = -1; /* Must disable after (*ACCEPT) */ in pcre_compile2()
7141 while (errorcode == 0 && cd->hwm > cworkspace) in pcre_compile2()
7145 cd->hwm -= LINK_SIZE; in pcre_compile2()
7146 offset = GET(cd->hwm, 0); in pcre_compile2()
7166 if (cd->check_lookbehind) in pcre_compile2()
7185 fixed_length = find_fixedlength(cc, re->options, TRUE, cd); in pcre_compile2()
7225 if (is_anchored(codestart, &temp_options, 0, cd->backref_map)) in pcre_compile2()
7235 cd->fcc[ch] == ch)? ch : firstbyte; in pcre_compile2()
7238 else if (is_startline(codestart, 0, cd->backref_map)) in pcre_compile2()
7252 cd->fcc[ch] == ch)? (reqbyte & ~REQ_CASELESS) : reqbyte; in pcre_compile2()