From 8129933ca51caf788e0cd7c5fdbcb43fdc64601d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 19 Jul 2015 13:55:50 +0200 Subject: text: move regex related functions to separate file Eventually this should probably be rewritten to use an iternal regex engine, currently it has unacceptable memory usage, it copies the whole text. --- text-regex.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 text-regex.h (limited to 'text-regex.h') diff --git a/text-regex.h b/text-regex.h new file mode 100644 index 0000000..d304d57 --- /dev/null +++ b/text-regex.h @@ -0,0 +1,15 @@ +#ifndef TEXT_REGEX_H +#define TEXT_REGEX_H + +#include "text.h" + +typedef struct Regex Regex; +typedef Filerange RegexMatch; + +Regex *text_regex_new(void); +int text_regex_compile(Regex *r, const char *regex, int cflags); +void text_regex_free(Regex *r); +int text_search_range_forward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags); +int text_search_range_backward(Text*, size_t pos, size_t len, Regex *r, size_t nmatch, RegexMatch pmatch[], int eflags); + +#endif \ No newline at end of file -- cgit v1.2.3