]> jfr.im git - irc/quakenet/newserv.git/blame - newsearch/newsearch.h
added LISP style kill/gline functionality
[irc/quakenet/newserv.git] / newsearch / newsearch.h
CommitLineData
16cc6e32 1#include "../nick/nick.h"
c86edd1d
Q
2
3#define SEARCHTYPE_CHANNEL 1
4#define SEARCHTYPE_NICK 2
5
6
16cc6e32
IB
7#define NSMAX_KILL_LIMIT 5
8#define NSMAX_GLINE_LIMIT 500
9
10
11/* gline duration, in seconds */
12#define NSGLINE_DURATION 3600
13
14
c86edd1d
Q
15#define RETURNTYPE_BOOL 0x01
16#define RETURNTYPE_INT 0x02
17#define RETURNTYPE_STRING 0x03
18#define RETURNTYPE_TYPE 0xFF
19#define RETURNTYPE_CONST 0x100
20
21struct searchNode;
22
23typedef struct searchNode *(*parseFunc)(int, int, char **);
24typedef void (*freeFunc)(struct searchNode *);
25typedef void *(*exeFunc)(struct searchNode *, int, void *);
26
27/* Core functions */
28struct searchNode *and_parse(int type, int argc, char **argv);
29struct searchNode *not_parse(int type, int argc, char **argv);
30struct searchNode *or_parse(int type, int argc, char **argv);
31struct searchNode *eq_parse(int type, int argc, char **argv);
f1903ace
CP
32struct searchNode *lt_parse(int type, int argc, char **argv);
33struct searchNode *gt_parse(int type, int argc, char **argv);
c86edd1d
Q
34struct searchNode *match_parse(int type, int argc, char **argv);
35struct searchNode *regex_parse(int type, int argc, char **argv);
36struct searchNode *hostmask_parse(int type, int argc, char **argv);
37struct searchNode *modes_parse(int type, int argc, char **argv);
38struct searchNode *realname_parse(int type, int argc, char **argv);
39struct searchNode *nick_parse(int type, int argc, char **argv);
052247fa 40struct searchNode *authname_parse(int type, int argc, char **argv);
c86edd1d
Q
41struct searchNode *ident_parse(int type, int argc, char **argv);
42struct searchNode *host_parse(int type, int argc, char **argv);
43struct searchNode *channel_parse(int type, int argc, char **argv);
f1903ace 44struct searchNode *timestamp_parse(int type, int argc, char **argv);
c433958f 45struct searchNode *country_parse(int type, int argc, char **argv);
29161bbe 46struct searchNode *ip_parse(int type, int argc, char **argv);
16cc6e32
IB
47struct searchNode *kill_parse(int type, int argc, char **argv);
48struct searchNode *gline_parse(int type, int argc, char **argv);
c86edd1d
Q
49
50
51struct searchNode *search_parse(int type, char *input);
52
53/* Registration functions */
54void registersearchterm(char *term, parseFunc parsefunc);
55void deregistersearchterm(char *term, parseFunc parsefunc);
56
57void *trueval(int type);
58void *falseval(int type);
59
c86edd1d
Q
60typedef struct searchNode {
61 int returntype;
62 exeFunc exe;
63 freeFunc free;
64 void *localdata;
65} searchNode;
66
67extern const char *parseError;