]> jfr.im git - irc/quakenet/newserv.git/blob - newsearch/newsearch.h
r445@blue (orig r430): paul | 2006-02-23 22:15:53 +0000
[irc/quakenet/newserv.git] / newsearch / newsearch.h
1
2 #define SEARCHTYPE_CHANNEL 1
3 #define SEARCHTYPE_NICK 2
4
5
6 #define RETURNTYPE_BOOL 0x01
7 #define RETURNTYPE_INT 0x02
8 #define RETURNTYPE_STRING 0x03
9 #define RETURNTYPE_TYPE 0xFF
10 #define RETURNTYPE_CONST 0x100
11
12 struct searchNode;
13
14 typedef struct searchNode *(*parseFunc)(int, int, char **);
15 typedef void (*freeFunc)(struct searchNode *);
16 typedef void *(*exeFunc)(struct searchNode *, int, void *);
17
18 /* Core functions */
19 struct searchNode *and_parse(int type, int argc, char **argv);
20 struct searchNode *not_parse(int type, int argc, char **argv);
21 struct searchNode *or_parse(int type, int argc, char **argv);
22 struct searchNode *eq_parse(int type, int argc, char **argv);
23 struct searchNode *match_parse(int type, int argc, char **argv);
24 struct searchNode *regex_parse(int type, int argc, char **argv);
25 struct searchNode *hostmask_parse(int type, int argc, char **argv);
26 struct searchNode *modes_parse(int type, int argc, char **argv);
27 struct searchNode *realname_parse(int type, int argc, char **argv);
28 struct searchNode *nick_parse(int type, int argc, char **argv);
29 struct searchNode *authname_parse(int type, int argc, char **argv);
30 struct searchNode *ident_parse(int type, int argc, char **argv);
31 struct searchNode *host_parse(int type, int argc, char **argv);
32 struct searchNode *channel_parse(int type, int argc, char **argv);
33
34
35 struct searchNode *search_parse(int type, char *input);
36
37 /* Registration functions */
38 void registersearchterm(char *term, parseFunc parsefunc);
39 void deregistersearchterm(char *term, parseFunc parsefunc);
40
41 void *trueval(int type);
42 void *falseval(int type);
43
44
45 typedef struct searchNode {
46 int returntype;
47 exeFunc exe;
48 freeFunc free;
49 void *localdata;
50 } searchNode;
51
52 extern const char *parseError;