diff options
Diffstat (limited to 'src/include/regex')
-rw-r--r-- | src/include/regex/regerrs.h | 4 | ||||
-rw-r--r-- | src/include/regex/regex.h | 1 | ||||
-rw-r--r-- | src/include/regex/regguts.h | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/include/regex/regerrs.h b/src/include/regex/regerrs.h index f02711ee17..809b511266 100644 --- a/src/include/regex/regerrs.h +++ b/src/include/regex/regerrs.h @@ -81,3 +81,7 @@ { REG_ECOLORS, "REG_ECOLORS", "too many colors" }, + +{ + REG_CANCEL, "REG_CANCEL", "operation cancelled" +}, diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h index 3e87dff17b..2c7fa4df46 100644 --- a/src/include/regex/regex.h +++ b/src/include/regex/regex.h @@ -154,6 +154,7 @@ typedef struct #define REG_BADOPT 18 /* invalid embedded option */ #define REG_ETOOBIG 19 /* nfa has too many states */ #define REG_ECOLORS 20 /* too many colors */ +#define REG_CANCEL 21 /* operation cancelled */ /* 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 */ diff --git a/src/include/regex/regguts.h b/src/include/regex/regguts.h index 3a397551d5..5361411481 100644 --- a/src/include/regex/regguts.h +++ b/src/include/regex/regguts.h @@ -446,8 +446,11 @@ struct subre struct fns { void FUNCPTR(free, (regex_t *)); + int FUNCPTR(cancel_requested, (void)); }; +#define CANCEL_REQUESTED(re) \ + ((*((struct fns *) (re)->re_fns)->cancel_requested) ()) /* |