aboutsummaryrefslogtreecommitdiff
path: root/regex.h
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-29 19:14:03 +0200
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-06-29 19:14:03 +0200
commitd71d7527a8be8654560867d761036598408bfe14 (patch)
tree57a3f056e8b1039b172a618aec264e8c172d4925 /regex.h
parent7c103ba4914cb47cb1e6c51cc9b8121aa5e6ef62 (diff)
downloadterex-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 'regex.h')
-rw-r--r--regex.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/regex.h b/regex.h
index 5568ed7..d48f20e 100644
--- a/regex.h
+++ b/regex.h
@@ -290,6 +290,7 @@ typedef struct {
#define REG_MIXED 17 /* character widths of regex and string differ */
#define REG_BADOPT 18 /* invalid embedded option */
#define REG_ETOOBIG 19 /* nfa has too many states */
+#define REG_EINTR 20 /* interrupted by is_interrupted() callback */
/* two specials for debugging and testing */
#define REG_ATOI 101 /* convert error-code name to number */
#define REG_ITOA 102 /* convert error-code number to name */
@@ -320,6 +321,7 @@ MODULE_SCOPE int __REG_WIDE_EXEC(regex_t *, __REG_CONST __REG_WIDE_T *, size_t,
#endif
MODULE_SCOPE re_void regfree(regex_t *);
MODULE_SCOPE size_t regerror(int, __REG_CONST regex_t *, char *, size_t);
+MODULE_SCOPE void tere_set_is_interrupted_cb(regex_t *, int (*cb)(void));
/* automatically gathered by fwd; do not hand-edit */
/* =====^!^===== end forwards =====^!^===== */