|
@@ -213,12 +213,8 @@ static reg_errcode_t extend_buffers (re_match_context_t *mctx)
|
|
We return 0 if we find a match and REG_NOMATCH if not. */
|
|
We return 0 if we find a match and REG_NOMATCH if not. */
|
|
|
|
|
|
int
|
|
int
|
|
-regexec (preg, string, nmatch, pmatch, eflags)
|
|
+regexec (const regex_t *__restrict preg, const char *__restrict string,
|
|
- const regex_t *__restrict preg;
|
|
+ size_t nmatch, regmatch_t pmatch[], int eflags)
|
|
- const char *__restrict string;
|
|
|
|
- size_t nmatch;
|
|
|
|
- regmatch_t pmatch[];
|
|
|
|
- int eflags;
|
|
|
|
{
|
|
{
|
|
reg_errcode_t err;
|
|
reg_errcode_t err;
|
|
int start, length;
|
|
int start, length;
|
|
@@ -282,56 +278,43 @@ libc_hidden_def(regexec)
|
|
match was found and -2 indicates an internal error. */
|
|
match was found and -2 indicates an internal error. */
|
|
|
|
|
|
int
|
|
int
|
|
-re_match (bufp, string, length, start, regs)
|
|
+re_match (struct re_pattern_buffer *bufp, const char *string, int length,
|
|
- struct re_pattern_buffer *bufp;
|
|
+ int start, struct re_registers *regs)
|
|
- const char *string;
|
|
|
|
- int length, start;
|
|
|
|
- struct re_registers *regs;
|
|
|
|
{
|
|
{
|
|
return re_search_stub (bufp, string, length, start, 0, length, regs, 1);
|
|
return re_search_stub (bufp, string, length, start, 0, length, regs, 1);
|
|
}
|
|
}
|
|
|
|
|
|
int
|
|
int
|
|
-re_search (bufp, string, length, start, range, regs)
|
|
+re_search (struct re_pattern_buffer *bufp, const char *string, int length,
|
|
- struct re_pattern_buffer *bufp;
|
|
+ int start, int range, struct re_registers *regs)
|
|
- const char *string;
|
|
|
|
- int length, start, range;
|
|
|
|
- struct re_registers *regs;
|
|
|
|
{
|
|
{
|
|
return re_search_stub (bufp, string, length, start, range, length, regs, 0);
|
|
return re_search_stub (bufp, string, length, start, range, length, regs, 0);
|
|
}
|
|
}
|
|
libc_hidden_def(re_search)
|
|
libc_hidden_def(re_search)
|
|
|
|
|
|
int
|
|
int
|
|
-re_match_2 (bufp, string1, length1, string2, length2, start, regs, stop)
|
|
+re_match_2 (struct re_pattern_buffer *bufp, const char *string1, int length1,
|
|
- struct re_pattern_buffer *bufp;
|
|
+ const char *string2, int length2, int start,
|
|
- const char *string1, *string2;
|
|
+ struct re_registers *regs, int stop)
|
|
- int length1, length2, start, stop;
|
|
|
|
- struct re_registers *regs;
|
|
|
|
{
|
|
{
|
|
return re_search_2_stub (bufp, string1, length1, string2, length2,
|
|
return re_search_2_stub (bufp, string1, length1, string2, length2,
|
|
start, 0, regs, stop, 1);
|
|
start, 0, regs, stop, 1);
|
|
}
|
|
}
|
|
|
|
|
|
int
|
|
int
|
|
-re_search_2 (bufp, string1, length1, string2, length2, start, range, regs, stop)
|
|
+re_search_2 (struct re_pattern_buffer *bufp, const char *string1, int lenght1,
|
|
- struct re_pattern_buffer *bufp;
|
|
+ const char *string2, int length2, int start, int range,
|
|
- const char *string1, *string2;
|
|
+ struct re_registers *regs, int stop)
|
|
- int length1, length2, start, range, stop;
|
|
|
|
- struct re_registers *regs;
|
|
|
|
{
|
|
{
|
|
- return re_search_2_stub (bufp, string1, length1, string2, length2,
|
|
+ return re_search_2_stub (bufp, string1, lenght1, string2, length2,
|
|
start, range, regs, stop, 0);
|
|
start, range, regs, stop, 0);
|
|
}
|
|
}
|
|
libc_hidden_def(re_search_2)
|
|
libc_hidden_def(re_search_2)
|
|
|
|
|
|
static int
|
|
static int
|
|
-re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs,
|
|
+re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
|
|
- stop, ret_len)
|
|
+ int length1, const char *string2, int length2, int start,
|
|
- struct re_pattern_buffer *bufp;
|
|
+ int range, struct re_registers *regs, int stop, int ret_len)
|
|
- const char *string1, *string2;
|
|
|
|
- int length1, length2, start, range, stop, ret_len;
|
|
|
|
- struct re_registers *regs;
|
|
|
|
{
|
|
{
|
|
const char *str;
|
|
const char *str;
|
|
int rval;
|
|
int rval;
|
|
@@ -372,11 +355,9 @@ re_search_2_stub (bufp, string1, length1, string2, length2, start, range, regs,
|
|
otherwise the position of the match is returned. */
|
|
otherwise the position of the match is returned. */
|
|
|
|
|
|
static int
|
|
static int
|
|
-re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
|
|
+re_search_stub (struct re_pattern_buffer *bufp, const char *string, int length,
|
|
- struct re_pattern_buffer *bufp;
|
|
+ int start, int range, int stop, struct re_registers *regs,
|
|
- const char *string;
|
|
+ int ret_len)
|
|
- int length, start, range, stop, ret_len;
|
|
|
|
- struct re_registers *regs;
|
|
|
|
{
|
|
{
|
|
reg_errcode_t result;
|
|
reg_errcode_t result;
|
|
regmatch_t *pmatch;
|
|
regmatch_t *pmatch;
|
|
@@ -462,10 +443,8 @@ re_search_stub (bufp, string, length, start, range, stop, regs, ret_len)
|
|
}
|
|
}
|
|
|
|
|
|
static unsigned
|
|
static unsigned
|
|
-re_copy_regs (regs, pmatch, nregs, regs_allocated)
|
|
+re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, int nregs,
|
|
- struct re_registers *regs;
|
|
+ int regs_allocated)
|
|
- regmatch_t *pmatch;
|
|
|
|
- int nregs, regs_allocated;
|
|
|
|
{
|
|
{
|
|
int rval = REGS_REALLOCATE;
|
|
int rval = REGS_REALLOCATE;
|
|
int i;
|
|
int i;
|
|
@@ -531,11 +510,8 @@ re_copy_regs (regs, pmatch, nregs, regs_allocated)
|
|
freeing the old data. */
|
|
freeing the old data. */
|
|
|
|
|
|
void
|
|
void
|
|
-re_set_registers (bufp, regs, num_regs, starts, ends)
|
|
+re_set_registers (struct re_pattern_buffer *bufp, struct re_registers *regs,
|
|
- struct re_pattern_buffer *bufp;
|
|
+ unsigned num_regs, regoff_t *starts, regoff_t *ends)
|
|
- struct re_registers *regs;
|
|
|
|
- unsigned num_regs;
|
|
|
|
- regoff_t *starts, *ends;
|
|
|
|
{
|
|
{
|
|
if (num_regs)
|
|
if (num_regs)
|
|
{
|
|
{
|
|
@@ -574,15 +550,10 @@ re_exec (const char *s)
|
|
otherwise return the error code.
|
|
otherwise return the error code.
|
|
Note: We assume front end functions already check ranges.
|
|
Note: We assume front end functions already check ranges.
|
|
(START + RANGE >= 0 && START + RANGE <= LENGTH) */
|
|
(START + RANGE >= 0 && START + RANGE <= LENGTH) */
|
|
-
|
|
|
|
static reg_errcode_t
|
|
static reg_errcode_t
|
|
-re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
|
|
+re_search_internal (const regex_t *preg, const char *string, int length,
|
|
- eflags)
|
|
+ int start, int range, int stop, size_t nmatch,
|
|
- const regex_t *preg;
|
|
+ regmatch_t pmatch[], int eflags)
|
|
- const char *string;
|
|
|
|
- int length, start, range, stop, eflags;
|
|
|
|
- size_t nmatch;
|
|
|
|
- regmatch_t pmatch[];
|
|
|
|
{
|
|
{
|
|
reg_errcode_t err;
|
|
reg_errcode_t err;
|
|
const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer;
|
|
const re_dfa_t *dfa = (const re_dfa_t *) preg->buffer;
|
|
@@ -889,8 +860,7 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
|
|
}
|
|
}
|
|
|
|
|
|
static reg_errcode_t
|
|
static reg_errcode_t
|
|
-prune_impossible_nodes (mctx)
|
|
+prune_impossible_nodes (re_match_context_t *mctx)
|
|
- re_match_context_t *mctx;
|
|
|
|
{
|
|
{
|
|
const re_dfa_t *const dfa = mctx->dfa;
|
|
const re_dfa_t *const dfa = mctx->dfa;
|
|
int halt_node, match_last;
|
|
int halt_node, match_last;
|