10 #ifndef HAKA_REGEXP_MODULE_H 11 #define HAKA_REGEXP_MODULE_H 14 #include <haka/thread.h> 15 #include <haka/vbuffer.h> 17 #define REGEXP_MATCH 1 18 #define REGEXP_NOMATCH 0 19 #define REGEXP_ERROR -1 20 #define REGEXP_PARTIAL -2 25 struct regexp_result {
30 extern const struct regexp_result regexp_result_init;
32 #define REGEXP_CASE_INSENSITIVE (1 << 0) 33 #define REGEXP_EXTENDED (1 << 1) 35 struct regexp_module {
38 int (*match)(
const char *pattern,
int options,
const char *buffer,
int len,
struct regexp_result *result);
41 struct regexp *(*compile)(
const char *pattern,
int options);
42 void (*release_regexp)(
struct regexp *regexp);
43 int (*exec)(
struct regexp *regexp,
const char *buffer,
int len,
struct regexp_result *result);
46 struct regexp_sink *(*create_sink)(
struct regexp *regexp);
47 void (*free_regexp_sink)(
struct regexp_sink *re_sink);
48 int (*feed)(
struct regexp_sink *re_sink,
const char *buffer,
int len,
bool eof,
struct regexp_result *result);
49 int (*vbfeed)(
struct regexp_sink *re_sink,
struct vbuffer_sub *vbuf,
bool eof,
54 const struct regexp_module *
module;
59 struct regexp *regexp;
63 struct regexp_module *regexp_module_load(
const char *module_name,
struct parameters *args);
64 void regexp_module_release(
struct regexp_module *
module);
volatile uint32 atomic_t
Definition: thread.h:267