-/* IRCEvents.c - NeonServ v5.5
+/* IRCEvents.c - NeonServ v5.6
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
#include "ChanUser.h"
#include "ClientSocket.h"
#include "mysqlConn.h"
+#include "log.h"
struct binding {
void *func;
#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)
if(!is_bound(TYPE, func)) { \
struct binding *cbind = malloc(sizeof(*cbind)); \
if (!cbind) { \
- perror("malloc() failed"); \
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__); \
return 0; \
} \
cbind->func = func; \
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 ClientSocket *client), (client))