Lines Matching refs:bufp

844 print_compiled_pattern (bufp)
845 struct re_pattern_buffer *bufp;
847 unsigned char *buffer = bufp->buffer;
849 print_partial_compiled_pattern (buffer, buffer + bufp->used);
850 printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
852 if (bufp->fastmap_accurate && bufp->fastmap)
855 print_fastmap (bufp->fastmap);
858 printf ("re_nsub: %d\t", bufp->re_nsub);
859 printf ("regs_alloc: %d\t", bufp->regs_allocated);
860 printf ("can_be_null: %d\t", bufp->can_be_null);
861 printf ("newline_anchor: %d\n", bufp->newline_anchor);
862 printf ("no_sub: %d\t", bufp->no_sub);
863 printf ("not_bol: %d\t", bufp->not_bol);
864 printf ("not_eol: %d\t", bufp->not_eol);
865 printf ("syntax: %d\n", bufp->syntax);
1212 DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
1262 Also assumes the variables `fail_stack' and (if debugging), `bufp',
1296 DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
1443 while (b - bufp->buffer + (n) > bufp->allocated) \
1503 unsigned char *old_buffer = bufp->buffer; \
1504 if (bufp->allocated == MAX_BUF_SIZE) \
1506 bufp->allocated <<= 1; \
1507 if (bufp->allocated > MAX_BUF_SIZE) \
1508 bufp->allocated = MAX_BUF_SIZE; \
1509 bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\
1510 if (bufp->buffer == NULL) \
1513 if (old_buffer != bufp->buffer) \
1515 b = (b - old_buffer) + bufp->buffer; \
1516 begalt = (begalt - old_buffer) + bufp->buffer; \
1518 fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
1520 laststart = (laststart - old_buffer) + bufp->buffer; \
1522 pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
1676 regex_compile (pattern, size, syntax, bufp)
1680 struct re_pattern_buffer *bufp;
1701 RE_TRANSLATE_TYPE translate = bufp->translate;
1752 bufp->syntax = syntax;
1753 bufp->fastmap_accurate = 0;
1754 bufp->not_bol = bufp->not_eol = 0;
1759 bufp->used = 0;
1761 /* Always count groups, whether or not bufp->no_sub is set. */
1762 bufp->re_nsub = 0;
1769 if (bufp->allocated == 0)
1771 if (bufp->buffer)
1775 RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
1779 bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
1781 if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE);
1783 bufp->allocated = INIT_BUF_SIZE;
1786 begalt = b = bufp->buffer;
2199 bufp->re_nsub++;
2215 COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
2217 = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
2218 COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
2227 COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
2286 begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
2289 ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
2291 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
2303 = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
2674 bufp->used = b - bufp->buffer;
2680 print_compiled_pattern (bufp);
2689 int num_regs = bufp->re_nsub + 1;
2931 re_compile_fastmap (bufp)
2932 struct re_pattern_buffer *bufp;
2944 register char *fastmap = bufp->fastmap;
2945 unsigned char *pattern = bufp->buffer;
2946 unsigned long size = bufp->used;
2969 bufp->fastmap_accurate = 1; /* It will be when we're done. */
2970 bufp->can_be_null = 0;
2979 bufp->can_be_null |= path_can_be_null;
3004 bufp->can_be_null = 1;
3057 if (!(bufp->syntax & RE_DOT_NEWLINE))
3062 else if (bufp->can_be_null)
3163 bufp->can_be_null = 1;
3216 bufp->can_be_null |= path_can_be_null;
3238 re_set_registers (bufp, regs, num_regs, starts, ends)
3239 struct re_pattern_buffer *bufp;
3246 bufp->regs_allocated = REGS_REALLOCATE;
3253 bufp->regs_allocated = REGS_UNALLOCATED;
3266 re_search (bufp, string, size, startpos, range, regs)
3267 struct re_pattern_buffer *bufp;
3272 return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
3299 re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
3300 struct re_pattern_buffer *bufp;
3309 register char *fastmap = bufp->fastmap;
3310 register RE_TRANSLATE_TYPE translate = bufp->translate;
3329 if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
3340 if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0)
3349 if (fastmap && !bufp->fastmap_accurate)
3350 if (re_compile_fastmap (bufp) == -2)
3354 if (bufp->buffer[0] == begline)
3366 if (! (bufp->newline_anchor
3377 if (fastmap && startpos < total_size && !bufp->can_be_null)
3416 && !bufp->can_be_null)
3419 val = re_match_2_internal (bufp, string1, size1, string2, size2,
3544 re_match (bufp, string, size, pos, regs)
3545 struct re_pattern_buffer *bufp;
3550 int result = re_match_2_internal (bufp, NULL, 0, string, size,
3572 re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
3573 struct re_pattern_buffer *bufp;
3580 int result = re_match_2_internal (bufp, string1, size1, string2, size2,
3589 re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
3590 struct re_pattern_buffer *bufp;
3612 unsigned char *p = bufp->buffer;
3613 register unsigned char *pend = p + bufp->used;
3620 RE_TRANSLATE_TYPE translate = bufp->translate;
3648 unsigned num_regs = bufp->re_nsub + 1;
3727 if (bufp->re_nsub)
3819 DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
3904 if (regs && !bufp->no_sub)
3907 if (bufp->regs_allocated == REGS_UNALLOCATED)
3919 bufp->regs_allocated = REGS_REALLOCATE;
3921 else if (bufp->regs_allocated == REGS_REALLOCATE)
3941 assert (bufp->regs_allocated == REGS_FIXED);
3977 } /* regs && !bufp->no_sub */
4046 if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
4047 || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
4335 (unless `not_bol' is set in `bufp'), and, if
4342 if (!bufp->not_bol) break;
4344 else if (d[-1] == '\n' && bufp->newline_anchor)
4358 if (!bufp->not_eol) break;
4363 && bufp->newline_anchor)
4520 || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
5206 re_compile_pattern (pattern, length, bufp)
5209 struct re_pattern_buffer *bufp;
5215 bufp->regs_allocated = REGS_UNALLOCATED;
5220 bufp->no_sub = 0;
5223 bufp->newline_anchor = 1;
5225 ret = regex_compile (pattern, length, re_syntax_options, bufp);