Lines Matching refs:mb

79 #define NLBLOCK mb             /* Block containing newline information */
356 PCRE2_SPTR ptr, dfa_match_block *mb, PCRE2_SIZE extracode, in do_callout_dfa() argument
359 pcre2_callout_block *cb = mb->cb; in do_callout_dfa()
365 if (mb->callout == NULL) return 0; /* No callout provided */ in do_callout_dfa()
371 cb->start_match = (PCRE2_SIZE)(current_subject - mb->start_subject); in do_callout_dfa()
372 cb->current_position = (PCRE2_SIZE)(ptr - mb->start_subject); in do_callout_dfa()
391 return (mb->callout)(cb, mb->callout_data); in do_callout_dfa()
415 more_workspace(RWS_anchor **rwsptr, unsigned int ovecsize, dfa_match_block *mb) in more_workspace() argument
434 if (newsizeK + mb->heap_used > mb->heap_limit) in more_workspace()
435 newsizeK = (uint32_t)(mb->heap_limit - mb->heap_used); in more_workspace()
440 new = mb->memctl.malloc(newsize*sizeof(int), mb->memctl.memory_data); in more_workspace()
442 mb->heap_used += newsizeK; in more_workspace()
525 dfa_match_block *mb, in internal_dfa_match() argument
547 PCRE2_SPTR start_subject = mb->start_subject; in internal_dfa_match()
548 PCRE2_SPTR end_subject = mb->end_subject; in internal_dfa_match()
549 PCRE2_SPTR start_code = mb->start_code; in internal_dfa_match()
552 BOOL utf = (mb->poptions & PCRE2_UTF) != 0; in internal_dfa_match()
553 BOOL utf_or_ucp = utf || (mb->poptions & PCRE2_UCP) != 0; in internal_dfa_match()
560 if (mb->match_call_count++ >= mb->match_limit) return PCRE2_ERROR_MATCHLIMIT; in internal_dfa_match()
561 if (rlevel++ > mb->match_limit_depth) return PCRE2_ERROR_DEPTHLIMIT; in internal_dfa_match()
568 ctypes = mb->tables + ctypes_offset; in internal_dfa_match()
569 lcc = mb->tables + lcc_offset; in internal_dfa_match()
570 fcc = mb->tables + fcc_offset; in internal_dfa_match()
629 if (current_subject < mb->start_used_ptr) in internal_dfa_match()
630 mb->start_used_ptr = current_subject; in internal_dfa_match()
662 if (rlevel == 1 && (mb->moptions & PCRE2_DFA_RESTART) != 0) in internal_dfa_match()
703 if (ptr > mb->last_used_ptr) mb->last_used_ptr = ptr; in internal_dfa_match()
884 ((mb->moptions & PCRE2_NOTEMPTY) == 0 && in internal_dfa_match()
885 ((mb->moptions & PCRE2_NOTEMPTY_ATSTART) == 0 || in internal_dfa_match()
886 current_subject > start_subject + mb->start_offset))) in internal_dfa_match()
899 if ((mb->moptions & PCRE2_DFA_SHORTEST) != 0) return match_count; in internal_dfa_match()
955 if (ptr == start_subject && (mb->moptions & PCRE2_NOTBOL) == 0) in internal_dfa_match()
961 if ((ptr == start_subject && (mb->moptions & PCRE2_NOTBOL) == 0) || in internal_dfa_match()
962 ((ptr != end_subject || (mb->poptions & PCRE2_ALT_CIRCUMFLEX) != 0 ) in internal_dfa_match()
971 if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
998 if (ptr + 1 >= mb->end_subject && in internal_dfa_match()
999 (mb->moptions & (PCRE2_PARTIAL_HARD)) != 0 && in internal_dfa_match()
1021 if (clen == 0 || (IS_NEWLINE(ptr) && ptr == end_subject - mb->nllen)) in internal_dfa_match()
1023 if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
1031 if ((mb->moptions & PCRE2_NOTEOL) == 0) in internal_dfa_match()
1033 if (clen == 0 && (mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
1036 ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr) && in internal_dfa_match()
1037 (ptr == end_subject - mb->nllen) in internal_dfa_match()
1040 else if (ptr + 1 >= mb->end_subject && in internal_dfa_match()
1041 (mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0 && in internal_dfa_match()
1046 if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
1058 if ((mb->moptions & PCRE2_NOTEOL) == 0) in internal_dfa_match()
1060 if (clen == 0 && (mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
1063 ((mb->poptions & PCRE2_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr))) in internal_dfa_match()
1065 else if (ptr + 1 >= mb->end_subject && in internal_dfa_match()
1066 (mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) != 0 && in internal_dfa_match()
1071 if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
1113 if (temp < mb->start_used_ptr) mb->start_used_ptr = temp; in internal_dfa_match()
1135 if (ptr >= mb->last_used_ptr) in internal_dfa_match()
1139 if (utf) { FORWARDCHARTEST(temp, mb->end_subject); } in internal_dfa_match()
1141 mb->last_used_ptr = temp; in internal_dfa_match()
1301 if (d == OP_ANY && ptr + 1 >= mb->end_subject && in internal_dfa_match()
1302 (mb->moptions & (PCRE2_PARTIAL_HARD)) != 0 && in internal_dfa_match()
1332 if (d == OP_ANY && ptr + 1 >= mb->end_subject && in internal_dfa_match()
1333 (mb->moptions & (PCRE2_PARTIAL_HARD)) != 0 && in internal_dfa_match()
1362 if (d == OP_ANY && ptr + 1 >= mb->end_subject && in internal_dfa_match()
1363 (mb->moptions & (PCRE2_PARTIAL_HARD)) != 0 && in internal_dfa_match()
1390 if (d == OP_ANY && ptr + 1 >= mb->end_subject && in internal_dfa_match()
1391 (mb->moptions & (PCRE2_PARTIAL_HARD)) != 0 && in internal_dfa_match()
1419 if (d == OP_ANY && ptr + 1 >= mb->end_subject && in internal_dfa_match()
1420 (mb->moptions & (PCRE2_PARTIAL_HARD)) != 0 && in internal_dfa_match()
1590 (void)PRIV(extuni)(c, ptr + clen, mb->start_subject, end_subject, utf, in internal_dfa_match()
1616 if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break; in internal_dfa_match()
1865 (void)PRIV(extuni)(c, ptr + clen, mb->start_subject, end_subject, utf, in internal_dfa_match()
1898 if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break; in internal_dfa_match()
2151 nptr = PRIV(extuni)(c, ptr + clen, mb->start_subject, end_subject, utf, in internal_dfa_match()
2153 if (nptr >= end_subject && (mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
2183 if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break; in internal_dfa_match()
2330 PCRE2_SPTR nptr = PRIV(extuni)(c, ptr + clen, mb->start_subject, in internal_dfa_match()
2332 if (nptr >= end_subject && (mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
2354 if (mb->bsr_convention == PCRE2_BSR_ANYCRLF) break; in internal_dfa_match()
2365 if ((mb->moptions & PCRE2_PARTIAL_HARD) != 0) in internal_dfa_match()
2803 rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); in internal_dfa_match()
2815 mb, /* static match data */ in internal_dfa_match()
2849 rrc = do_callout_dfa(code, offsets, current_subject, ptr, mb, in internal_dfa_match()
2884 if (mb->recursive != NULL) in internal_dfa_match()
2902 rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); in internal_dfa_match()
2914 mb, /* fixed match data */ in internal_dfa_match()
2945 uint32_t recno = (callpat == mb->start_code)? 0 : in internal_dfa_match()
2950 rc = more_workspace(&rws, RWS_OVEC_RSIZE, mb); in internal_dfa_match()
2963 for (dfa_recursion_info *ri = mb->recursive; in internal_dfa_match()
2968 mb->last_used_ptr == ri->last_used_ptr) in internal_dfa_match()
2977 new_recursive.last_used_ptr = mb->last_used_ptr; in internal_dfa_match()
2978 new_recursive.prevrec = mb->recursive; in internal_dfa_match()
2979 mb->recursive = &new_recursive; in internal_dfa_match()
2982 mb, /* fixed match data */ in internal_dfa_match()
2994 mb->recursive = new_recursive.prevrec; /* Done this recursion */ in internal_dfa_match()
3049 rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); in internal_dfa_match()
3071 mb, /* fixed match data */ in internal_dfa_match()
3148 rc = more_workspace(&rws, RWS_OVEC_OSIZE, mb); in internal_dfa_match()
3158 mb, /* fixed match data */ in internal_dfa_match()
3251 rrc = do_callout_dfa(code, offsets, current_subject, ptr, mb, 0, in internal_dfa_match()
3287 (mb->moptions & PCRE2_PARTIAL_HARD) != 0 /* Hard partial */ in internal_dfa_match()
3289 ((mb->moptions & PCRE2_PARTIAL_SOFT) != 0 && /* Soft partial and */ in internal_dfa_match()
3297 ptr > mb->start_used_ptr || /* Inspected non-empty string */ in internal_dfa_match()
3298 mb->allowemptypartial /* or pattern has lookbehind */ in internal_dfa_match()
3315 ((mb->moptions | mb->poptions) & PCRE2_ENDANCHORED) != 0 && in internal_dfa_match()
3384 dfa_match_block *mb = &actual_match_block; in pcre2_dfa_match() local
3485 mb->cb = &cb; in pcre2_dfa_match()
3500 mb->callout = NULL; in pcre2_dfa_match()
3501 mb->memctl = re->memctl; in pcre2_dfa_match()
3502 mb->match_limit = PRIV(default_match_context).match_limit; in pcre2_dfa_match()
3503 mb->match_limit_depth = PRIV(default_match_context).depth_limit; in pcre2_dfa_match()
3504 mb->heap_limit = PRIV(default_match_context).heap_limit; in pcre2_dfa_match()
3514 mb->callout = mcontext->callout; in pcre2_dfa_match()
3515 mb->callout_data = mcontext->callout_data; in pcre2_dfa_match()
3516 mb->memctl = mcontext->memctl; in pcre2_dfa_match()
3517 mb->match_limit = mcontext->match_limit; in pcre2_dfa_match()
3518 mb->match_limit_depth = mcontext->depth_limit; in pcre2_dfa_match()
3519 mb->heap_limit = mcontext->heap_limit; in pcre2_dfa_match()
3522 if (mb->match_limit > re->limit_match) in pcre2_dfa_match()
3523 mb->match_limit = re->limit_match; in pcre2_dfa_match()
3525 if (mb->match_limit_depth > re->limit_depth) in pcre2_dfa_match()
3526 mb->match_limit_depth = re->limit_depth; in pcre2_dfa_match()
3528 if (mb->heap_limit > re->limit_heap) in pcre2_dfa_match()
3529 mb->heap_limit = re->limit_heap; in pcre2_dfa_match()
3531 mb->start_code = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)) + in pcre2_dfa_match()
3533 mb->tables = re->tables; in pcre2_dfa_match()
3534 mb->start_subject = subject; in pcre2_dfa_match()
3535 mb->end_subject = end_subject; in pcre2_dfa_match()
3536 mb->start_offset = start_offset; in pcre2_dfa_match()
3537 mb->allowemptypartial = (re->max_lookbehind > 0) || in pcre2_dfa_match()
3539 mb->moptions = options; in pcre2_dfa_match()
3540 mb->poptions = re->overall_options; in pcre2_dfa_match()
3541 mb->match_call_count = 0; in pcre2_dfa_match()
3542 mb->heap_used = 0; in pcre2_dfa_match()
3546 mb->bsr_convention = re->bsr_convention; in pcre2_dfa_match()
3547 mb->nltype = NLTYPE_FIXED; in pcre2_dfa_match()
3551 mb->nllen = 1; in pcre2_dfa_match()
3552 mb->nl[0] = CHAR_CR; in pcre2_dfa_match()
3556 mb->nllen = 1; in pcre2_dfa_match()
3557 mb->nl[0] = CHAR_NL; in pcre2_dfa_match()
3561 mb->nllen = 1; in pcre2_dfa_match()
3562 mb->nl[0] = CHAR_NUL; in pcre2_dfa_match()
3566 mb->nllen = 2; in pcre2_dfa_match()
3567 mb->nl[0] = CHAR_CR; in pcre2_dfa_match()
3568 mb->nl[1] = CHAR_NL; in pcre2_dfa_match()
3572 mb->nltype = NLTYPE_ANY; in pcre2_dfa_match()
3576 mb->nltype = NLTYPE_ANYCRLF; in pcre2_dfa_match()
3640 first_cu2 = TABLE_GET(first_cu, mb->tables + fcc_offset, first_cu); in pcre2_dfa_match()
3664 req_cu2 = TABLE_GET(req_cu, mb->tables + fcc_offset, req_cu); in pcre2_dfa_match()
3855 if ((mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) == 0 && in pcre2_dfa_match()
3856 start_match >= mb->end_subject) in pcre2_dfa_match()
3865 if (start_match > mb->start_subject + start_offset) in pcre2_dfa_match()
3886 (mb->nltype == NLTYPE_ANY || mb->nltype == NLTYPE_ANYCRLF) && in pcre2_dfa_match()
3912 if ((mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) == 0 && in pcre2_dfa_match()
3913 start_match >= mb->end_subject) in pcre2_dfa_match()
3920 end_subject = mb->end_subject; in pcre2_dfa_match()
3924 if ((mb->moptions & (PCRE2_PARTIAL_HARD|PCRE2_PARTIAL_SOFT)) == 0) in pcre2_dfa_match()
4023 mb->start_used_ptr = start_match; in pcre2_dfa_match()
4024 mb->last_used_ptr = start_match; in pcre2_dfa_match()
4025 mb->recursive = NULL; in pcre2_dfa_match()
4028 mb, /* fixed match data */ in pcre2_dfa_match()
4029 mb->start_code, /* this subexpression's code */ in pcre2_dfa_match()
4050 match_data->leftchar = (PCRE2_SIZE)(mb->start_used_ptr - subject); in pcre2_dfa_match()
4051 match_data->rightchar = (PCRE2_SIZE)(mb->last_used_ptr - subject); in pcre2_dfa_match()
4092 (mb->nltype == NLTYPE_ANY || in pcre2_dfa_match()
4093 mb->nltype == NLTYPE_ANYCRLF || in pcre2_dfa_match()
4094 mb->nllen == 2)) in pcre2_dfa_match()
4107 mb->memctl.free(next, mb->memctl.memory_data); in pcre2_dfa_match()