added new multi log system
[NeonServV5.git] / src / modules / module.h
index 7cc075ff0aca2fa47c243adf62034e4c7e801a7b..1b9dac7a55d75aa244c732b4ac012c004e57a235 100644 (file)
@@ -1,4 +1,4 @@
-/* module.h - NeonServ v5.4
+/* module.h - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -20,6 +20,7 @@
 #include "../overall.h"
 #include "../version.h"
 #include "../mysqlConn.h"
+#include "../log.h"
 
 extern void **global;
 extern int module_id;
@@ -27,15 +28,15 @@ extern int module_id;
 /**** global function list ****/
 /* 000 */ #define getStartTime ((time_t (*)(void))global[0])
 /* 001 */ #define getRunningThreads ((int (*)(void))global[1])
-/* 002 */ #define exit_daemon ((int (*)(void))global[2])
+/* 002 */ #define getCurrentSecondsOfDay ((int (*)(void))global[2])
 /* 003 */ #define stricmp ((int (*)(const char *, const char *))global[3])
 /* 004 */ #define stricmplen ((int (*)(const char *, const char *, int))global[4])
-/* 005 */ #define restart_process ((void (*)(void))global[5])
-/* 006 */ #define cleanup ((void (*)(void))global[6])
+/* 005 */ /* deprecated */
+/* 006 */ /* deprecated */
 /* 007 */ #define restart_bot ((void (*)(int))global[7])
 /* 008 */ #define stop_bot ((void (*)(void))global[8])
 /* 009 */ #define reload_config ((void (*)(void))global[9])
-/* 010 */ #define putlog ((void (*)(int, const char *, ...))global[10])
+/* 010 */ #define printf_log ((void (*)(char *, int, const char *, ...))global[10])
 #ifdef HAVE_THREADS
 /* 011 */ #define getCurrentThreadID ((int (*)(void))global[11])
 #endif
@@ -58,9 +59,9 @@ extern int module_id;
 /* 028 */ #define getChannelUsers ((struct ChanUser* (*)(struct ChanNode *, struct ChanUser *))global[28])
 /* 029 */ #define getUserChannels ((struct ChanUser* (*)(struct UserNode *, struct ChanUser *))global[29])
 /* 030 */ #define create_socket ((struct ClientSocket* (*)(char *, int, char *, char *, char *, char *, char *))global[30])
-/* 031 */ #define connect_socket ((int (*)(struct ClientSocket *))global[31])
+/* 031 */ #define connect_socket ((void (*)(struct ClientSocket *))global[31])
 /* 032 */ #define close_socket ((int (*)(struct ClientSocket *))global[32])
-/* 033 */ #define disconnect_socket ((int (*)(struct ClientSocket *))global[33])
+/* 033 */ #define destroy_socket ((int (*)(struct ClientSocket *))global[33])
 /* 034 */ #define write_socket ((int (*)(struct ClientSocket *, char*, int))global[34])
 /* 035 */ #define putsock ((void (*)(struct ClientSocket *, const char *, ...))global[35])
 /* 036 */ #define getBots ((struct ClientSocket* (*)(int, struct ClientSocket *))global[36])
@@ -84,8 +85,8 @@ extern int module_id;
 /* 054 */ #define unbind_nick ((void (*)(nick_func_t *))global[54])
 /* 055 */ #define bind_part ((int (*)(part_func_t *, int))global[55])
 /* 056 */ #define unbind_part ((void (*)(part_func_t *))global[56])
-/* 057 */ /* deprecated */
-/* 058 */ /* deprecated */
+/* 057 */ #define bind_reload ((int (*)(reload_func_t *, int))global[57])
+/* 058 */ #define unbind_reload ((void (*)(reload_func_t *))global[58])
 /* 059 */ #define bind_kick ((int (*)(kick_func_t *, int))global[59])
 /* 060 */ #define unbind_kick ((void (*)(kick_func_t *))global[60])
 /* 061 */ #define bind_topic ((int (*)(topic_func_t *, int))global[61])
@@ -224,8 +225,12 @@ extern int module_id;
 /* 192 */ #define module_global_cmd_unregister_neonbackup ((void (*)(char *))global[192])
 /* 193 */ #define module_neonbackup_recover_chan ((void (*)(struct ChanNode *))global[193])
 /* 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,loopfunc,stopfunc) \
+#define MODULE_HEADER(initfunc,startfunc,stopfunc) \
     void **global = NULL; \
     int module_id = 0; \
     int init_module(void **functions, int modid) { \
@@ -236,9 +241,6 @@ extern int module_id;
     void start_module(int type) { \
         startfunc(type); \
     } \
-    void loop_module() { \
-        loopfunc(); \
-    } \
     void stop_module(int type) { \
         stopfunc(type); \
     } \