(thanks to the people reading git and excessively exploiting this bug... It was undet...
[NeonServV5.git] / src / IRCEvents.h
1 /* IRCEvents.h - NeonServ v5.6
2  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License 
15  * along with this program. If not, see <http://www.gnu.org/licenses/>. 
16  */
17 #ifndef _IRCEvents_h
18 #define _IRCEvents_h
19
20 #include "main.h"
21
22 struct UserNode;
23 struct ChanNode;
24 struct ChanUser;
25 struct ClientSocket;
26
27 #ifndef DND_FUNCTIONS
28 void init_bind();
29 void free_bind();
30 void unregister_module_events(int module_id);
31 #endif
32
33 typedef void join_func_t(struct ChanUser *chanuser);
34 #ifndef DND_FUNCTIONS
35 /* MODULAR ACCESSIBLE */ int bind_join(join_func_t *func, int module_id);
36 /* MODULAR ACCESSIBLE */ void unbind_join(join_func_t *func);
37 int event_join(struct ChanUser *chanuser);
38 #endif
39
40 typedef void nick_func_t(struct UserNode *user, char *new_nick);
41 #ifndef DND_FUNCTIONS
42 /* MODULAR ACCESSIBLE */ int bind_nick(nick_func_t *func, int module_id);
43 /* MODULAR ACCESSIBLE */ void unbind_nick(nick_func_t *func);
44 int event_nick(struct UserNode *user, char *new_nick);
45 #endif
46
47 typedef void part_func_t(struct ChanUser *chanuser, int quit, char *reason);
48 #ifndef DND_FUNCTIONS
49 /* MODULAR ACCESSIBLE */ int bind_part(part_func_t *func, int module_id);
50 /* MODULAR ACCESSIBLE */ void unbind_part(part_func_t *func);
51 int event_part(struct ChanUser *chanuser, int quit, char *reason);
52 #endif
53
54 typedef void kick_func_t(struct UserNode *user, struct ChanUser *target, char *reason);
55 #ifndef DND_FUNCTIONS
56 /* MODULAR ACCESSIBLE */ int bind_kick(kick_func_t *func, int module_id);
57 /* MODULAR ACCESSIBLE */ void unbind_kick(kick_func_t *func);
58 int event_kick(struct UserNode *user, struct ChanUser *target, char *reason);
59 #endif
60
61 typedef void topic_func_t(struct UserNode *user, struct ChanNode *chan, const char *new_topic);
62 #ifndef DND_FUNCTIONS
63 /* MODULAR ACCESSIBLE */ int bind_topic(topic_func_t *func, int module_id);
64 /* MODULAR ACCESSIBLE */ void unbind_topic(topic_func_t *func);
65 int event_topic(struct UserNode *user, struct ChanNode *chan, const char *new_topic);
66 #endif
67
68 typedef void mode_func_t(struct UserNode *user, struct ChanNode *chan, char *modes, char **argv, int argc);
69 #ifndef DND_FUNCTIONS
70 /* MODULAR ACCESSIBLE */ int bind_mode(mode_func_t *func, int module_id);
71 /* MODULAR ACCESSIBLE */ void unbind_mode(mode_func_t *func);
72 int event_mode(struct UserNode *user, struct ChanNode *chan, char *modes, char **argv, int argc);
73 #endif
74
75 typedef void chanmsg_func_t(struct UserNode *user, struct ChanNode *chan, char *message);
76 #ifndef DND_FUNCTIONS
77 /* MODULAR ACCESSIBLE */ int bind_chanmsg(chanmsg_func_t *func, int module_id);
78 /* MODULAR ACCESSIBLE */ void unbind_chanmsg(chanmsg_func_t *func);
79 int event_chanmsg(struct UserNode *user, struct ChanNode *chan, char *message);
80 #endif
81
82 typedef void privmsg_func_t(struct UserNode *user, struct UserNode *target, char *message);
83 #ifndef DND_FUNCTIONS
84 /* MODULAR ACCESSIBLE */ int bind_privmsg(privmsg_func_t *func, int module_id);
85 /* MODULAR ACCESSIBLE */ void unbind_privmsg(privmsg_func_t *func);
86 int event_privmsg(struct UserNode *user, struct UserNode *target, char *message);
87 #endif
88
89 typedef void channotice_func_t(struct UserNode *user, struct ChanNode *chan, char *message);
90 #ifndef DND_FUNCTIONS
91 /* MODULAR ACCESSIBLE */ int bind_channotice(channotice_func_t *func, int module_id);
92 /* MODULAR ACCESSIBLE */ void unbind_channotice(channotice_func_t *func);
93 int event_channotice(struct UserNode *user, struct ChanNode *chan, char *message);
94 #endif
95
96 typedef void privnotice_func_t(struct UserNode *user, struct UserNode *target, char *message);
97 #ifndef DND_FUNCTIONS
98 /* MODULAR ACCESSIBLE */ int bind_privnotice(privnotice_func_t *func, int module_id);
99 /* MODULAR ACCESSIBLE */ void unbind_privnotice(privnotice_func_t *func);
100 int event_privnotice(struct UserNode *user, struct UserNode *target, char *message);
101 #endif
102
103 typedef void chanctcp_func_t(struct UserNode *user, struct ChanNode *chan, char *command, char *text);
104 #ifndef DND_FUNCTIONS
105 /* MODULAR ACCESSIBLE */ int bind_chanctcp(chanctcp_func_t *func, int module_id);
106 /* MODULAR ACCESSIBLE */ void unbind_chanctcp(chanctcp_func_t *func);
107 int event_chanctcp(struct UserNode *user, struct ChanNode *chan, char *command, char *text);
108 #endif
109
110 typedef void privctcp_func_t(struct UserNode *user, struct UserNode *target, char *command, char *text);
111 #ifndef DND_FUNCTIONS
112 /* MODULAR ACCESSIBLE */ int bind_privctcp(privctcp_func_t *func, int module_id);
113 /* MODULAR ACCESSIBLE */ void unbind_privctcp(privctcp_func_t *func);
114 int event_privctcp(struct UserNode *user, struct UserNode *target, char *command, char *text);
115 #endif
116
117 typedef void invite_func_t(struct ClientSocket *client, struct UserNode *user, char *channel);
118 #ifndef DND_FUNCTIONS
119 /* MODULAR ACCESSIBLE */ int bind_invite(invite_func_t *func, int module_id);
120 /* MODULAR ACCESSIBLE */ void unbind_invite(invite_func_t *func);
121 int event_invite(struct ClientSocket *client, struct UserNode *user, char *channel);
122 #endif
123
124 typedef void raw_func_t(struct ClientSocket *client, char *from, char *cmd, char **argv, int argc);
125 #ifndef DND_FUNCTIONS
126 /* MODULAR ACCESSIBLE */ int bind_raw(raw_func_t *func, int module_id);
127 /* MODULAR ACCESSIBLE */ void unbind_raw(raw_func_t *func);
128 int event_raw(struct ClientSocket *client, char *from, char *cmd, char **argv, int argc);
129 #endif
130
131 typedef void bot_ready_func_t(struct ClientSocket *client);
132 #ifndef DND_FUNCTIONS
133 /* MODULAR ACCESSIBLE */ int bind_bot_ready(bot_ready_func_t *func, int module_id);
134 /* MODULAR ACCESSIBLE */ void unbind_bot_ready(bot_ready_func_t *func);
135 int event_bot_ready(struct ClientSocket *client);
136 #endif
137
138 typedef void registered_func_t(struct UserNode *user, char *new_mask);
139 #ifndef DND_FUNCTIONS
140 /* MODULAR ACCESSIBLE */ int bind_registered(registered_func_t *func, int module_id);
141 /* MODULAR ACCESSIBLE */ void unbind_registered(registered_func_t *func);
142 int event_registered(struct UserNode *user, char *new_mask);
143 #endif
144
145 typedef int freeuser_func_t(struct UserNode *user);
146 #ifndef DND_FUNCTIONS
147 /* MODULAR ACCESSIBLE */ int bind_freeuser(freeuser_func_t *func, int module_id);
148 /* MODULAR ACCESSIBLE */ void unbind_freeuser(freeuser_func_t *func);
149 int event_freeuser(struct UserNode *user);
150 #endif
151
152 typedef int freechan_func_t(struct ChanNode *chan);
153 #ifndef DND_FUNCTIONS
154 /* MODULAR ACCESSIBLE */ int bind_freechan(freechan_func_t *func, int module_id);
155 /* MODULAR ACCESSIBLE */ void unbind_freechan(freechan_func_t *func);
156 int event_freechan(struct ChanNode *chan);
157 #endif
158
159 typedef int reload_func_t(int initialization);
160 #ifndef DND_FUNCTIONS
161 /* MODULAR ACCESSIBLE */ int bind_reload(reload_func_t *func, int module_id);
162 /* MODULAR ACCESSIBLE */ void unbind_reload(reload_func_t *func);
163 int event_reload(int initialization);
164 #endif
165
166 typedef void freeclient_func_t(struct ClientSocket *client);
167 #ifndef DND_FUNCTIONS
168 /* MODULAR ACCESSIBLE */ int bind_freeclient(freeclient_func_t *func, int module_id);
169 /* MODULAR ACCESSIBLE */ void unbind_freeclient(freeclient_func_t *func);
170 int event_freeclient(struct ClientSocket *chan);
171 #endif
172
173 #endif