diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-06-29 19:14:03 +0200 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2026-06-29 19:14:03 +0200 |
| commit | d71d7527a8be8654560867d761036598408bfe14 (patch) | |
| tree | 57a3f056e8b1039b172a618aec264e8c172d4925 /regcomp.c | |
| parent | 7c103ba4914cb47cb1e6c51cc9b8121aa5e6ef62 (diff) | |
| download | terex-d71d7527a8be8654560867d761036598408bfe14.tar.gz | |
implemented tere_set_is_interrupted_cb()
Allows you to set up a callback that's invoked repeatedly during
matching. If it returns non-0 matching will abort and REG_EINTR is
returned.
Allows you to interrupt long-running regexp executions that would
otherwise block the UI or hang the entire application.
Diffstat (limited to 'regcomp.c')
| -rw-r--r-- | regcomp.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -273,6 +273,17 @@ static struct fns functions = { }; /* + - tere_set_is_interrupted_cb - set is_interrupted callback + ^ void tere_set_is_interrupted_cb(regex_t *, int (*cb)(void)); + */ +void +tere_set_is_interrupted_cb( + regex_t *re, int (*cb)(void)) +{ + ((struct fns *)re->re_fns)->is_interrupted = cb; +} + +/* - compile - compile regular expression ^ int compile(regex_t *, const chr *, size_t, int); */ |
