vis: make paragraph textobjects linewise
[vis/gkirilov.git] / text-regex.h
blob332345a070d987664e35c39bb1c8071c2db0d449
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"
11 #include <limits.h>
13 struct bmh_t {
14 char *pat;
15 int patlen;
16 int delta1[UCHAR_MAX + 1];
17 int delta2;
20 #define MAX_REGEX_SUB 10
22 typedef struct Regex Regex;
23 typedef struct bmh_t bmh_t;
24 typedef Filerange RegexMatch;
26 Regex *text_regex_new(void);
27 int text_regex_compile(Regex*, const char *pattern, int cflags, bool slashmotion, bool fixedstring);
28 size_t text_regex_nsub(Regex*);
29 void text_regex_free(Regex*);
30 bool text_regex_is_slashmotion(Regex*);
31 int text_regex_match(Regex*, const char *data, int eflags);
32 int text_search_range_forward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags);
33 int text_search_range_backward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags);
35 #endif