Lines Matching refs:bufp

725 print_compiled_pattern (bufp)
726 struct re_pattern_buffer *bufp;
728 unsigned char *buffer = bufp->buffer;
730 print_partial_compiled_pattern (buffer, buffer + bufp->used);
731 printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
733 if (bufp->fastmap_accurate && bufp->fastmap)
736 print_fastmap (bufp->fastmap);
739 printf ("re_nsub: %d\t", bufp->re_nsub);
740 printf ("regs_alloc: %d\t", bufp->regs_allocated);
741 printf ("can_be_null: %d\t", bufp->can_be_null);
742 printf ("newline_anchor: %d\n", bufp->newline_anchor);
743 printf ("no_sub: %d\t", bufp->no_sub);
744 printf ("not_bol: %d\t", bufp->not_bol);
745 printf ("not_eol: %d\t", bufp->not_eol);
746 printf ("syntax: %d\n", bufp->syntax);
885 while (b - bufp->buffer + (n) > bufp->allocated) \
945 unsigned char *old_buffer = bufp->buffer; \
946 if (bufp->allocated == MAX_BUF_SIZE) \
948 bufp->allocated <<= 1; \
949 if (bufp->allocated > MAX_BUF_SIZE) \
950 bufp->allocated = MAX_BUF_SIZE; \
951 bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated);\
952 if (bufp->buffer == NULL) \
955 if (old_buffer != bufp->buffer) \
957 b = (b - old_buffer) + bufp->buffer; \
958 begalt = (begalt - old_buffer) + bufp->buffer; \
960 fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
962 laststart = (laststart - old_buffer) + bufp->buffer; \
964 pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
1065 regex_compile (pattern, size, syntax, bufp)
1069 struct re_pattern_buffer *bufp;
1090 char *translate = bufp->translate;
1141 bufp->syntax = syntax;
1142 bufp->fastmap_accurate = 0;
1143 bufp->not_bol = bufp->not_eol = 0;
1148 bufp->used = 0;
1150 /* Always count groups, whether or not bufp->no_sub is set. */
1151 bufp->re_nsub = 0;
1158 if (bufp->allocated == 0)
1160 if (bufp->buffer)
1164 RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
1168 bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
1170 if (!bufp->buffer) return REG_ESPACE;
1172 bufp->allocated = INIT_BUF_SIZE;
1175 begalt = b = bufp->buffer;
1582 bufp->re_nsub++;
1598 COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
1600 = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
1601 COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
1610 COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
1665 begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
1668 ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
1670 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
1682 = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
2048 bufp->used = b - bufp->buffer;
2054 print_compiled_pattern (bufp);
2418 DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
2463 Also assumes the variables `fail_stack' and (if debugging), `bufp',
2497 DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
2538 re_compile_fastmap (bufp)
2539 struct re_pattern_buffer *bufp;
2549 register char *fastmap = bufp->fastmap;
2550 unsigned char *pattern = bufp->buffer;
2551 unsigned long size = bufp->used;
2568 bufp->fastmap_accurate = 1; /* It will be when we're done. */
2569 bufp->can_be_null = 0;
2575 bufp->can_be_null |= path_can_be_null;
2599 bufp->can_be_null = 1;
2649 if (!(bufp->syntax & RE_DOT_NEWLINE))
2654 else if (bufp->can_be_null)
2752 bufp->can_be_null = 1;
2805 bufp->can_be_null |= path_can_be_null;
2824 re_set_registers (bufp, regs, num_regs, starts, ends)
2825 struct re_pattern_buffer *bufp;
2832 bufp->regs_allocated = REGS_REALLOCATE;
2839 bufp->regs_allocated = REGS_UNALLOCATED;
2852 re_search (bufp, string, size, startpos, range, regs)
2853 struct re_pattern_buffer *bufp;
2858 return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
2885 re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
2886 struct re_pattern_buffer *bufp;
2895 register char *fastmap = bufp->fastmap;
2896 register char *translate = bufp->translate;
2913 if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
2922 if (fastmap && !bufp->fastmap_accurate)
2923 if (re_compile_fastmap (bufp) == -2)
2933 if (fastmap && startpos < total_size && !bufp->can_be_null)
2972 && !bufp->can_be_null)
2975 val = re_match_2 (bufp, string1, size1, string2, size2,
3146 re_match (bufp, string, size, pos, regs)
3147 struct re_pattern_buffer *bufp;
3152 return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
3171 re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
3172 struct re_pattern_buffer *bufp;
3194 unsigned char *p = bufp->buffer;
3195 register unsigned char *pend = p + bufp->used;
3198 char *translate = bufp->translate;
3218 unsigned num_regs = bufp->re_nsub + 1;
3283 if (bufp->re_nsub)
3376 DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
3448 if (regs && !bufp->no_sub)
3451 if (bufp->regs_allocated == REGS_UNALLOCATED)
3460 bufp->regs_allocated = REGS_REALLOCATE;
3462 else if (bufp->regs_allocated == REGS_REALLOCATE)
3476 assert (bufp->regs_allocated == REGS_FIXED);
3508 } /* regs && !bufp->no_sub */
3577 if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
3578 || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
3855 (unless `not_bol' is set in `bufp'), and, if
3862 if (!bufp->not_bol) break;
3864 else if (d[-1] == '\n' && bufp->newline_anchor)
3878 if (!bufp->not_eol) break;
3883 && bufp->newline_anchor)
4024 || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
4629 re_compile_pattern (pattern, length, bufp)
4632 struct re_pattern_buffer *bufp;
4638 bufp->regs_allocated = REGS_UNALLOCATED;
4643 bufp->no_sub = 0;
4646 bufp->newline_anchor = 1;
4648 ret = regex_compile (pattern, length, re_syntax_options, bufp);