added free-client event
authorpk910 <philipp@zoelle1.de>
Fri, 7 Sep 2012 10:09:12 +0000 (12:09 +0200)
committerpk910 <philipp@zoelle1.de>
Fri, 7 Sep 2012 10:09:12 +0000 (12:09 +0200)
src/ClientSocket.c
src/IRCEvents.c
src/IRCEvents.h
src/modules.c
src/modules/module.h
src/version.h

index 3c05457da8d90d733a53b891e14fbc6c7d10f75e..cca4bcd7e2890727fef168b13dfa8b84ab393668 100644 (file)
@@ -136,6 +136,7 @@ int destroy_socket(struct ClientSocket *client) {
         } else
             last_sock = sock;
     }
+    event_freeclient(client);
     free(client->host);
     if(client->bind)
         free(client->bind);
index fc5053ffa68e4df71a061a3768bd94c3a58076c1..83428c9b31390cbd0853feafb749298ce21d0c6e 100644 (file)
@@ -49,8 +49,9 @@ static void **binds = NULL;
 #define BIND_TYPE_FREEUSER   17
 #define BIND_TYPE_FREECHAN   18
 #define BIND_TYPE_RELOAD     19
+#define BIND_TYPE_FREECLIENT 20
 
-#define TOTAL_BIND_TYPES     20
+#define TOTAL_BIND_TYPES     21
 
 void init_bind() {
     if(binds)
@@ -229,3 +230,7 @@ FUNC_EVENT(freechan, freechan_func_t, BIND_TYPE_FREECHAN, (struct ChanNode *chan
 FUNC_BIND(reload, reload_func_t, BIND_TYPE_RELOAD)
 FUNC_UNBIND(reload, reload_func_t, BIND_TYPE_RELOAD)
 FUNC_EVENT(reload, reload_func_t, BIND_TYPE_RELOAD, (int initialization), (initialization))
+
+FUNC_BIND(freeclient, freeclient_func_t, BIND_TYPE_FREECLIENT)
+FUNC_UNBIND(freeclient, freeclient_func_t, BIND_TYPE_FREECLIENT)
+FUNC_EVENT(freeclient, freeclient_func_t, BIND_TYPE_FREECLIENT, (struct ClientNode *client), (client))
index feabf573f2bdbea7d37d7221b0e909458a2e70fc..f78ed91462d882d185b812f63a7273d82ba57ee9 100644 (file)
@@ -163,4 +163,11 @@ typedef int reload_func_t(int initialization);
 int event_reload(int initialization);
 #endif
 
+typedef void freeclient_func_t(struct ClientNode *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 ClientNode *chan);
+#endif
+
 #endif
index 3193c626cfeae2aa5cbd73a9f8736b1502b7805e..0de4505ea9df74c1474f0c7ce95298e0360d59fc 100644 (file)
@@ -49,6 +49,7 @@
 /* 191-193 */ #include "ModuleFunctions.h"
 /* 194     */ /* bots.h */
 /* 195-196 */ /* version.h */
+/* 197-198 */ /* IRCEvents.h */
 
 #define Function void *
 
@@ -260,7 +261,9 @@ void *global_functions[] = {
 /* 193 */ (Function) module_neonbackup_recover_chan,
 /* 194 */ (Function) requestInvite,
 /* 195 */ (Function) is_stable_revision,
-/* 196 */ (Function) get_dev_revision
+/* 196 */ (Function) get_dev_revision,
+/* 197 */ (Function) bind_freeclient,
+/* 198 */ (Function) unbind_freeclient
 };
 
 static int module_id_counter = 1;
index 447daed1d917ce3155f73a559f35555e33137715..071c1483afd35462ec8f25db331a36a20bc122d4 100644 (file)
@@ -226,6 +226,8 @@ extern int module_id;
 /* 194 */ #define requestInvite ((void (*)(struct UserNode *, struct ChanNode *))global[194])
 /* 195 */ #define is_stable_revision ((const int (*)(void))global[195])
 /* 196 */ #define get_dev_revision ((const char * (*)(void))global[196])
+/* 197 */ #define bind_freeclient ((int (*)(freeclient_func_t *, int))global[197])
+/* 198 */ #define unbind_freeclient ((void (*)(freeclient_func_t *))global[198])
 
 #define MODULE_HEADER(initfunc,startfunc,stopfunc) \
     void **global = NULL; \
index 5455e273d97f36191d6303aef76ab9e4d0fa202d..ec8c2079bb7d674f479a27b03618f55c7be00a00 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "main.h"
 
-#define MODULE_VERSION 6
+#define MODULE_VERSION 7
 
 #ifndef DND_FUNCTIONS
 extern const char *compilation;