projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
29dd2a0
)
added free-client event
author
pk910
<philipp@zoelle1.de>
Fri, 7 Sep 2012 10:09:12 +0000
(12:09 +0200)
committer
pk910
<philipp@zoelle1.de>
Fri, 7 Sep 2012 10:09:12 +0000
(12:09 +0200)
src/ClientSocket.c
patch
|
blob
|
history
src/IRCEvents.c
patch
|
blob
|
history
src/IRCEvents.h
patch
|
blob
|
history
src/modules.c
patch
|
blob
|
history
src/modules/module.h
patch
|
blob
|
history
src/version.h
patch
|
blob
|
history
diff --git
a/src/ClientSocket.c
b/src/ClientSocket.c
index 3c05457da8d90d733a53b891e14fbc6c7d10f75e..cca4bcd7e2890727fef168b13dfa8b84ab393668 100644
(file)
--- a/
src/ClientSocket.c
+++ b/
src/ClientSocket.c
@@
-136,6
+136,7
@@
int destroy_socket(struct ClientSocket *client) {
} else
last_sock = sock;
}
} else
last_sock = sock;
}
+ event_freeclient(client);
free(client->host);
if(client->bind)
free(client->bind);
free(client->host);
if(client->bind)
free(client->bind);
diff --git
a/src/IRCEvents.c
b/src/IRCEvents.c
index fc5053ffa68e4df71a061a3768bd94c3a58076c1..83428c9b31390cbd0853feafb749298ce21d0c6e 100644
(file)
--- a/
src/IRCEvents.c
+++ b/
src/IRCEvents.c
@@
-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_FREEUSER 17
#define BIND_TYPE_FREECHAN 18
#define BIND_TYPE_RELOAD 19
+#define BIND_TYPE_FREECLIENT 20
-#define TOTAL_BIND_TYPES 2
0
+#define TOTAL_BIND_TYPES 2
1
void init_bind() {
if(binds)
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(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))
diff --git
a/src/IRCEvents.h
b/src/IRCEvents.h
index feabf573f2bdbea7d37d7221b0e909458a2e70fc..f78ed91462d882d185b812f63a7273d82ba57ee9 100644
(file)
--- a/
src/IRCEvents.h
+++ b/
src/IRCEvents.h
@@
-163,4
+163,11
@@
typedef int reload_func_t(int initialization);
int event_reload(int initialization);
#endif
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
#endif
diff --git
a/src/modules.c
b/src/modules.c
index 3193c626cfeae2aa5cbd73a9f8736b1502b7805e..0de4505ea9df74c1474f0c7ce95298e0360d59fc 100644
(file)
--- a/
src/modules.c
+++ b/
src/modules.c
@@
-49,6
+49,7
@@
/* 191-193 */ #include "ModuleFunctions.h"
/* 194 */ /* bots.h */
/* 195-196 */ /* version.h */
/* 191-193 */ #include "ModuleFunctions.h"
/* 194 */ /* bots.h */
/* 195-196 */ /* version.h */
+/* 197-198 */ /* IRCEvents.h */
#define Function void *
#define Function void *
@@
-260,7
+261,9
@@
void *global_functions[] = {
/* 193 */ (Function) module_neonbackup_recover_chan,
/* 194 */ (Function) requestInvite,
/* 195 */ (Function) is_stable_revision,
/* 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;
};
static int module_id_counter = 1;
diff --git
a/src/modules/module.h
b/src/modules/module.h
index 447daed1d917ce3155f73a559f35555e33137715..071c1483afd35462ec8f25db331a36a20bc122d4 100644
(file)
--- a/
src/modules/module.h
+++ b/
src/modules/module.h
@@
-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])
/* 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; \
#define MODULE_HEADER(initfunc,startfunc,stopfunc) \
void **global = NULL; \
diff --git
a/src/version.h
b/src/version.h
index 5455e273d97f36191d6303aef76ab9e4d0fa202d..ec8c2079bb7d674f479a27b03618f55c7be00a00 100644
(file)
--- a/
src/version.h
+++ b/
src/version.h
@@
-19,7
+19,7
@@
#include "main.h"
#include "main.h"
-#define MODULE_VERSION
6
+#define MODULE_VERSION
7
#ifndef DND_FUNCTIONS
extern const char *compilation;
#ifndef DND_FUNCTIONS
extern const char *compilation;