]> jfr.im git - irc/quakenet/newserv.git/blame_incremental - helpmod2/hcensor.h
GLINES: fix null pointer deref in trustgline / trustungline
[irc/quakenet/newserv.git] / helpmod2 / hcensor.h
... / ...
CommitLineData
1#ifndef HCENSOR_H
2#define HCENSOR_H
3
4#include "../lib/sstring.h"
5
6/* forward declarations */
7struct hchannel_struct;
8struct huser_struct;
9
10typedef enum
11{
12 HCENSOR_WARN,
13 HCENSOR_KICK,
14 HCENSOR_CHANBAN,
15 HCENSOR_BAN
16} hcensor_type;
17
18typedef struct hcensor_struct
19{
20 sstring *pattern;
21 sstring *reason; /* optional */
22 hcensor_type type;
23
24 struct hcensor_struct *next;
25} hcensor;
26
27hcensor *hcensor_get_by_pattern(hcensor *, const char *);
28hcensor *hcensor_get_by_index(hcensor *, int);
29hcensor *hcensor_check(hcensor *, const char *); /* first matching pattern is returned, NULL if ok */
30hcensor *hcensor_add(hcensor **, const char*, const char*, hcensor_type);
31hcensor *hcensor_del(hcensor **, hcensor *);
32/* Handle a censor match, if returnvalue is non-zero then the user was removed from channel */
33int hcensor_match(struct hchannel_struct*, struct huser_struct*, hcensor*);
34const char *hcensor_get_typename(hcensor_type);
35
36int hcensor_count(hcensor *);
37
38void hcensor_del_all(hcensor **);
39
40#endif