diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2021-01-17 23:28:19 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2021-01-17 23:28:19 -0800 |
| commit | c577769a89614d41aa58cca9076fd85f727085a6 (patch) | |
| tree | 4079257369c39a55d0a89475bcf5d7aa73d1ebab /types.h | |
| parent | 379bf1b6c8632d7aa7215b1ef880a89794531ff5 (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.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 { |
