Merge branch 'development'
[NeonServV5.git] / src / IRCEvents.h
index 86d310fa5ac6b2100838da19a91c576595c93ac7..7a7ac3efece5f70f8bcdf1edb9599feda2be69c8 100644 (file)
@@ -1,5 +1,5 @@
-/* IRCEvents.h - NeonServ v5.2
- * Copyright (C) 2011  Philipp Kreil (pk910)
+/* IRCEvents.h - NeonServ v5.6
+ * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -24,102 +24,150 @@ struct ChanNode;
 struct ChanUser;
 struct ClientSocket;
 
+#ifndef DND_FUNCTIONS
 void init_bind();
 void free_bind();
+void unregister_module_events(int module_id);
+#endif
 
 typedef void join_func_t(struct ChanUser *chanuser);
-int bind_join(join_func_t *func);
-void unbind_join(join_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_join(join_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_join(join_func_t *func);
 int event_join(struct ChanUser *chanuser);
+#endif
 
 typedef void nick_func_t(struct UserNode *user, char *new_nick);
-int bind_nick(nick_func_t *func);
-void unbind_nick(nick_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_nick(nick_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_nick(nick_func_t *func);
 int event_nick(struct UserNode *user, char *new_nick);
+#endif
 
-typedef void part_func_t(struct ChanUser *chanuser, char *reason);
-int bind_part(part_func_t *func);
-void unbind_part(part_func_t *func);
-int event_part(struct ChanUser *chanuser, char *reason);
-
-typedef void quit_func_t(struct UserNode *user, char *reason);
-int bind_quit(quit_func_t *func);
-void unbind_quit(quit_func_t *func);
-int event_quit(struct UserNode *user, char *reason);
+typedef void part_func_t(struct ChanUser *chanuser, int quit, char *reason);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_part(part_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_part(part_func_t *func);
+int event_part(struct ChanUser *chanuser, int quit, char *reason);
+#endif
 
 typedef void kick_func_t(struct UserNode *user, struct ChanUser *target, char *reason);
-int bind_kick(kick_func_t *func);
-void unbind_kick(kick_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_kick(kick_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_kick(kick_func_t *func);
 int event_kick(struct UserNode *user, struct ChanUser *target, char *reason);
+#endif
 
 typedef void topic_func_t(struct UserNode *user, struct ChanNode *chan, const char *new_topic);
-int bind_topic(topic_func_t *func);
-void unbind_topic(topic_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_topic(topic_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_topic(topic_func_t *func);
 int event_topic(struct UserNode *user, struct ChanNode *chan, const char *new_topic);
+#endif
 
 typedef void mode_func_t(struct UserNode *user, struct ChanNode *chan, char *modes, char **argv, int argc);
-int bind_mode(mode_func_t *func);
-void unbind_mode(mode_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_mode(mode_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_mode(mode_func_t *func);
 int event_mode(struct UserNode *user, struct ChanNode *chan, char *modes, char **argv, int argc);
+#endif
 
 typedef void chanmsg_func_t(struct UserNode *user, struct ChanNode *chan, char *message);
-int bind_chanmsg(chanmsg_func_t *func);
-void unbind_chanmsg(chanmsg_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_chanmsg(chanmsg_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_chanmsg(chanmsg_func_t *func);
 int event_chanmsg(struct UserNode *user, struct ChanNode *chan, char *message);
+#endif
 
 typedef void privmsg_func_t(struct UserNode *user, struct UserNode *target, char *message);
-int bind_privmsg(privmsg_func_t *func);
-void unbind_privmsg(privmsg_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_privmsg(privmsg_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_privmsg(privmsg_func_t *func);
 int event_privmsg(struct UserNode *user, struct UserNode *target, char *message);
+#endif
 
 typedef void channotice_func_t(struct UserNode *user, struct ChanNode *chan, char *message);
-int bind_channotice(channotice_func_t *func);
-void unbind_channotice(channotice_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_channotice(channotice_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_channotice(channotice_func_t *func);
 int event_channotice(struct UserNode *user, struct ChanNode *chan, char *message);
+#endif
 
 typedef void privnotice_func_t(struct UserNode *user, struct UserNode *target, char *message);
-int bind_privnotice(privnotice_func_t *func);
-void unbind_privnotice(privnotice_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_privnotice(privnotice_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_privnotice(privnotice_func_t *func);
 int event_privnotice(struct UserNode *user, struct UserNode *target, char *message);
+#endif
 
 typedef void chanctcp_func_t(struct UserNode *user, struct ChanNode *chan, char *command, char *text);
-int bind_chanctcp(chanctcp_func_t *func);
-void unbind_chanctcp(chanctcp_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_chanctcp(chanctcp_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_chanctcp(chanctcp_func_t *func);
 int event_chanctcp(struct UserNode *user, struct ChanNode *chan, char *command, char *text);
+#endif
 
 typedef void privctcp_func_t(struct UserNode *user, struct UserNode *target, char *command, char *text);
-int bind_privctcp(privctcp_func_t *func);
-void unbind_privctcp(privctcp_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_privctcp(privctcp_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_privctcp(privctcp_func_t *func);
 int event_privctcp(struct UserNode *user, struct UserNode *target, char *command, char *text);
+#endif
 
 typedef void invite_func_t(struct ClientSocket *client, struct UserNode *user, char *channel);
-int bind_invite(invite_func_t *func);
-void unbind_invite(invite_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_invite(invite_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_invite(invite_func_t *func);
 int event_invite(struct ClientSocket *client, struct UserNode *user, char *channel);
+#endif
 
 typedef void raw_func_t(struct ClientSocket *client, char *from, char *cmd, char **argv, int argc);
-int bind_raw(raw_func_t *func);
-void unbind_raw(raw_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_raw(raw_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_raw(raw_func_t *func);
 int event_raw(struct ClientSocket *client, char *from, char *cmd, char **argv, int argc);
+#endif
 
 typedef void bot_ready_func_t(struct ClientSocket *client);
-int bind_bot_ready(bot_ready_func_t *func);
-void unbind_bot_ready(bot_ready_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_bot_ready(bot_ready_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_bot_ready(bot_ready_func_t *func);
 int event_bot_ready(struct ClientSocket *client);
+#endif
 
-typedef int registered_func_t(struct UserNode *old_user, struct UserNode *new_user);
-int bind_registered(registered_func_t *func);
-void unbind_registered(registered_func_t *func);
-int event_registered(struct UserNode *old_user, struct UserNode *new_user);
+typedef void registered_func_t(struct UserNode *user, char *new_mask);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_registered(registered_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_registered(registered_func_t *func);
+int event_registered(struct UserNode *user, char *new_mask);
+#endif
 
 typedef int freeuser_func_t(struct UserNode *user);
-int bind_freeuser(freeuser_func_t *func);
-void unbind_freeuser(freeuser_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_freeuser(freeuser_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_freeuser(freeuser_func_t *func);
 int event_freeuser(struct UserNode *user);
+#endif
 
 typedef int freechan_func_t(struct ChanNode *chan);
-int bind_freechan(freechan_func_t *func);
-void unbind_freechan(freechan_func_t *func);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_freechan(freechan_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_freechan(freechan_func_t *func);
 int event_freechan(struct ChanNode *chan);
-
-#endif
\ No newline at end of file
+#endif
+
+typedef int reload_func_t(int initialization);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_reload(reload_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_reload(reload_func_t *func);
+int event_reload(int initialization);
+#endif
+
+typedef void freeclient_func_t(struct ClientSocket *client);
+#ifndef DND_FUNCTIONS
+/* MODULAR ACCESSIBLE */ int bind_freeclient(freeclient_func_t *func, int module_id);
+/* MODULAR ACCESSIBLE */ void unbind_freeclient(freeclient_func_t *func);
+int event_freeclient(struct ClientSocket *chan);
+#endif
+
+#endif