diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 15:27:24 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-05-20 15:27:24 -0700 |
| commit | 655ed121289c0befa2c87f7a6a2db3409f54094c (patch) | |
| tree | a575edd664c5feb418389fb2fb22c6d627b04927 /types.h | |
| parent | a0028e96055669ab83dd6ff9e14b0e728a121d7d (diff) | |
Mostly working version
Diffstat (limited to 'types.h')
| -rw-r--r-- | types.h | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 { |
