added .gitignore
[NeonServV5.git] / IRCEvents.c
index 1bbbd4f9d790d470a2a7ab7d1ff2aaad4534d7fd..d85dff9b9027c49736d02c66d6fe1d2ec3a41dae 100644 (file)
@@ -4,6 +4,7 @@
 #include "ChanNode.h"
 #include "ChanUser.h"
 #include "ClientSocket.h"
+#include "mysqlConn.h"
 
 struct binding {
     void *func;
@@ -90,13 +91,23 @@ void unbind_##NAME(FUNCTYPE *func) { \
 #define FUNC_EVENT(NAME,FUNCTYPE,TYPE,PDECLARATION,PLIST) \
 int event_##NAME PDECLARATION { \
     struct binding *cbind; \
+    pre_event(TYPE); \
     for(cbind = binds[TYPE]; cbind; cbind = cbind->next) { \
         FUNCTYPE *func = cbind->func; \
         func PLIST; \
     } \
+    post_event(TYPE); \
     return 1; \
 }
 
+void pre_event(UNUSED_ARG(int type)) {
+
+}
+
+void post_event(UNUSED_ARG(int type)) {
+    mysql_free();
+}
+
 //EVENTS
 
 FUNC_BIND(join, join_func_t, BIND_TYPE_JOIN)