diff options
| author | tylov <[email protected]> | 2023-07-10 12:16:44 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-10 12:16:44 +0200 |
| commit | 8debe47bc014c41b6cf8082dcef4b87e4ef29cfa (patch) | |
| tree | 9d2a770573930191d569c9a25e2e0e684b905a26 /include | |
| parent | 7342a721e5dbef94bb1b1541f01154fe4a37aeb8 (diff) | |
| download | STC-modified-8debe47bc014c41b6cf8082dcef4b87e4ef29cfa.tar.gz STC-modified-8debe47bc014c41b6cf8082dcef4b87e4ef29cfa.zip | |
Renamed input enum flags for cregex functions.
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/cregex.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/stc/cregex.h b/include/stc/cregex.h index 1d1d441f..bce94b04 100644 --- a/include/stc/cregex.h +++ b/include/stc/cregex.h @@ -39,15 +39,19 @@ THE SOFTWARE. enum { CREG_DEFAULT = 0, + /* compile-flags */ - CREG_C_DOTALL = 1<<0, /* dot matches newline too */ - CREG_C_ICASE = 1<<1, /* ignore case */ + CREG_DOTALL = 1<<0, /* dot matches newline too */ + CREG_ICASE = 1<<1, /* ignore case */ + /* match-flags */ - CREG_M_FULLMATCH = 1<<2, /* like start-, end-of-line anchors were in pattern: "^ ... $" */ - CREG_M_NEXT = 1<<3, /* use end of previous match[0] as start of input */ - CREG_M_STARTEND = 1<<4, /* use match[0] as start+end of input */ + CREG_FULLMATCH = 1<<2, /* like start-, end-of-line anchors were in pattern: "^ ... $" */ + CREG_NEXT = 1<<3, /* use end of previous match[0] as start of input */ + CREG_STARTEND = 1<<4, /* use match[0] as start+end of input */ + /* replace-flags */ - CREG_R_STRIP = 1<<5, /* only keep the matched strings, strip rest */ + CREG_STRIP = 1<<5, /* only keep the matched strings, strip rest */ + /* limits */ CREG_MAX_CLASSES = 16, CREG_MAX_CAPTURES = 32, @@ -83,7 +87,7 @@ typedef struct { #define c_formatch(it, Re, Input) \ for (cregex_iter it = {Re, Input}; \ - cregex_find_4(it.re, it.input, it.match, CREG_M_NEXT) == CREG_OK; ) + cregex_find_4(it.re, it.input, it.match, CREG_NEXT) == CREG_OK; ) STC_INLINE cregex cregex_init(void) { cregex re = {0}; @@ -117,7 +121,7 @@ int cregex_find_4(const cregex* re, const char* input, csview match[], int mflag STC_INLINE int cregex_find_sv(const cregex* re, csview input, csview match[]) { csview *mp = NULL; if (match) { match[0] = input; mp = match; } - return cregex_find(re, input.str, mp, CREG_M_STARTEND); + return cregex_find(re, input.str, mp, CREG_STARTEND); } /* match + compile RE pattern */ |
