From c577769a89614d41aa58cca9076fd85f727085a6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 17 Jan 2021 23:28:19 -0800 Subject: Updated REF and CAPTURE types to store direct pointers to names (with a len size_t) instead of allocating memory. --- types.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'types.h') 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 { -- cgit v1.2.3