]> jfr.im git - irc/quakenet/newserv.git/blob - helpmod2/hban.h
Merge chanserv-live into default.
[irc/quakenet/newserv.git] / helpmod2 / hban.h
1 #ifndef HBAN_H
2 #define HBAN_H
3
4 #include <time.h>
5
6 #include "../channel/channel.h"
7 #include "../nick/nick.h"
8 #include "../lib/sstring.h"
9
10 /* Forward declarations */
11 struct huser_struct;
12
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* */
38 hban *hban_huser(struct huser_struct*, const char*, time_t, int);
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