summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cregex.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-07-22 15:05:25 +0200
committerTyge Løvset <[email protected]>2022-07-22 15:05:25 +0200
commit29d9d1d96d8a37f6d7e24dc170aa08a40f0f1559 (patch)
treeb239018af9c0dfa1b07edaf835663757dd4759ed /include/stc/cregex.h
parent28ee78e128c14fe309cb5f7cfc3f2172bf675ea7 (diff)
downloadSTC-modified-29d9d1d96d8a37f6d7e24dc170aa08a40f0f1559.tar.gz
STC-modified-29d9d1d96d8a37f6d7e24dc170aa08a40f0f1559.zip
FINAL cregex update for now: optimize/change callback mfun API. Also, cstr_printf() cannot take self as print argument.
Diffstat (limited to 'include/stc/cregex.h')
-rw-r--r--include/stc/cregex.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/cregex.h b/include/stc/cregex.h
index f93a0c03..fff8ccb1 100644
--- a/include/stc/cregex.h
+++ b/include/stc/cregex.h
@@ -98,11 +98,11 @@ int cregex_match_p(const char* input, const char* pattern,
/* replace regular expression */
cstr cregex_replace(const char* input, const cregex* re, const char* replace,
- cstr (*mfun)(int i, csview match), unsigned count);
+ bool (*mfun)(int i, csview match, cstr* mstr), unsigned count);
-/* replace + compile RE pattern and extra arguments */
+/* replace + compile RE pattern, and extra arguments */
cstr cregex_replace_pe(const char* input, const char* pattern, const char* replace,
- cstr (*mfun)(int i, csview match), unsigned count, int cflags);
+ bool (*mfun)(int i, csview match, cstr* mstr), unsigned count, int cflags);
static inline
cstr cregex_replace_p(const char* input, const char* pattern, const char* replace)
{ return cregex_replace_pe(input, pattern, replace, NULL, 0, 0); }