comparison th_regex.h @ 645:b897995101b7

More fiddling and twiddling. Add parsing to string nodes instead of separate character nodes.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 25 Jan 2020 05:11:40 +0200
parents 9e1f9e1d1487
children 18fe45e61b2b
comparison
equal deleted inserted replaced
644:562de49f8b4b 645:b897995101b7
48 TH_REF_ANCHORED = 0x0002, 48 TH_REF_ANCHORED = 0x0002,
49 }; 49 };
50 50
51 51
52 #ifdef TH_EXPERIMENTAL_REGEX_DEBUG 52 #ifdef TH_EXPERIMENTAL_REGEX_DEBUG
53 enum 53 extern BOOL th_dbg_re_flags;
54 {
55 TH_DBG_RE_COMPILE = 0x0001,
56 TH_DBG_RE_FREE = 0x0002,
57 TH_DBG_RE_MATCH = 0x0004,
58 };
59
60 extern int th_dbg_re_flags;
61 #endif 54 #endif
62 55
63 56
64 // 57 //
65 // Functions 58 // Functions
66 // 59 //
67 int th_regex_compile(th_regex_t **pexpr, const th_regex_char_t *pattern); 60 int th_regex_compile(th_regex_t **pexpr, const th_regex_char_t *pattern);
68 void th_regex_free(th_regex_t *expr); 61 void th_regex_free(th_regex_t *expr);
62 void th_regex_dump(FILE *fh, const int level, const th_regex_t *expr);
69 63
70 int th_regex_match(const th_regex_t *expr, const th_regex_char_t *haystack, 64 int th_regex_match(const th_regex_t *expr, const th_regex_char_t *haystack,
71 size_t *pnmatches, th_regex_match_t **pmatches, const size_t maxmatches, 65 size_t *pnmatches, th_regex_match_t **pmatches, const size_t maxmatches,
72 const int flags); 66 const int flags);
73 67