]>
Commit | Line | Data |
---|---|---|
c86edd1d Q |
1 | #ifndef HCENSOR_H |
2 | #define HCENSOR_H | |
3 | ||
4 | #include "../lib/sstring.h" | |
5 | ||
643deb1b | 6 | /* forward declarations */ |
7 | struct hchannel_struct; | |
8 | struct huser_struct; | |
9 | ||
3a839281 | 10 | typedef enum |
11 | { | |
12 | HCENSOR_WARN, | |
13 | HCENSOR_KICK, | |
9af95c3d | 14 | HCENSOR_CHANBAN, |
3a839281 | 15 | HCENSOR_BAN |
16 | } hcensor_type; | |
17 | ||
c86edd1d Q |
18 | typedef struct hcensor_struct |
19 | { | |
20 | sstring *pattern; | |
21 | sstring *reason; /* optional */ | |
3a839281 | 22 | hcensor_type type; |
23 | ||
c86edd1d Q |
24 | struct hcensor_struct *next; |
25 | } hcensor; | |
26 | ||
27 | hcensor *hcensor_get_by_pattern(hcensor *, const char *); | |
28 | hcensor *hcensor_get_by_index(hcensor *, int); | |
29 | hcensor *hcensor_check(hcensor *, const char *); /* first matching pattern is returned, NULL if ok */ | |
3a839281 | 30 | hcensor *hcensor_add(hcensor **, const char*, const char*, hcensor_type); |
c86edd1d | 31 | hcensor *hcensor_del(hcensor **, hcensor *); |
643deb1b | 32 | /* Handle a censor match, if returnvalue is non-zero then the user was removed from channel */ |
33 | int hcensor_match(struct hchannel_struct*, struct huser_struct*, hcensor*); | |
3a839281 | 34 | const char *hcensor_get_typename(hcensor_type); |
35 | ||
c86edd1d Q |
36 | int hcensor_count(hcensor *); |
37 | ||
38 | void hcensor_del_all(hcensor **); | |
39 | ||
40 | #endif |