Merge branch 'solarized-term' of https://github.com/xcko/vis
[vis.git] / text-regex.h
blob45054c83be2c14f0e2bb5d84249cb0ef766fba22
1 #ifndef TEXT_REGEX_H
2 #define TEXT_REGEX_H
4 /* make the REG_* constants available */
5 #if CONFIG_TRE
6 #include <tre/tre.h>
7 #else
8 #include <regex.h>
9 #endif
10 #include "text.h"
12 typedef struct Regex Regex;
13 typedef Filerange RegexMatch;
15 Regex *text_regex_new(void);
16 int text_regex_compile(Regex*, const char *pattern, int cflags);
17 size_t text_regex_nsub(Regex*);
18 void text_regex_free(Regex*);
19 int text_regex_match(Regex*, const char *data, int eflags);
20 int text_search_range_forward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags);
21 int text_search_range_backward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags);
23 #endif