X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/c7e016d34b8f0429c0cd9e5366625fdf83776297..a2e9d1472af7f3693cd7843eb3ff4d8b23423fc8:/lib/trackdb.c diff --git a/lib/trackdb.c b/lib/trackdb.c index 3d3bf93..9e667e2 100644 --- a/lib/trackdb.c +++ b/lib/trackdb.c @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -39,6 +38,7 @@ #include "event.h" #include "mem.h" +#include "regexp.h" #include "kvp.h" #include "log.h" #include "vector.h" @@ -2239,18 +2239,19 @@ fail: * If @p re is NULL then always matches. */ static int track_matches(size_t dl, const char *track, size_t tl, - const pcre *re) { - int ovec[3], rc; + const regexp *re) { + size_t ovec[3]; + int rc; if(!re) return 1; track += dl + 1; tl -= (dl + 1); - switch(rc = pcre_exec(re, 0, track, tl, 0, 0, ovec, 3)) { - case PCRE_ERROR_NOMATCH: return 0; + switch(rc = regexp_match(re, track, tl, 0, ovec, 3)) { + case RXERR_NOMATCH: return 0; default: if(rc < 0) { - disorder_error(0, "pcre_exec returned %d, subject '%s'", rc, track); + disorder_error(0, "regexp_match returned %d, subject '%s'", rc, track); return 0; } return 1; @@ -2266,7 +2267,7 @@ static int track_matches(size_t dl, const char *track, size_t tl, * @return 0 or DB_LOCK_DEADLOCK */ static int do_list(struct vector *v, const char *dir, - enum trackdb_listable what, const pcre *re, DB_TXN *tid) { + enum trackdb_listable what, const regexp *re, DB_TXN *tid) { DBC *cursor; DBT k, d; size_t dl; @@ -2364,7 +2365,7 @@ deadlocked: * @return List of tracks */ char **trackdb_list(const char *dir, int *np, enum trackdb_listable what, - const pcre *re) { + const regexp *re) { DB_TXN *tid; int n; struct vector v;