]>
Commit | Line | Data |
---|---|---|
c86edd1d Q |
1 | #ifndef HBAN_H |
2 | #define HBAN_H | |
3 | ||
4 | #include <time.h> | |
5 | ||
6 | #include "../channel/channel.h" | |
c86edd1d | 7 | #include "../nick/nick.h" |
c86edd1d Q |
8 | #include "../lib/sstring.h" |
9 | ||
e908ecfa | 10 | /* Forward declarations */ |
11 | struct huser_struct; | |
12 | ||
c86edd1d Q |
13 | typedef struct hban_struct |
14 | { | |
15 | chanban *real_ban; | |
16 | sstring *reason; | |
17 | time_t expiration; | |
18 | ||
19 | struct hban_struct *next; | |
20 | } hban; | |
21 | ||
22 | enum | |
23 | { | |
24 | HBAN_NICK = 1 << 0, | |
25 | HBAN_IDENT = 1 << 1, | |
26 | HBAN_HOST = 1 << 2, | |
27 | HBAN_REAL_HOST = 1 << 3 | |
28 | }; | |
29 | ||
30 | extern hban* hbans; | |
31 | ||
32 | hban *hban_add(const char*, const char*, time_t, int); | |
33 | hban *hban_del(hban*, int); | |
34 | hban *hban_get(const char*); | |
35 | ||
36 | int hban_count(void); | |
37 | /* the first parameter is huser* */ | |
e908ecfa | 38 | hban *hban_huser(struct huser_struct*, const char*, time_t, int); |
c86edd1d Q |
39 | |
40 | hban *hban_check(nick*); | |
41 | ||
42 | void hban_remove_expired(void); | |
43 | ||
44 | void hban_del_all(void); | |
45 | ||
46 | const char *hban_get_reason(hban*); | |
47 | ||
48 | const char *hban_ban_string(nick*, int); | |
49 | ||
50 | #endif |