Home | History | Annotate | Download | only in pcre

Lines Matching refs:cd

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