aboutsummaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-17 23:28:19 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-17 23:28:19 -0800
commitc577769a89614d41aa58cca9076fd85f727085a6 (patch)
tree4079257369c39a55d0a89475bcf5d7aa73d1ebab /types.h
parent379bf1b6c8632d7aa7215b1ef880a89794531ff5 (diff)
Updated REF and CAPTURE types to store direct pointers to names (with a
len size_t) instead of allocating memory.
Diffstat (limited to 'types.h')
-rw-r--r--types.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/types.h b/types.h
index 58b65d2..e10c763 100644
--- a/types.h
+++ b/types.h
@@ -41,7 +41,11 @@ typedef struct pat_s {
// Length of the match, if constant, otherwise -1
ssize_t len;
union {
- const char *s;
+ const char *string;
+ struct {
+ const char *name;
+ size_t len;
+ } name;
struct {
unsigned char low, high;
} range;
@@ -60,7 +64,8 @@ typedef struct pat_s {
} replace;
struct {
struct pat_s *capture_pat;
- char *name;
+ const char *name;
+ size_t namelen;
} capture;
struct match_s *backref;
struct {