diff options
Diffstat (limited to 'regexset.c')
-rw-r--r-- | regexset.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 ? ®exes[index] : NULL); +} + void rs_free() { for(int i = 0; i < rs_count; i++) { pcre_free(regexes[i].text); |