MINOR: regex: Change the struct containing regex
This change permits to remove the typedef. The original regex structs
are set in haproxy's struct.
diff --git a/src/pattern.c b/src/pattern.c
index 6d7de52..3ac8f03 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -476,7 +476,7 @@
/* Parse a regex. It is allocated. */
int pat_parse_reg(const char **text, struct pattern *pattern, int *opaque, char **err)
{
- regex *preg;
+ struct my_regex *preg;
preg = calloc(1, sizeof(*preg));
diff --git a/src/regex.c b/src/regex.c
index a268996..7a76940 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -122,7 +122,7 @@
return NULL;
}
-int regex_comp(const char *str, regex *regex, int cs, int cap, char **err)
+int regex_comp(const char *str, struct my_regex *regex, int cs, int cap, char **err)
{
#ifdef USE_PCRE_JIT
int flags = 0;
@@ -154,7 +154,7 @@
if (!cap)
flags |= REG_NOSUB;
- if (regcomp(regex, str, flags) != 0) {
+ if (regcomp(®ex->regex, str, flags) != 0) {
memprintf(err, "regex '%s' is invalid", str);
return 0;
}