diff options
| author | Tyge Løvset <[email protected]> | 2022-08-01 16:43:58 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-08-01 16:43:58 +0200 |
| commit | 3038d255c230be1b0605f199a00417658a21a016 (patch) | |
| tree | 164d7423ada8c9589df4c2c98ea46e533374381f /src | |
| parent | 8884747775e922e20b0646eeb29ce8a2b4a1c7cc (diff) | |
| download | STC-modified-3038d255c230be1b0605f199a00417658a21a016.tar.gz STC-modified-3038d255c230be1b0605f199a00417658a21a016.zip | |
start dev on v4, mainly improving API
Diffstat (limited to 'src')
| -rw-r--r-- | src/cregex.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cregex.c b/src/cregex.c index 612a6965..d1f9c133 100644 --- a/src/cregex.c +++ b/src/cregex.c @@ -1229,8 +1229,8 @@ int cregex_find_p(const char* input, const char* pattern, } cstr -cregex_replace_re(const char* input, const cregex* re, const char* replace, - bool (*mfun)(int i, csview match, cstr* mstr), unsigned count, int rflags) { +cregex_replace_ex(const char* input, const cregex* re, const char* replace, unsigned count, + int rflags, bool (*mfun)(int i, csview match, cstr* mstr)) { cstr out = cstr_null; cstr subst = cstr_null; size_t from = 0; @@ -1252,13 +1252,13 @@ cregex_replace_re(const char* input, const cregex* re, const char* replace, } cstr -cregex_replace_pe(const char* input, const char* pattern, const char* replace, - bool (*mfun)(int i, csview match, cstr* mstr), unsigned count, int crflags) { +cregex_replace_pe(const char* input, const char* pattern, const char* replace, unsigned count, + int crflags, bool (*mfun)(int i, csview match, cstr* mstr)) { cregex re = cregex_init(); int res = cregex_compile(&re, pattern, crflags); if (res != cre_success) return cstr_new("[[error: invalid regex pattern]]"); - cstr out = cregex_replace_re(input, &re, replace, mfun, count, crflags); + cstr out = cregex_replace_ex(input, &re, replace, count, crflags, mfun); cregex_drop(&re); return out; } |
