aboutsummaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'types.h')
-rw-r--r--types.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/types.h b/types.h
index dda89de..96e0727 100644
--- a/types.h
+++ b/types.h
@@ -9,6 +9,8 @@
#include "files.h"
+#define UNBOUNDED(pat) ((pat)->max_matchlen == -1)
+
// BP virtual machine pattern types
enum pattype_e {
BP_ANYCHAR = 1,
@@ -44,8 +46,9 @@ struct match_s; // forward declared to resolve circular struct defs
typedef struct pat_s {
enum pattype_e type;
const char *start, *end;
- // Length of the match, if constant, otherwise -1
- ssize_t len;
+ // The bounds of the match length (used for backtracking)
+ size_t min_matchlen;
+ ssize_t max_matchlen; // -1 means unbounded length
union {
const char *string;
struct {