]> jfr.im git - irc/quakenet/newserv.git/blame - newsearch/newsearch.h
More small error fixes.
[irc/quakenet/newserv.git] / newsearch / newsearch.h
CommitLineData
c86edd1d
Q
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
12struct searchNode;
13
14typedef struct searchNode *(*parseFunc)(int, int, char **);
15typedef void (*freeFunc)(struct searchNode *);
16typedef void *(*exeFunc)(struct searchNode *, int, void *);
17
18/* Core functions */
19struct searchNode *and_parse(int type, int argc, char **argv);
20struct searchNode *not_parse(int type, int argc, char **argv);
21struct searchNode *or_parse(int type, int argc, char **argv);
22struct searchNode *eq_parse(int type, int argc, char **argv);
f1903ace
CP
23struct searchNode *lt_parse(int type, int argc, char **argv);
24struct searchNode *gt_parse(int type, int argc, char **argv);
c86edd1d
Q
25struct searchNode *match_parse(int type, int argc, char **argv);
26struct searchNode *regex_parse(int type, int argc, char **argv);
27struct searchNode *hostmask_parse(int type, int argc, char **argv);
28struct searchNode *modes_parse(int type, int argc, char **argv);
29struct searchNode *realname_parse(int type, int argc, char **argv);
30struct searchNode *nick_parse(int type, int argc, char **argv);
31struct searchNode *ident_parse(int type, int argc, char **argv);
32struct searchNode *host_parse(int type, int argc, char **argv);
33struct searchNode *channel_parse(int type, int argc, char **argv);
f1903ace 34struct searchNode *timestamp_parse(int type, int argc, char **argv);
c433958f 35struct searchNode *country_parse(int type, int argc, char **argv);
c86edd1d
Q
36
37
38struct searchNode *search_parse(int type, char *input);
39
40/* Registration functions */
41void registersearchterm(char *term, parseFunc parsefunc);
42void deregistersearchterm(char *term, parseFunc parsefunc);
43
44void *trueval(int type);
45void *falseval(int type);
46
47
48typedef struct searchNode {
49 int returntype;
50 exeFunc exe;
51 freeFunc free;
52 void *localdata;
53} searchNode;
54
55extern const char *parseError;