libclamav/regex_list.h
bd912dd8
ec481027
 
 
 #ifdef NDEBUG
 #define massert(x) (void)(0)
 #else
 /*debug version, massert enabled*/
 
 #define __massert_fail(expr,file,line) (void)cli_errmsg("Assertion failed at %s:%d\n %s\n",file,line,expr)
 
 #define massert(expr) ((void) ((expr) ? (void)0 : (__massert_fail (#expr,__FILE__,__LINE__))))
 #endif
 
bd912dd8
 struct node_stack {
 	struct tree_node** data;
 	size_t capacity;
 	size_t cnt;
 };
 
 struct regex_matcher {
 	struct cli_matcher* root_hosts;
 	struct tree_node* root_regex;
e3b67c5e
 	size_t root_hosts_cnt;
bd912dd8
 	int list_inited;
 	int list_loaded;
 	int list_built;
 	struct node_stack node_stack;
 	struct node_stack node_stack_alt;
 };
 
ec481027
 int regex_list_match(struct regex_matcher* matcher,const char* real_url,const char* display_url,int hostOnly,const char** info,int is_whitelist);
bd912dd8
 int init_regex_list(struct regex_matcher* matcher);
ec481027
 int load_regex_matcher(struct regex_matcher* matcher,FILE* fd,unsigned int options,int is_whitelist);
bd912dd8
 void regex_list_cleanup(struct regex_matcher* matcher);
 void regex_list_done(struct regex_matcher* matcher);
 int is_regex_ok(struct regex_matcher* matcher);
3da4dd4c
 
 void setup_matcher_engine(void);/* global, non thread-safe */
bd912dd8
 #endif
 
 #endif