summaryrefslogtreecommitdiff
path: root/regexset.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexset.c')
-rw-r--r--regexset.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/regexset.c b/regexset.c
index 40ad077..657978a 100644
--- a/regexset.c
+++ b/regexset.c
@@ -13,7 +13,7 @@ void rs_init() {
rs_count = 0;
}
-static inline void re_error(const char *name, const char *pattern, const char *error, int erroffset) {
+static void re_error(const char *name, const char *pattern, const char *error, int erroffset) {
fprintf(stderr, "RE \"%s\" failed to compile: %s\n", name, error);
fprintf(stderr, "%s\n", pattern);
for(int i = 0; i < erroffset; i++) fprintf(stderr, " ");
@@ -52,6 +52,10 @@ struct regexset_t *rs_add(const char *text, const char *join) {
return rs;
}
+struct regexset_t *rs_get(int index) {
+ return (index < rs_count ? &regexes[index] : NULL);
+}
+
void rs_free() {
for(int i = 0; i < rs_count; i++) {
pcre_free(regexes[i].text);