From: pk910 Date: Sun, 12 Feb 2012 09:44:58 +0000 (+0100) Subject: multiple fixes X-Git-Tag: v5.3~14 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=902ebfe5551be2daa3edf8141bcee91f62c0a5e0 multiple fixes --- diff --git a/Makefile.am b/Makefile.am index 5c9fc52..43a2122 100644 --- a/Makefile.am +++ b/Makefile.am @@ -153,13 +153,13 @@ neonserv_SOURCES = src/version.c \ src/timeq.c \ src/DBHelper.c \ src/IRCQueue.c \ - src/commands.c \ src/bots.c \ src/ConfigParser.c \ src/QServer.c \ + src/modules.c \ src/memoryDebug.c -neonserv_LDADD = $(MYSQL_LIBS) $(WINSOCK_LIBS) +neonserv_LDADD = $(MYSQL_LIBS) $(WINSOCK_LIBS) -ldl install-exec-local: $(INSTALL) -d -m 755 $(prefix) diff --git a/src/ChanNode.c b/src/ChanNode.c index 528d441..1431597 100644 --- a/src/ChanNode.c +++ b/src/ChanNode.c @@ -20,7 +20,6 @@ #include "BanNode.h" #include "modcmd.h" #include "ModeNode.h" -#include "bot_NeonSpam.h" #include "IRCEvents.h" static struct ChanNode **chanList; @@ -231,8 +230,6 @@ void freeChanNode(struct ChanNode* chan) { freeModeNode(chan->modes); if(chan->bans) removeChannelBans(chan); - if(chan->spam_settings) - freeNeonSpamSettings(chan->spam_settings); free(chan); } diff --git a/src/ConfigParser.c b/src/ConfigParser.c index 8ce6cde..bbf4791 100644 --- a/src/ConfigParser.c +++ b/src/ConfigParser.c @@ -299,6 +299,52 @@ char *get_string_field(char *field_path) { return NULL; } +char **get_all_fieldnames(char *block_path) { + struct ConfigEntry *centry = root_entry; + char *a, *b = block_path; + struct ConfigEntry *subentry; + while((a = strstr(b, ".")) && centry) { + if(centry->type == ENTRYTYPE_BLOCK) { + int found = 0; + for(subentry = centry->value; subentry; subentry = subentry->next) { + if(!stricmplen(subentry->name, b, a-b)) { + centry = subentry; + found = 1; + break; + } + } + if(!found) + return NULL; + } else + return NULL; + b = a+1; + } + if(centry->type == ENTRYTYPE_BLOCK) { + int found = 0; + for(subentry = centry->value; subentry; subentry = subentry->next) { + if(!stricmp(subentry->name, b)) { + centry = subentry; + found = 1; + break; + } + } + if(!found) + return NULL; + } else + return NULL; + if(centry->type != ENTRYTYPE_BLOCK) return NULL; + int count = 0; + for(subentry = centry->value; subentry; subentry = subentry->next) { + count++; + } + char **fieldnames = calloc(count+1, sizeof(char *)); + count = 0; + for(subentry = centry->value; subentry; subentry = subentry->next) { + fieldnames[count++] = subentry->name; + } + return fieldnames; +} + void free_loaded_config() { if(root_entry) { free_entry_rekursiv(root_entry, 1); diff --git a/src/ConfigParser.h b/src/ConfigParser.h index fb529da..ea5a1b5 100644 --- a/src/ConfigParser.h +++ b/src/ConfigParser.h @@ -23,6 +23,7 @@ int loadConfig(const char *filename); /* MODULAR ACCESSIBLE */ int get_int_field(char *field_path); /* MODULAR ACCESSIBLE */ char *get_string_field(char *field_path); +char **get_all_fieldnames(char *block_path); void free_loaded_config(); #endif #endif diff --git a/src/DBHelper.c b/src/DBHelper.c index 9fa6c1c..2003715 100644 --- a/src/DBHelper.c +++ b/src/DBHelper.c @@ -287,7 +287,7 @@ static int event_user_registered(struct UserNode *old_user, struct UserNode *new } cache->new_user = new_user; cache->oldauth = strdup(oldauth); - lookup_authname(newauth, event_user_registered_auth_lookup, cache); + lookup_authname(newauth, 0, event_user_registered_auth_lookup, cache); } return 1; } @@ -343,6 +343,6 @@ void deleteUser(int userid) { } void init_DBHelper() { - bind_registered(event_user_registered); + bind_registered(event_user_registered, 0); } diff --git a/src/HandleInfoHandler.c b/src/HandleInfoHandler.c index 6e5415f..c6a2efe 100644 --- a/src/HandleInfoHandler.c +++ b/src/HandleInfoHandler.c @@ -21,6 +21,7 @@ #include "ChanNode.h" #include "IRCEvents.h" #include "tools.h" +#include "modules.h" #define AUTHSERV_NICK "AuthServ" @@ -29,6 +30,7 @@ struct HandleInfoQueueEntry { char *auth; void *callback[MAXCALLBACKS]; + int module_id[MAXCALLBACKS]; void *data[MAXCALLBACKS]; struct HandleInfoQueueEntry *next; @@ -79,7 +81,7 @@ void clear_handleinfoqueue(struct ClientSocket *client) { DESYNCHRONIZE(cache_sync); } -void lookup_authname(char *auth, authlookup_callback_t callback, void *data) { +void lookup_authname(char *auth, int module_id, authlookup_callback_t callback, void *data) { struct ClientSocket *bot; struct HandleInfoQueueEntry* entry; for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) { @@ -89,6 +91,7 @@ void lookup_authname(char *auth, authlookup_callback_t callback, void *data) { for(i = 1; i < MAXCALLBACKS; i++) { if(!entry->callback[i]) { entry->callback[i] = callback; + entry->module_id[i] = module_id; entry->data[i] = data; return; } @@ -103,6 +106,7 @@ void lookup_authname(char *auth, authlookup_callback_t callback, void *data) { int i; entry->auth = strdup(auth); entry->callback[0] = callback; + entry->module_id[0] = module_id; for(i = 1; i < MAXCALLBACKS; i++) entry->callback[i] = NULL; entry->data[0] = data; @@ -224,7 +228,8 @@ static void recv_notice(struct UserNode *user, struct UserNode *target, char *me for(i = 0; i < MAXCALLBACKS; i++) { callback = entry->callback[i]; if(!callback) break; - callback(entry->auth, exists, registered, entry->data[i]); + if(!entry->module_id[i] || module_loaded(entry->module_id[i])) + callback(entry->auth, exists, registered, entry->data[i]); } free(entry->auth); free(entry); @@ -233,7 +238,7 @@ static void recv_notice(struct UserNode *user, struct UserNode *target, char *me } void init_handleinfohandler() { - bind_privnotice(recv_notice); + bind_privnotice(recv_notice, 0); } void free_handleinfohandler() { diff --git a/src/HandleInfoHandler.h b/src/HandleInfoHandler.h index c44b9a1..e77c494 100644 --- a/src/HandleInfoHandler.h +++ b/src/HandleInfoHandler.h @@ -27,7 +27,7 @@ typedef AUTHLOOKUP_CALLBACK(authlookup_callback_t); #ifndef DND_FUNCTIONS void clear_handleinfoqueue(struct ClientSocket *client); -/* MODULAR ACCESSIBLE */ void lookup_authname(char *auth, authlookup_callback_t callback, void *data); +/* MODULAR ACCESSIBLE */ void lookup_authname(char *auth, int module_id, authlookup_callback_t callback, void *data); void init_handleinfohandler(); void free_handleinfohandler(); #endif diff --git a/src/IRCEvents.c b/src/IRCEvents.c index 9e0222b..b0cbd02 100644 --- a/src/IRCEvents.c +++ b/src/IRCEvents.c @@ -104,7 +104,7 @@ int bind_##NAME(FUNCTYPE *func, int module_id) { \ return 0; \ } \ cbind->func = func; \ - cbind->module_id = module_id \ + cbind->module_id = module_id; \ cbind->next = binds[TYPE]; \ binds[TYPE] = cbind; \ return 1; \ diff --git a/src/IRCParser.c b/src/IRCParser.c index b6fc71e..17aeef4 100644 --- a/src/IRCParser.c +++ b/src/IRCParser.c @@ -214,7 +214,7 @@ static IRC_CMD(raw_join) { //request member list chan->chanbot = user; struct ChanUser *chanuser = addChanUser(chan, user); //it must be a bot - get_userlist_with_invisible(chan, got_channel_userlist, chanuser); + get_userlist_with_invisible(chan, 0, got_channel_userlist, chanuser); putsock(client, "MODE %s", chan->name); putsock(client, "MODE %s +b", chan->name); } else if(!isUserOnChan(user, chan) && ((chan->flags & CHANFLAG_RECEIVED_USERLIST) || isBot(user))) { diff --git a/src/QServer.c b/src/QServer.c index f8a98a1..795650b 100644 --- a/src/QServer.c +++ b/src/QServer.c @@ -291,7 +291,7 @@ static void qserver_parse_U(struct QServerClient *client, char **argv, int argc) } client->references++; client->flags |= QSERVER_FLAG_IN_USE; - get_userauth(cuser, qserver_parse_U_async, client); + get_userauth(cuser, 0, qserver_parse_U_async, client); } static USERAUTH_CALLBACK(qserver_parse_U_async) { @@ -348,7 +348,7 @@ static void qserver_parse_ACU(struct QServerClient *client, char **argv, int arg if(argc > 1 && !stricmp(argv[1], "1")) { client->references++; client->flags |= QSERVER_FLAG_IN_USE; - get_userlist_if_invisible(chan, qserver_parse_ACU_async, client); + get_userlist_if_invisible(chan, 0, qserver_parse_ACU_async, client); return; } char tmpStr[6]; diff --git a/src/UserNode.h b/src/UserNode.h index fb1afc1..5986596 100644 --- a/src/UserNode.h +++ b/src/UserNode.h @@ -73,7 +73,7 @@ void free_UserNode(); /* MODULAR ACCESSIBLE */ int getUserCount(); struct UserNode* addUser(const char *nick); struct UserNode* addUserMask(const char *mask); -struct UserNode* createTempUser(const char *nick); +/* MODULAR ACCESSIBLE */ struct UserNode* createTempUser(const char *nick); struct UserNode* createTempUserMask(const char *mask); int renameUser(struct UserNode* user, const char *new_nick); void delUser(struct UserNode* user, int freeUser); diff --git a/src/bots.c b/src/bots.c index 994dbba..76fd9e6 100644 --- a/src/bots.c +++ b/src/bots.c @@ -26,11 +26,6 @@ #include "modcmd.h" #include "DBHelper.h" -#include "bot_NeonServ.h" -#include "bot_NeonSpam.h" -#include "bot_DummyServ.h" -#include "bot_NeonHelp.h" - struct cmd_bot_alias { int botid; char *alias; @@ -100,7 +95,7 @@ static void zero_bots_trigger_callback(int clientid, struct ChanNode *chan, char void init_bots() { set_bot_alias(0, "0"); start_zero_bots(); - set_trigger_callback(0, zero_bots_trigger_callback); + set_trigger_callback(0, 0, zero_bots_trigger_callback); MYSQL_RES *res; MYSQL_ROW row; @@ -111,7 +106,7 @@ void init_bots() { while ((row = mysql_fetch_row(res)) != NULL) { if(atol(row[1]) - time(0) > 0) { sprintf(nameBuf, "ban_%s", row[0]); - timeq_add_name(nameBuf, atol(row[1]) - time(0), channel_ban_timeout, strdup(row[0])); + timeq_add_name(nameBuf, atol(row[1]) - time(0), 0, channel_ban_timeout, strdup(row[0])); } else { //timed out printf_mysql_query("DELETE FROM `bans` WHERE `ban_id` = '%s'", row[0]); diff --git a/src/main.c b/src/main.c index 0ca3d31..74fd93c 100644 --- a/src/main.c +++ b/src/main.c @@ -34,11 +34,11 @@ #include "ModeNode.h" #include "IRCQueue.h" #include "DBHelper.h" -#include "commands.h" #include "ConfigParser.h" #include "ssl.h" #include "QServer.h" #include "version.h" +#include "modules.h" time_t start_time; static int running, hard_restart; @@ -282,7 +282,7 @@ main: init_modcmd(); init_handleinfohandler(); init_tools(); - + loadModules(); init_bots(); init_DBHelper(); qserver_init(); @@ -457,7 +457,7 @@ TIMEQ_CALLBACK(main_checkauths) { if ((row = mysql_fetch_row(res)) != NULL) { lastcheck = atoi(row[1]); if(!lastcheck || unixtime - lastcheck >= min_unckecked) { - lookup_authname(row[0], main_checkauths_callback, NULL); + lookup_authname(row[0], 0, main_checkauths_callback, NULL); } else next_call = 300; } diff --git a/src/modcmd.c b/src/modcmd.c index 7ba0b93..0bfe56d 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -369,7 +369,7 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s data->args_buffer = args_buffer; data->cbind = cbind; data->textclient = tmp_text_client; - get_userauth(user, command_checked_auth, data); + get_userauth(user, 0, command_checked_auth, data); return; } else handle_command_async(client, user, chan, sent_chan, cbind, argv, argc); @@ -827,10 +827,10 @@ struct ClientSocket *getTextBot() { void init_modcmd() { cmd_binds = calloc(27, sizeof(*cmd_binds)); - bind_chanmsg(got_chanmsg); - bind_privmsg(got_privmsg); + bind_chanmsg(got_chanmsg, 0); + bind_privmsg(got_privmsg, 0); register_default_language_table(msgtab); - register_command(0, "linker", modcmd_linker, 0, 0, 0, 0); //fake command for subcommands + register_command(0, "linker", 0, modcmd_linker, 0, 0, 0, 0); //fake command for subcommands } void free_modcmd() { diff --git a/src/modules.c b/src/modules.c index 0c2034e..b8d3fec 100644 --- a/src/modules.c +++ b/src/modules.c @@ -15,6 +15,7 @@ * along with this program. If not, see . */ #include "modules.h" +#include /* 000-011 */ #include "main.h" /* 012 */ #include "BanNode.h" @@ -38,209 +39,213 @@ /* 137-142 */ #include "mysqlConn.h" /* 143-149 */ #include "timeq.h" /* 150-169 */ #include "tools.h" -/* 170-178 */ #include "UserNode.h" -/* 179 */ #include "version.h" -/* 180-182 */ #include "WHOHandler.h" +/* 170-180 */ #include "UserNode.h" +/* 181-183 */ #include "WHOHandler.h" +/* 184-188 */ #include "version.h" -void **global_functions = { -/* 000 */ getStartTime, -/* 001 */ getRunningThreads, -/* 002 */ exit_daemon, -/* 003 */ stricmp, -/* 004 */ stricmplen, -/* 005 */ restart_process, -/* 006 */ cleanup, -/* 007 */ restart_bot, -/* 008 */ stop_bot, -/* 009 */ reload_config, -/* 010 */ putlog, +#define Function void * + +void *global_functions[] = { +/* 000 */ (Function) getStartTime, +/* 001 */ (Function) getRunningThreads, +/* 002 */ (Function) exit_daemon, +/* 003 */ (Function) stricmp, +/* 004 */ (Function) stricmplen, +/* 005 */ (Function) restart_process, +/* 006 */ (Function) cleanup, +/* 007 */ (Function) restart_bot, +/* 008 */ (Function) stop_bot, +/* 009 */ (Function) reload_config, +/* 010 */ (Function) putlog, #ifdef HAVE_THREADS -/* 011 */ getCurrentThreadID, +/* 011 */ (Function) getCurrentThreadID, #else -/* 011 */ NULL, +/* 011 */ (Function) NULL, #endif -/* 012 */ getMatchingChannelBan, -/* 013 */ getChannelBot, -/* 014 */ requestOp, -/* 015 */ channel_ban_timeout, -/* 016 */ general_event_privctcp, -/* 017 */ set_bot_alias, -/* 018 */ resolve_botid, -/* 019 */ resolve_botalias, -/* 020 */ is_valid_chan, -/* 021 */ getAllChans, -/* 022 */ getChanByName, -/* 023 */ getChannelCount, -/* 024 */ getChanUserCount, -/* 025 */ getChanBanCount, -/* 026 */ isUserOnChan, -/* 027 */ getChanUser, -/* 028 */ getChannelUsers, -/* 029 */ getUserChannels, -/* 030 */ create_socket, -/* 031 */ connect_socket, -/* 032 */ close_socket, -/* 033 */ disconnect_socket, -/* 034 */ write_socket, -/* 035 */ putsock, -/* 036 */ getBots, -/* 037 */ get_int_field, -/* 038 */ get_string_field, -/* 039 */ _loadUserSettings, -/* 040 */ isGodMode, -/* 041 */ getChanDefault, -/* 042 */ getChannelAccess, -/* 043 */ checkChannelAccess, -/* 044 */ _loadChannelSettings, -/* 045 */ isUserProtected, -/* 046 */ getBanAffectingMask, -/* 047 */ renameAccount, -/* 048 */ deleteUser, -/* 049 */ logEvent, -/* 050 */ lookup_authname, -/* 051 */ bind_join, -/* 052 */ unbind_join, -/* 053 */ bind_nick, -/* 054 */ unbind_nick, -/* 055 */ bind_part, -/* 056 */ unbind_part, -/* 057 */ bind_quit, -/* 058 */ unbind_quit, -/* 059 */ bind_kick, -/* 060 */ unbind_kick, -/* 061 */ bind_topic, -/* 062 */ unbind_topic, -/* 063 */ bind_mode, -/* 064 */ unbind_mode, -/* 065 */ bind_chanmsg, -/* 066 */ unbind_chanmsg, -/* 067 */ bind_privmsg, -/* 068 */ unbind_privmsg, -/* 069 */ bind_channotice, -/* 070 */ unbind_channotice, -/* 071 */ bind_privnotice, -/* 072 */ unbind_privnotice, -/* 073 */ bind_chanctcp, -/* 074 */ unbind_chanctcp, -/* 075 */ bind_privctcp, -/* 076 */ unbind_privctcp, -/* 077 */ bind_invite, -/* 078 */ unbind_invite, -/* 079 */ bind_raw, -/* 080 */ unbind_raw, -/* 081 */ bind_bot_ready, -/* 082 */ unbind_bot_ready, -/* 083 */ bind_registered, -/* 084 */ unbind_registered, -/* 085 */ bind_freeuser, -/* 086 */ unbind_freeuser, -/* 087 */ bind_freechan, -/* 088 */ unbind_freechan, -/* 089 */ reply, -/* 090 */ merge_argv, -/* 091 */ merge_argv_char, -/* 092 */ get_language_by_tag, -/* 093 */ get_language_by_name, -/* 094 */ get_default_language, -/* 095 */ load_language, -/* 096 */ register_default_language_table, -/* 097 */ get_language_string, -/* 098 */ build_language_string, +/* 012 */ (Function) getMatchingChannelBan, +/* 013 */ (Function) getChannelBot, +/* 014 */ (Function) requestOp, +/* 015 */ (Function) channel_ban_timeout, +/* 016 */ (Function) general_event_privctcp, +/* 017 */ (Function) set_bot_alias, +/* 018 */ (Function) resolve_botid, +/* 019 */ (Function) resolve_botalias, +/* 020 */ (Function) is_valid_chan, +/* 021 */ (Function) getAllChans, +/* 022 */ (Function) getChanByName, +/* 023 */ (Function) getChannelCount, +/* 024 */ (Function) getChanUserCount, +/* 025 */ (Function) getChanBanCount, +/* 026 */ (Function) isUserOnChan, +/* 027 */ (Function) getChanUser, +/* 028 */ (Function) getChannelUsers, +/* 029 */ (Function) getUserChannels, +/* 030 */ (Function) create_socket, +/* 031 */ (Function) connect_socket, +/* 032 */ (Function) close_socket, +/* 033 */ (Function) disconnect_socket, +/* 034 */ (Function) write_socket, +/* 035 */ (Function) putsock, +/* 036 */ (Function) getBots, +/* 037 */ (Function) get_int_field, +/* 038 */ (Function) get_string_field, +/* 039 */ (Function) _loadUserSettings, +/* 040 */ (Function) isGodMode, +/* 041 */ (Function) getChanDefault, +/* 042 */ (Function) getChannelAccess, +/* 043 */ (Function) checkChannelAccess, +/* 044 */ (Function) _loadChannelSettings, +/* 045 */ (Function) isUserProtected, +/* 046 */ (Function) getBanAffectingMask, +/* 047 */ (Function) renameAccount, +/* 048 */ (Function) deleteUser, +/* 049 */ (Function) logEvent, +/* 050 */ (Function) lookup_authname, +/* 051 */ (Function) bind_join, +/* 052 */ (Function) unbind_join, +/* 053 */ (Function) bind_nick, +/* 054 */ (Function) unbind_nick, +/* 055 */ (Function) bind_part, +/* 056 */ (Function) unbind_part, +/* 057 */ (Function) bind_quit, +/* 058 */ (Function) unbind_quit, +/* 059 */ (Function) bind_kick, +/* 060 */ (Function) unbind_kick, +/* 061 */ (Function) bind_topic, +/* 062 */ (Function) unbind_topic, +/* 063 */ (Function) bind_mode, +/* 064 */ (Function) unbind_mode, +/* 065 */ (Function) bind_chanmsg, +/* 066 */ (Function) unbind_chanmsg, +/* 067 */ (Function) bind_privmsg, +/* 068 */ (Function) unbind_privmsg, +/* 069 */ (Function) bind_channotice, +/* 070 */ (Function) unbind_channotice, +/* 071 */ (Function) bind_privnotice, +/* 072 */ (Function) unbind_privnotice, +/* 073 */ (Function) bind_chanctcp, +/* 074 */ (Function) unbind_chanctcp, +/* 075 */ (Function) bind_privctcp, +/* 076 */ (Function) unbind_privctcp, +/* 077 */ (Function) bind_invite, +/* 078 */ (Function) unbind_invite, +/* 079 */ (Function) bind_raw, +/* 080 */ (Function) unbind_raw, +/* 081 */ (Function) bind_bot_ready, +/* 082 */ (Function) unbind_bot_ready, +/* 083 */ (Function) bind_registered, +/* 084 */ (Function) unbind_registered, +/* 085 */ (Function) bind_freeuser, +/* 086 */ (Function) unbind_freeuser, +/* 087 */ (Function) bind_freechan, +/* 088 */ (Function) unbind_freechan, +/* 089 */ (Function) reply, +/* 090 */ (Function) merge_argv, +/* 091 */ (Function) merge_argv_char, +/* 092 */ (Function) get_language_by_tag, +/* 093 */ (Function) get_language_by_name, +/* 094 */ (Function) get_default_language, +/* 095 */ (Function) load_language, +/* 096 */ (Function) register_default_language_table, +/* 097 */ (Function) get_language_string, +/* 098 */ (Function) build_language_string, #ifdef ENABLE_MEMORY_DEBUG -/* 099 */ xmalloc, -/* 100 */ xcalloc, -/* 101 */ xstrdup, -/* 102 */ xfree, +/* 099 */ (Function) xmalloc, +/* 100 */ (Function) xcalloc, +/* 101 */ (Function) xstrdup, +/* 102 */ (Function) xfree, #else -/* 099 */ NULL, -/* 100 */ NULL, -/* 101 */ NULL, -/* 102 */ NULL, +/* 099 */ (Function) NULL, +/* 100 */ (Function) NULL, +/* 101 */ (Function) NULL, +/* 102 */ (Function) NULL, #endif -/* 103 */ getMemoryInfoFiles, -/* 104 */ freeMemoryInfoFiles, -/* 105 */ getMemoryInfoLines, -/* 106 */ freeMemoryInfoLines, -/* 107 */ get_botwise_prefered_bot, -/* 108 */ register_command, -/* 109 */ set_trigger_callback, -/* 110 */ flush_trigger_cache, -/* 111 */ changeBotwiseChannelTrigger, -/* 112 */ bind_botwise_cmd_to_function, -/* 113 */ bind_botwise_cmd_to_command, -/* 114 */ unbind_botwise_cmd, -/* 115 */ unbind_botwise_allcmd, -/* 116 */ bind_botwise_set_parameters, -/* 117 */ bind_botwise_set_global_access, -/* 118 */ bind_botwise_set_channel_access, -/* 119 */ bind_botwise_set_bind_flags, -/* 120 */ find_botwise_cmd_binding, -/* 121 */ bind_botwise_unbound_required_functions, -/* 122 */ find_cmd_function, -/* 123 */ getTextBot, -/* 124 */ register_command_alias, -/* 125 */ getAllBinds, -/* 126 */ createModeNode, -/* 127 */ freeModeNode, -/* 128 */ isModeSet, -/* 129 */ isModeAffected, -/* 130 */ getModeValue, -/* 131 */ getModeType, -/* 132 */ parseModes, -/* 133 */ parseModeString, -/* 134 */ parseMode, -/* 135 */ getModeString, -/* 136 */ getFullModeString, -/* 137 */ mysql_use, -/* 138 */ mysql_free, -/* 139 */ printf_mysql_query, -/* 140 */ printf_long_mysql_query, -/* 141 */ escape_string, -/* 142 */ get_mysql_conn, -/* 143 */ timeq_add, -/* 144 */ timeq_uadd, -/* 145 */ timeq_add_name, -/* 146 */ timeq_uadd_name, -/* 147 */ timeq_del, -/* 148 */ timeq_del_name, -/* 149 */ timeq_name_exists, -/* 150 */ match, -/* 151 */ table_init, -/* 152 */ table_add, -/* 153 */ table_change, -/* 154 */ table_change_field, -/* 155 */ table_set_bold, -/* 156 */ table_end, -/* 157 */ table_free, -/* 158 */ timeToStr, -/* 159 */ strToTime, -/* 160 */ initModeBuffer, -/* 161 */ modeBufferSet, -/* 162 */ flushModeBuffer, -/* 163 */ freeModeBuffer, -/* 164 */ is_ircmask, -/* 165 */ generate_banmask, -/* 166 */ make_banmask, -/* 167 */ isFakeHost, -/* 168 */ mask_match, -/* 169 */ crc32, -/* 170 */ is_valid_nick, -/* 171 */ getUserByNick, -/* 172 */ getUserByMask, -/* 173 */ countUsersWithHost, -/* 174 */ getAuthFakehost, -/* 175 */ searchUserByNick, -/* 176 */ getAllUsers, -/* 177 */ getUsersWithAuth, -/* 178 */ getUserCount, -/* 179 */ get_userlist, -/* 180 */ _get_userlist_with_invisible, -/* 181 */ get_userauth, -/* 182 */ &compilation, -/* 183 */ &creation, -/* 184 */ &revision, -/* 185 */ &codelines, -/* 186 */ &patchlevel +/* 103 */ (Function) getMemoryInfoFiles, +/* 104 */ (Function) freeMemoryInfoFiles, +/* 105 */ (Function) getMemoryInfoLines, +/* 106 */ (Function) freeMemoryInfoLines, +/* 107 */ (Function) get_botwise_prefered_bot, +/* 108 */ (Function) register_command, +/* 109 */ (Function) set_trigger_callback, +/* 110 */ (Function) flush_trigger_cache, +/* 111 */ (Function) changeBotwiseChannelTrigger, +/* 112 */ (Function) bind_botwise_cmd_to_function, +/* 113 */ (Function) bind_botwise_cmd_to_command, +/* 114 */ (Function) unbind_botwise_cmd, +/* 115 */ (Function) unbind_botwise_allcmd, +/* 116 */ (Function) bind_botwise_set_parameters, +/* 117 */ (Function) bind_botwise_set_global_access, +/* 118 */ (Function) bind_botwise_set_channel_access, +/* 119 */ (Function) bind_botwise_set_bind_flags, +/* 120 */ (Function) find_botwise_cmd_binding, +/* 121 */ (Function) bind_botwise_unbound_required_functions, +/* 122 */ (Function) find_cmd_function, +/* 123 */ (Function) getTextBot, +/* 124 */ (Function) register_command_alias, +/* 125 */ (Function) getAllBinds, +/* 126 */ (Function) createModeNode, +/* 127 */ (Function) freeModeNode, +/* 128 */ (Function) isModeSet, +/* 129 */ (Function) isModeAffected, +/* 130 */ (Function) getModeValue, +/* 131 */ (Function) getModeType, +/* 132 */ (Function) parseModes, +/* 133 */ (Function) parseModeString, +/* 134 */ (Function) parseMode, +/* 135 */ (Function) getModeString, +/* 136 */ (Function) getFullModeString, +/* 137 */ (Function) mysql_use, +/* 138 */ (Function) mysql_free, +/* 139 */ (Function) printf_mysql_query, +/* 140 */ (Function) printf_long_mysql_query, +/* 141 */ (Function) escape_string, +/* 142 */ (Function) get_mysql_conn, +/* 143 */ (Function) timeq_add, +/* 144 */ (Function) timeq_uadd, +/* 145 */ (Function) timeq_add_name, +/* 146 */ (Function) timeq_uadd_name, +/* 147 */ (Function) timeq_del, +/* 148 */ (Function) timeq_del_name, +/* 149 */ (Function) timeq_name_exists, +/* 150 */ (Function) match, +/* 151 */ (Function) table_init, +/* 152 */ (Function) table_add, +/* 153 */ (Function) table_change, +/* 154 */ (Function) table_change_field, +/* 155 */ (Function) table_set_bold, +/* 156 */ (Function) table_end, +/* 157 */ (Function) table_free, +/* 158 */ (Function) timeToStr, +/* 159 */ (Function) strToTime, +/* 160 */ (Function) initModeBuffer, +/* 161 */ (Function) modeBufferSet, +/* 162 */ (Function) flushModeBuffer, +/* 163 */ (Function) freeModeBuffer, +/* 164 */ (Function) is_ircmask, +/* 165 */ (Function) generate_banmask, +/* 166 */ (Function) make_banmask, +/* 167 */ (Function) isFakeHost, +/* 168 */ (Function) mask_match, +/* 169 */ (Function) crc32, +/* 170 */ (Function) is_valid_nick, +/* 171 */ (Function) getUserByNick, +/* 172 */ (Function) getUserByMask, +/* 173 */ (Function) countUsersWithHost, +/* 174 */ (Function) getAuthFakehost, +/* 175 */ (Function) searchUserByNick, +/* 176 */ (Function) getAllUsers, +/* 177 */ (Function) getUsersWithAuth, +/* 178 */ (Function) getUserCount, +/* 179 */ (Function) createTempUser, +/* 180 */ (Function) createTempUserMask, +/* 181 */ (Function) get_userlist, +/* 182 */ (Function) _get_userlist_with_invisible, +/* 183 */ (Function) get_userauth, +/* 184 */ (Function) get_compilation, +/* 185 */ (Function) get_creation, +/* 186 */ (Function) get_revision, +/* 187 */ (Function) get_codelines, +/* 188 */ (Function) get_patchlevel }; #define MODINFO_STATE_STARTED 0x01 @@ -258,21 +263,35 @@ struct ModuleInfo { void *loopfunc; void *stopfunc; struct ModuleInfo *next; -} +}; static int module_id_counter = 1; static struct ModuleInfo *modules = NULL; static void unregister_module_hooks(int module_id); +void loadModules() { + char **modulelist = get_all_fieldnames("modules"); + int i = 0; + while(*modulelist[i]) { + loadModule(modulelist[i]); + i++; + } + start_modules(); +} + int loadModule(char *name) { char fname[256]; #ifndef WIN32 - sprintf(fname, "%s.so", name); + sprintf(fname, "%s.a", name); void* module = dlopen(fname, RTLD_LAZY); if(!module) { - putlog(LOGLEVEL_ERROR, "Error loading module '%s': %s not found.", name, fname); - return 0; + sprintf(fname, ".libs/%s.a", name); + module = dlopen(fname, RTLD_LAZY); + if(!module) { + putlog(LOGLEVEL_ERROR, "Error loading module '%s': %s not found.\n", name, fname); + return 0; + } } void* initfunc = dlsym(module, "init_module"); void* startfunc = dlsym(module, "start_module"); @@ -283,7 +302,7 @@ int loadModule(char *name) { sprintf(fname, "%s.dll", name); HMODULE module = LoadLibrary(fname); if(!module) { - putlog(LOGLEVEL_ERROR, "Error loading module '%s': %s not found.", name, fname); + putlog(LOGLEVEL_ERROR, "Error loading module '%s': %s not found.\n", name, fname); return 0; } FARPROC initfunc = GetProcAddress(module, "init_module"); @@ -293,19 +312,19 @@ int loadModule(char *name) { FARPROC modversion = GetProcAddress(module, "modversion"); #endif if(!startfunc || !loopfunc || !stopfunc || !modversion) { - putlog(LOGLEVEL_ERROR, "Error loading module '%s': required symbols not found.", name); + putlog(LOGLEVEL_ERROR, "Error loading module '%s': required symbols not found.\n", name); return 0; } int version = ((int (*)(void)) modversion)(); if(version != MODULE_VERSION) { - putlog(LOGLEVEL_ERROR, "Error loading module '%s': version mismatch ('%d' main code, '%d' module)", name, MODULE_VERSION, version); + putlog(LOGLEVEL_ERROR, "Error loading module '%s': version mismatch ('%d' main code, '%d' module)\n", name, MODULE_VERSION, version); return 0; } //start module int errid; int module_id = module_id_counter++; if((errid = ((int (*)(void **, int)) initfunc)(global_functions, module_id))) { - putlog(LOGLEVEL_ERROR, "Error loading module '%s': module reported error (errid: %d)", name, errid); + putlog(LOGLEVEL_ERROR, "Error loading module '%s': module reported error (errid: %d)\n", name, errid); return 0; } struct ModuleInfo *modinfo = malloc(sizeof(*modinfo)); @@ -337,27 +356,30 @@ static void closemodule(HMODULE module) { int reload_module(char *name) { struct ModuleInfo *old_modinfo, *old_prev = NULL; for(old_modinfo = modules; old_modinfo; old_modinfo = old_modinfo->next) { - if(old_prev) - old_prev->next = old_modinfo->next; - else - modules = old_modinfo->next; - unregister_module_hooks(old_modinfo->module_id); - ((void (*)(void)) old_modinfo->stopfunc)(MODSTATE_RELOAD); - closemodule(old_modinfo->module); - free(old_modinfo->name); - free(old_modinfo); - break; - } else - old_prev = old_modinfo; + if(!stricmp(old_modinfo->name, name)) { + if(old_prev) + old_prev->next = old_modinfo->next; + else + modules = old_modinfo->next; + unregister_module_hooks(old_modinfo->module_id); + ((void (*)(int)) old_modinfo->stopfunc)(MODSTATE_RELOAD); + closemodule(old_modinfo->module); + free(old_modinfo->name); + free(old_modinfo); + break; + } else + old_prev = old_modinfo; + } if(!loadModule(name)) return 0; struct ModuleInfo *modinfo; for(modinfo = modules; modinfo; modinfo = modinfo->next) { if(!(modinfo->state & MODINFO_STATE_STARTED)) { modinfo->state |= MODINFO_STATE_STARTED; - ((void (*)(void)) modinfo->startfunc)(MODSTATE_STARTSTOP); + ((void (*)(int)) modinfo->startfunc)(MODSTATE_STARTSTOP); } else - ((void (*)(void)) modinfo->startfunc)(MODSTATE_REBIND); + ((void (*)(int)) modinfo->startfunc)(MODSTATE_REBIND); } + return 1; } void start_modules() { @@ -365,7 +387,7 @@ void start_modules() { for(modinfo = modules; modinfo; modinfo = modinfo->next) { if(!(modinfo->state & MODINFO_STATE_STARTED)) { modinfo->state |= MODINFO_STATE_STARTED; - ((void (*)(void)) modinfo->startfunc)(MODSTATE_STARTSTOP); + ((void (*)(int)) modinfo->startfunc)(MODSTATE_STARTSTOP); } } } diff --git a/src/modules.h b/src/modules.h index 321b5c1..8e326ea 100644 --- a/src/modules.h +++ b/src/modules.h @@ -17,7 +17,8 @@ #ifndef _modules_h #define _modules_h -void load_module(char *name); +void loadModules(); +int loadModule(char *name); void start_modules(); void loop_modules(); void stop_modules(); diff --git a/src/modules/NeonHelp.mod/bot_NeonHelp.c b/src/modules/NeonHelp.mod/bot_NeonHelp.c index 8b00188..ee02574 100644 --- a/src/modules/NeonHelp.mod/bot_NeonHelp.c +++ b/src/modules/NeonHelp.mod/bot_NeonHelp.c @@ -18,7 +18,7 @@ #include "bot_NeonHelp.h" #include "../../modcmd.h" -#include "../../cmd_neonhelp.h" +#include "cmd_neonhelp.h" #include "../../lang.h" #include "../../mysqlConn.h" #include "../../ClientSocket.h" @@ -175,7 +175,7 @@ static void neonhelp_event_privmsg(struct UserNode *user, struct UserNode *targe cache->user = user; cache->target = target; cache->message = strdup(message); - get_userauth(user, neonhelp_event_privmsg_nick_lookup, cache); + get_userauth(user, module_id, neonhelp_event_privmsg_nick_lookup, cache); } } @@ -266,7 +266,7 @@ static void neonhelp_event_privmsg_async(struct ClientSocket *client, struct Use if(!timeq_name_exists(nameBuf)) { int *cidptr = malloc(sizeof(int)); *cidptr = client->clientid; - timeq_add_name(nameBuf, 300, neonhelp_remind_open_requests, cidptr); + timeq_add_name(nameBuf, 300, module_id, neonhelp_remind_open_requests, cidptr); } } printf_mysql_query("INSERT INTO `helpserv_requests` (`botid`, `host`, `hand`, `nick`, `status`, `supporter`, `time`, `text`) VALUES ('%d', '%s@%s', '%s', '%s', '0', '-1', UNIX_TIMESTAMP(), '%s')", client->clientid, escape_string(user->ident), escape_string(user->host), ((user->flags & USERFLAG_ISAUTHED) ? escape_string(user->auth) : "*"), escape_string(user->nick), escape_string(message)); @@ -339,7 +339,7 @@ static TIMEQ_CALLBACK(neonhelp_remind_open_requests) { char nameBuf[30]; sprintf(nameBuf, "neonhelp_%d", client->clientid); if(!timeq_name_exists(nameBuf)) { - timeq_add_name(nameBuf, 300, neonhelp_remind_open_requests, data); + timeq_add_name(nameBuf, 300, module_id, neonhelp_remind_open_requests, data); } char replybuf[MAXLEN]; build_language_string(NULL, replybuf, (requests == 1 ? "NH_REMIND_OPEN_REQUESTS_1" : "NH_REMIND_OPEN_REQUESTS_2"), requests); @@ -513,19 +513,19 @@ static void neonhelp_event_quit(struct UserNode *target, char *reason) { void init_NeonHelp(int type) { set_bot_alias(BOTID, BOTALIAS); - start_bots(); + start_bots(type); if(type == MODSTATE_REBIND) return; //register events - bind_bot_ready(neonhelp_bot_ready); - bind_privmsg(neonhelp_event_privmsg); - bind_chanmsg(neonhelp_event_chanmsg); - bind_part(neonhelp_event_part); - bind_kick(neonhelp_event_kick); - bind_quit(neonhelp_event_quit); + bind_bot_ready(neonhelp_bot_ready, module_id); + bind_privmsg(neonhelp_event_privmsg, module_id); + bind_chanmsg(neonhelp_event_chanmsg, module_id); + bind_part(neonhelp_event_part, module_id); + bind_kick(neonhelp_event_kick, module_id); + bind_quit(neonhelp_event_quit, module_id); - set_trigger_callback(BOTID, neonhelp_trigger_callback); + set_trigger_callback(BOTID, module_id, neonhelp_trigger_callback); register_default_language_table(msgtab); } diff --git a/src/modules/NeonHelp.mod/cmd_neonhelp.c b/src/modules/NeonHelp.mod/cmd_neonhelp.c index fc71850..eae3957 100644 --- a/src/modules/NeonHelp.mod/cmd_neonhelp.c +++ b/src/modules/NeonHelp.mod/cmd_neonhelp.c @@ -23,7 +23,7 @@ void register_commands() { //NeonHelp Commands register_command_alias(4, "NeonHelp"); - #define USER_COMMAND(NAME,FUNCTION,PARAMCOUNT,PRIVS,FLAGS) register_command(4, NAME, FUNCTION, PARAMCOUNT, PRIVS, 0, FLAGS) + #define USER_COMMAND(NAME,FUNCTION,PARAMCOUNT,PRIVS,FLAGS) register_command(4, NAME, module_id, FUNCTION, PARAMCOUNT, PRIVS, 0, FLAGS) // NAME FUNCTION PARAMS PRIVS FLAGS USER_COMMAND("next", neonhelp_cmd_next, 0, NULL, CMDFLAG_REQUIRE_AUTH | CMDFLAG_CHECK_AUTH); USER_COMMAND("delete", neonhelp_cmd_delete, 1, NULL, CMDFLAG_REQUIRE_AUTH | CMDFLAG_CHECK_AUTH); diff --git a/src/modules/NeonHelp.mod/cmd_neonhelp.h b/src/modules/NeonHelp.mod/cmd_neonhelp.h index c9b9152..0331295 100644 --- a/src/modules/NeonHelp.mod/cmd_neonhelp.h +++ b/src/modules/NeonHelp.mod/cmd_neonhelp.h @@ -26,7 +26,7 @@ #include "../../ChanUser.h" #include "../../DBHelper.h" #include "../../IRCParser.h" -#include "../../bot_NeonHelp.h" +#include "bot_NeonHelp.h" #include "../../lang.h" #include "../../tools.h" diff --git a/src/modules/NeonServ.mod/cmd_neonserv.h b/src/modules/NeonServ.mod/cmd_neonserv.h index bef9dd9..0c824e9 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv.h +++ b/src/modules/NeonServ.mod/cmd_neonserv.h @@ -37,7 +37,7 @@ #include "../../version.h" #include "../../EventLogger.h" #include "../../bots.h" -#include "../../bot_NeonServ.h" +#include "bot_NeonServ.h" #include "../../ConfigParser.h" void register_commands(); diff --git a/src/modules/NeonServ.mod/cmd_neonserv_access.c b/src/modules/NeonServ.mod/cmd_neonserv_access.c index 25b2501..3bda084 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_access.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_access.c @@ -44,7 +44,7 @@ CMD_BIND(neonserv_cmd_access) { cache->user = user; cache->chan = chan; cache->nick = strdup(user->nick); - get_userauth(user, neonserv_cmd_access_nick_lookup, cache); + get_userauth(user, module_id, neonserv_cmd_access_nick_lookup, cache); } else neonserv_cmd_access_async1(client, getTextBot(), user, chan, user->nick, user->auth, user); } @@ -75,7 +75,7 @@ CMD_BIND(neonserv_cmd_access) { cache->user = user; cache->chan = chan; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_access_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_access_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_addban.c b/src/modules/NeonServ.mod/cmd_neonserv_addban.c index fffadf5..3938999 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_addban.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_addban.c @@ -47,7 +47,7 @@ CMD_BIND(neonserv_cmd_addban) { cache->reason = strdup(merge_argv(argv, 1, argc)); } else cache->reason = NULL; - get_userlist(chan, neonserv_cmd_addban_userlist_lookup, cache); + get_userlist(chan, module_id, neonserv_cmd_addban_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_addban_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_addtimeban.c b/src/modules/NeonServ.mod/cmd_neonserv_addtimeban.c index 837812e..c74a029 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_addtimeban.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_addtimeban.c @@ -55,7 +55,7 @@ CMD_BIND(neonserv_cmd_addtimeban) { cache->reason = strdup(merge_argv(argv, 2, argc)); } else cache->reason = NULL; - get_userlist(chan, neonserv_cmd_addtimeban_userlist_lookup, cache); + get_userlist(chan, module_id, neonserv_cmd_addtimeban_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_addtimeban_userlist_lookup) { @@ -132,7 +132,7 @@ static void neonserv_cmd_addtimeban_async1(struct ClientSocket *client, struct C char banidBuf[20]; sprintf(nameBuf, "ban_%d", banid); sprintf(banidBuf, "%d", banid); - timeq_add_name(nameBuf, duration, channel_ban_timeout, strdup(banidBuf)); + timeq_add_name(nameBuf, duration, module_id, channel_ban_timeout, strdup(banidBuf)); reply(textclient, user, "NS_TIMEBAN_DONE", mask, chan->name, timeToStr(user, duration, 2, nameBuf), match_count); logEvent(event); } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_adduser.c b/src/modules/NeonServ.mod/cmd_neonserv_adduser.c index 0e8432b..65f021a 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_adduser.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_adduser.c @@ -74,7 +74,7 @@ CMD_BIND(neonserv_cmd_adduser) { cache->event = event; cache->access = caccess; cache->nick = strdup(argv[0]); - lookup_authname(argv[0], neonserv_cmd_adduser_auth_lookup, cache); + lookup_authname(argv[0], module_id, neonserv_cmd_adduser_auth_lookup, cache); } } else { struct UserNode *cuser = getUserByNick(argv[0]); @@ -101,7 +101,7 @@ CMD_BIND(neonserv_cmd_adduser) { cache->event = event; cache->access = caccess; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_adduser_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_adduser_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_assignrank.c b/src/modules/NeonServ.mod/cmd_neonserv_assignrank.c index 4fedaf8..f2cbd66 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_assignrank.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_assignrank.c @@ -68,7 +68,7 @@ CMD_BIND(neonserv_cmd_assignrank) { cache->event = event; cache->rank_id = rank_id; cache->nick = strdup(argv[0]); - lookup_authname(argv[0], neonserv_cmd_assignrank_auth_lookup, cache); + lookup_authname(argv[0], module_id, neonserv_cmd_assignrank_auth_lookup, cache); } } else { struct UserNode *cuser = getUserByNick(argv[0]); @@ -94,7 +94,7 @@ CMD_BIND(neonserv_cmd_assignrank) { cache->event = event; cache->rank_id = rank_id; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_assignrank_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_assignrank_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_ban.c b/src/modules/NeonServ.mod/cmd_neonserv_ban.c index 84a497a..35adf62 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_ban.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_ban.c @@ -41,7 +41,7 @@ CMD_BIND(neonserv_cmd_ban) { cache->user = user; cache->event = event; cache->masks = strdup(merge_argv_char(argv, 0, argc, ',')); - get_userlist_with_invisible(chan, neonserv_cmd_ban_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_ban_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_ban_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_chanservsync.c b/src/modules/NeonServ.mod/cmd_neonserv_chanservsync.c index 8581cb2..9ad498f 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_chanservsync.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_chanservsync.c @@ -106,7 +106,7 @@ CMD_BIND(neonserv_cmd_chanservsync) { cache->last_response = time(0); neonserv_cmd_chanservsync_used = cache; putsock(client, "PRIVMSG %s :users %s", botnick, chan->name); - bind_privnotice(neonserv_cmd_chanservsync_notice_listener); + bind_privnotice(neonserv_cmd_chanservsync_notice_listener, module_id); reply(getTextBot(), user, "NS_CHANSERVSYNC_SYNCHRONIZING", chan->name, botnick); logEvent(event); } @@ -224,7 +224,7 @@ static void neonserv_cmd_chanservsync_notice_listener(struct UserNode *user, str cache->caccess = caccess; cache->seen = seen_time; cache->flags = flags; - lookup_authname(username, neonserv_cmd_chanservsync_auth_lookup, cache); + lookup_authname(username, module_id, neonserv_cmd_chanservsync_auth_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_clvl.c b/src/modules/NeonServ.mod/cmd_neonserv_clvl.c index a541c3d..4d0faa1 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_clvl.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_clvl.c @@ -77,7 +77,7 @@ CMD_BIND(neonserv_cmd_clvl) { cache->event = event; cache->nick = strdup(argv[0]); cache->access = caccess; - get_userauth(cuser, neonserv_cmd_clvl_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_clvl_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_dehalfop.c b/src/modules/NeonServ.mod/cmd_neonserv_dehalfop.c index f995e0f..549e53c 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_dehalfop.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_dehalfop.c @@ -47,7 +47,7 @@ CMD_BIND(neonserv_cmd_dehalfop) { cache->argv[i] = strdup(argv[i]); } cache->argc = argc; - get_userlist(chan, neonserv_cmd_dehalfop_userlist_lookup, cache); + get_userlist(chan, module_id, neonserv_cmd_dehalfop_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_dehalfop_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_dehalfopall.c b/src/modules/NeonServ.mod/cmd_neonserv_dehalfopall.c index 1cb58d0..daa6c18 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_dehalfopall.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_dehalfopall.c @@ -47,7 +47,7 @@ CMD_BIND(neonserv_cmd_dehalfopall) { cache->argv[i] = strdup(argv[i]); } cache->argc = argc; - get_userlist(chan, neonserv_cmd_dehalfopall_userlist_lookup, cache); + get_userlist(chan, module_id, neonserv_cmd_dehalfopall_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_dehalfopall_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_deluser.c b/src/modules/NeonServ.mod/cmd_neonserv_deluser.c index 5188f01..3f06b9b 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_deluser.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_deluser.c @@ -60,7 +60,7 @@ CMD_BIND(neonserv_cmd_deluser) { cache->chan = chan; cache->event = event; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_deluser_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_deluser_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_deop.c b/src/modules/NeonServ.mod/cmd_neonserv_deop.c index 20a4f44..bb9e886 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_deop.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_deop.c @@ -47,7 +47,7 @@ CMD_BIND(neonserv_cmd_deop) { cache->argv[i] = strdup(argv[i]); } cache->argc = argc; - get_userlist(chan, neonserv_cmd_deop_userlist_lookup, cache); + get_userlist(chan, module_id, neonserv_cmd_deop_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_deop_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_deopall.c b/src/modules/NeonServ.mod/cmd_neonserv_deopall.c index 7b1cdb2..36cf617 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_deopall.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_deopall.c @@ -47,7 +47,7 @@ CMD_BIND(neonserv_cmd_deopall) { cache->argv[i] = strdup(argv[i]); } cache->argc = argc; - get_userlist(chan, neonserv_cmd_deopall_userlist_lookup, cache); + get_userlist(chan, module_id, neonserv_cmd_deopall_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_deopall_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_devoiceall.c b/src/modules/NeonServ.mod/cmd_neonserv_devoiceall.c index 9254e46..9dc3eac 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_devoiceall.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_devoiceall.c @@ -26,7 +26,6 @@ CMD_BIND(neonserv_cmd_devoiceall) { char *nickmask = NULL; struct ChanUser *chanuser; struct ModeBuffer *modeBuf; - check_mysql(); if(argc > 0) nickmask = argv[0]; modeBuf = initModeBuffer(client, chan); diff --git a/src/modules/NeonServ.mod/cmd_neonserv_extscript.c b/src/modules/NeonServ.mod/cmd_neonserv_extscript.c index e4a4e2e..35564e2 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_extscript.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_extscript.c @@ -139,7 +139,7 @@ CMD_BIND(neonserv_cmd_extscript) { #ifndef WIN32 fcntl(fileno(cache->pipe), F_SETFL, O_NONBLOCK); #endif - timeq_uadd(200, neonserv_cmd_extscript_callback, cache); + timeq_uadd(200, module_id, neonserv_cmd_extscript_callback, cache); } static TIMEQ_CALLBACK(neonserv_cmd_extscript_callback) { @@ -163,7 +163,7 @@ static TIMEQ_CALLBACK(neonserv_cmd_extscript_callback) { else reply(cache->textclient, cache->user, "%s", command); } - timeq_uadd(200, neonserv_cmd_extscript_callback, cache); + timeq_uadd(200, module_id, neonserv_cmd_extscript_callback, cache); } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_giveowner.c b/src/modules/NeonServ.mod/cmd_neonserv_giveowner.c index 9cf5ae7..779e28d 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_giveowner.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_giveowner.c @@ -76,7 +76,7 @@ CMD_BIND(neonserv_cmd_giveowner) { cache->event = event; cache->nick = strdup(argv[0]); cache->key = (argc != 1 ? strdup(argv[1]) : NULL); - get_userauth(cuser, neonserv_cmd_giveowner_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_giveowner_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_halfop.c b/src/modules/NeonServ.mod/cmd_neonserv_halfop.c index ba684cb..d334876 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_halfop.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_halfop.c @@ -41,7 +41,7 @@ CMD_BIND(neonserv_cmd_halfop) { cache->user = user; cache->event = event; cache->nicks = strdup(merge_argv(argv, 0, argc)); - get_userlist_if_invisible(chan, neonserv_cmd_halfop_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_halfop_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_halfop_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_halfopall.c b/src/modules/NeonServ.mod/cmd_neonserv_halfopall.c index a52ad6d..bea8185 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_halfopall.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_halfopall.c @@ -45,7 +45,7 @@ CMD_BIND(neonserv_cmd_halfopall) { cache->nickmask = strdup(argv[0]); } else cache->nickmask = NULL; - get_userlist_if_invisible(chan, neonserv_cmd_halfopall_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_halfopall_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_halfopall_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_invite.c b/src/modules/NeonServ.mod/cmd_neonserv_invite.c index 60c00a2..06f403b 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_invite.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_invite.c @@ -81,7 +81,7 @@ CMD_BIND(neonserv_cmd_invite) { cache->chan = chan; cache->event = event; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_invite_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_invite_nick_lookup, cache); } } @@ -113,7 +113,7 @@ static void neonserv_cmd_invite_async1(struct ClientSocket *client, struct Clien } } struct neonserv_cmd_invite_timeout *timeout = neonserv_cmd_invite_add_timeout(nick, chan->name); - timeq_add(INVITE_TIMEOUT, neonserv_cmd_invite_timeout_timeout, timeout); + timeq_add(INVITE_TIMEOUT, module_id, neonserv_cmd_invite_timeout_timeout, timeout); putsock(client, "INVITE %s %s", nick, chan->name); struct UserNode *tmpu = getUserByNick(nick); if(!tmpu) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_kick.c b/src/modules/NeonServ.mod/cmd_neonserv_kick.c index 7ffcf65..39b9cbd 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_kick.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_kick.c @@ -47,7 +47,7 @@ CMD_BIND(neonserv_cmd_kick) { cache->reason = strdup(merge_argv(argv, 1, argc)); } else cache->reason = NULL; - get_userlist_with_invisible(chan, neonserv_cmd_kick_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_kick_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_kick_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_kickban.c b/src/modules/NeonServ.mod/cmd_neonserv_kickban.c index 1123cd7..919ca25 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_kickban.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_kickban.c @@ -47,7 +47,7 @@ CMD_BIND(neonserv_cmd_kickban) { cache->reason = strdup(merge_argv(argv, 1, argc)); } else cache->reason = NULL; - get_userlist_with_invisible(chan, neonserv_cmd_kickban_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_kickban_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_kickban_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_mode.c b/src/modules/NeonServ.mod/cmd_neonserv_mode.c index 8a11e36..7898129 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_mode.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_mode.c @@ -42,7 +42,7 @@ CMD_BIND(neonserv_cmd_mode) { cache->user = user; cache->event = event; cache->mode = strdup(merge_argv(argv, 0, argc)); - get_userlist_with_invisible(chan, neonserv_cmd_mode_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_mode_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_mode_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_myaccess.c b/src/modules/NeonServ.mod/cmd_neonserv_myaccess.c index b9f6581..7e84eee 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_myaccess.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_myaccess.c @@ -49,7 +49,7 @@ CMD_BIND(neonserv_cmd_myaccess) { cache->chan = chan; cache->nick = strdup(argv[0]); cache->chanmatch = (chanmatch ? strdup(chanmatch) : NULL); - get_userauth(user, neonserv_cmd_myaccess_nick_lookup, cache); + get_userauth(user, module_id, neonserv_cmd_myaccess_nick_lookup, cache); } else neonserv_cmd_myaccess_async1(client, getTextBot(), user, chan, user->nick, user->auth, chanmatch); } @@ -87,7 +87,7 @@ CMD_BIND(neonserv_cmd_myaccess) { cache->chan = chan; cache->nick = strdup(argv[0]); cache->chanmatch = (chanmatch ? strdup(chanmatch) : NULL); - get_userauth(cuser, neonserv_cmd_myaccess_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_myaccess_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_nicklist.c b/src/modules/NeonServ.mod/cmd_neonserv_nicklist.c index 181923c..fe2a518 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_nicklist.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_nicklist.c @@ -69,7 +69,7 @@ CMD_BIND(neonserv_cmd_nicklist) { } else cache->nickmask = NULL; cache->syncusers = syncusers; - get_userlist_with_invisible(chan, neonserv_cmd_nicklist_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_nicklist_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_nicklist_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_noregister.c b/src/modules/NeonServ.mod/cmd_neonserv_noregister.c index f0ba380..e2744f4 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_noregister.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_noregister.c @@ -81,7 +81,7 @@ CMD_BIND(neonserv_cmd_noregister) { cache->nick = strdup(argv[0]); cache->duration = duration; cache->reason = strdup(reason); - lookup_authname(argv[0], neonserv_cmd_noregister_auth_lookup, cache); + lookup_authname(argv[0], module_id, neonserv_cmd_noregister_auth_lookup, cache); } } else { struct UserNode *cuser = getUserByNick(argv[0]); @@ -109,7 +109,7 @@ CMD_BIND(neonserv_cmd_noregister) { cache->nick = strdup(user->nick); cache->duration = duration; cache->reason = strdup(reason); - get_userauth(cuser, neonserv_cmd_noregister_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_noregister_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_op.c b/src/modules/NeonServ.mod/cmd_neonserv_op.c index 6bf3b28..38876c3 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_op.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_op.c @@ -41,7 +41,7 @@ CMD_BIND(neonserv_cmd_op) { cache->user = user; cache->event = event; cache->nicks = strdup(merge_argv(argv, 0, argc)); - get_userlist_if_invisible(chan, neonserv_cmd_op_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_op_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_op_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_opall.c b/src/modules/NeonServ.mod/cmd_neonserv_opall.c index b6bdacc..956600f 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_opall.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_opall.c @@ -49,7 +49,7 @@ CMD_BIND(neonserv_cmd_opall) { cache->nickmask = strdup(argv[1]); } else cache->nickmask = NULL; - get_userlist_if_invisible(chan, neonserv_cmd_opall_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_opall_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_opall_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_peek.c b/src/modules/NeonServ.mod/cmd_neonserv_peek.c index 51de508..edbf2e7 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_peek.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_peek.c @@ -37,7 +37,7 @@ CMD_BIND(neonserv_cmd_peek) { cache->client = client; cache->textclient = getTextBot(); cache->user = user; - get_userlist_if_invisible(chan, neonserv_cmd_peek_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_peek_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_peek_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_rename.c b/src/modules/NeonServ.mod/cmd_neonserv_rename.c index 9b87be4..7dee974 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_rename.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_rename.c @@ -44,7 +44,7 @@ CMD_BIND(neonserv_cmd_rename) { cache->event = event; cache->oldauth = strdup(argv[0]); cache->newauth = strdup(argv[1]); - lookup_authname(argv[1], neonserv_cmd_rename_auth_lookup, cache); + lookup_authname(argv[1], module_id, neonserv_cmd_rename_auth_lookup, cache); } static AUTHLOOKUP_CALLBACK(neonserv_cmd_rename_auth_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_resync.c b/src/modules/NeonServ.mod/cmd_neonserv_resync.c index 7c60a6e..271adbc 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_resync.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_resync.c @@ -61,7 +61,7 @@ CMD_BIND(neonserv_cmd_resync) { cache->min_access = min_access; cache->max_access = max_access; cache->override_noautoop = override_noautoop; - get_userlist_with_invisible(chan, neonserv_cmd_resync_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_resync_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_resync_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_suspend.c b/src/modules/NeonServ.mod/cmd_neonserv_suspend.c index b6d18b4..fa54c40 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_suspend.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_suspend.c @@ -60,7 +60,7 @@ CMD_BIND(neonserv_cmd_suspend) { cache->chan = chan; cache->event = event; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_suspend_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_suspend_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_trim.c b/src/modules/NeonServ.mod/cmd_neonserv_trim.c index 65a0e73..21065e8 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_trim.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_trim.c @@ -117,7 +117,7 @@ CMD_BIND(neonserv_cmd_trim) { cache->min_access = min_access; cache->max_access = max_access; cache->duration = duration; - get_userlist_with_invisible(chan, neonserv_cmd_trim_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_trim_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_trim_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_unban.c b/src/modules/NeonServ.mod/cmd_neonserv_unban.c index f88033b..805358f 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_unban.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_unban.c @@ -68,7 +68,7 @@ CMD_BIND(neonserv_cmd_unban) { break; //internal bot error } cuser->flags |= USERFLAG_ISTMPUSER; - get_userauth(cuser, neonserv_cmd_unban_userauth_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_unban_userauth_lookup, cache); cache->pending_whos++; } else { neonserv_cmd_unban_nick(cache, cuser); diff --git a/src/modules/NeonServ.mod/cmd_neonserv_unsuspend.c b/src/modules/NeonServ.mod/cmd_neonserv_unsuspend.c index 4053950..7d61c95 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_unsuspend.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_unsuspend.c @@ -60,7 +60,7 @@ CMD_BIND(neonserv_cmd_unsuspend) { cache->chan = chan; cache->event = event; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_unsuspend_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_unsuspend_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_unvisited.c b/src/modules/NeonServ.mod/cmd_neonserv_unvisited.c index 9d7cda7..badd026 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_unvisited.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_unvisited.c @@ -57,7 +57,7 @@ CMD_BIND(neonserv_cmd_unvisited) { if(channel) { cache->who_count++; channel->channel_id = atoi(row[0]); - get_userlist_with_invisible(channel, neonserv_cmd_unvisited_userlist_lookup, cache); + get_userlist_with_invisible(channel, module_id, neonserv_cmd_unvisited_userlist_lookup, cache); } else { reply(getTextBot(), user, "%s", row[1]); cache->matches++; diff --git a/src/modules/NeonServ.mod/cmd_neonserv_up.c b/src/modules/NeonServ.mod/cmd_neonserv_up.c index 0085b5f..c0ef253 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_up.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_up.c @@ -42,7 +42,7 @@ CMD_BIND(neonserv_cmd_up) { cache->textclient = getTextBot(); cache->user = user; cache->event = event; - get_userlist_if_invisible(chan, neonserv_cmd_up_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_up_userlist_lookup, cache); } else { neonserv_cmd_up_async1(client, getTextBot(), user, chan, event); } diff --git a/src/modules/NeonServ.mod/cmd_neonserv_users.c b/src/modules/NeonServ.mod/cmd_neonserv_users.c index cd8d375..5f032e6 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_users.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_users.c @@ -53,7 +53,7 @@ CMD_BIND(neonserv_cmd_users) { cache->usermask = (usermask ? strdup(usermask) : NULL); cache->min_access = min_access; cache->max_access = max_access; - get_userlist_with_invisible(chan, neonserv_cmd_users_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_cmd_users_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_users_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_voice.c b/src/modules/NeonServ.mod/cmd_neonserv_voice.c index 49dfe6c..1325d8d 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_voice.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_voice.c @@ -41,7 +41,7 @@ CMD_BIND(neonserv_cmd_voice) { cache->user = user; cache->event = event; cache->nicks = strdup(merge_argv(argv, 0, argc)); - get_userlist_if_invisible(chan, neonserv_cmd_voice_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_voice_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_voice_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_voiceall.c b/src/modules/NeonServ.mod/cmd_neonserv_voiceall.c index 779110c..8a2c018 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_voiceall.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_voiceall.c @@ -44,7 +44,7 @@ CMD_BIND(neonserv_cmd_voiceall) { cache->nickmask = strdup(argv[0]); } else cache->nickmask = NULL; - get_userlist_if_invisible(chan, neonserv_cmd_voiceall_userlist_lookup, cache); + get_userlist_if_invisible(chan, module_id, neonserv_cmd_voiceall_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_cmd_voiceall_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/cmd_neonserv_wipeinfo.c b/src/modules/NeonServ.mod/cmd_neonserv_wipeinfo.c index 71a1cc8..a7b2ee1 100644 --- a/src/modules/NeonServ.mod/cmd_neonserv_wipeinfo.c +++ b/src/modules/NeonServ.mod/cmd_neonserv_wipeinfo.c @@ -60,7 +60,7 @@ CMD_BIND(neonserv_cmd_wipeinfo) { cache->chan = chan; cache->event = event; cache->nick = strdup(argv[0]); - get_userauth(cuser, neonserv_cmd_wipeinfo_nick_lookup, cache); + get_userauth(cuser, module_id, neonserv_cmd_wipeinfo_nick_lookup, cache); } } } diff --git a/src/modules/NeonServ.mod/event_neonserv_ctcp.c b/src/modules/NeonServ.mod/event_neonserv_ctcp.c index 11d03e2..f9d9de3 100644 --- a/src/modules/NeonServ.mod/event_neonserv_ctcp.c +++ b/src/modules/NeonServ.mod/event_neonserv_ctcp.c @@ -44,7 +44,7 @@ static void neonserv_event_chanctcp(struct UserNode *user, struct ChanNode *chan cache->chan = chan; cache->command = strdup(command); cache->text = (text ? strdup(text) : NULL); - get_userauth(user, neonserv_event_ctcp_nick_lookup, cache); + get_userauth(user, module_id, neonserv_event_ctcp_nick_lookup, cache); } else neonserv_event_ctcp_async1(client, user, chan, command, text); } @@ -98,7 +98,7 @@ static void neonserv_event_ctcp_async1(struct ClientSocket *client, struct UserN char banidBuf[20]; sprintf(nameBuf, "ban_%d", banid); sprintf(banidBuf, "%d", banid); - timeq_add_name(nameBuf, duration, channel_ban_timeout, strdup(banidBuf)); + timeq_add_name(nameBuf, duration, module_id, channel_ban_timeout, strdup(banidBuf)); case 1: //KICKBAN if(!banmask) banmask = generate_banmask(user, banmaskBuf); diff --git a/src/modules/NeonServ.mod/event_neonserv_join.c b/src/modules/NeonServ.mod/event_neonserv_join.c index 77d5de7..ad2ee0e 100644 --- a/src/modules/NeonServ.mod/event_neonserv_join.c +++ b/src/modules/NeonServ.mod/event_neonserv_join.c @@ -59,7 +59,7 @@ static void neonserv_event_join(struct ChanUser *chanuser) { cache->client = client; cache->chanuser = chanuser; cache->was_registering = (user->flags & USERFLAG_WAS_REGISTRING); - get_userauth(user, neonserv_event_join_nick_lookup, cache); + get_userauth(user, module_id, neonserv_event_join_nick_lookup, cache); } else neonserv_event_join_async1(client, chanuser, (user->flags & USERFLAG_WAS_REGISTRING)); } @@ -173,7 +173,7 @@ static void neonserv_event_join_async1(struct ClientSocket *client, struct ChanU sprintf(nameBuf, "dynlimit_%s", chan->name); if(!timeq_name_exists(nameBuf)) { //neonserv_event_join_dynlimit - timeq_add_name(nameBuf, 30, neonserv_event_join_dynlimit, strdup(chan->name)); + timeq_add_name(nameBuf, 30, module_id, neonserv_event_join_dynlimit, strdup(chan->name)); } } //AUTOINVITE diff --git a/src/modules/NeonServ.mod/event_neonserv_kick.c b/src/modules/NeonServ.mod/event_neonserv_kick.c index 8e32d02..79c2603 100644 --- a/src/modules/NeonServ.mod/event_neonserv_kick.c +++ b/src/modules/NeonServ.mod/event_neonserv_kick.c @@ -67,11 +67,11 @@ static void neonserv_event_kick(struct UserNode *user, struct ChanUser *target, cache->chan = target->chan; cache->userauth_pending = 0; if(!(user->flags & USERFLAG_ISAUTHED)) { - get_userauth(user, neonserv_event_kick_nick_lookup, cache); + get_userauth(user, module_id, neonserv_event_kick_nick_lookup, cache); cache->userauth_pending++; } if(!(target->user->flags & USERFLAG_ISAUTHED)) { - get_userauth(target->user, neonserv_event_kick_nick_lookup, cache); + get_userauth(target->user, module_id, neonserv_event_kick_nick_lookup, cache); cache->userauth_pending++; } neonserv_event_kick_async1(cache); diff --git a/src/modules/NeonServ.mod/event_neonserv_mode.c b/src/modules/NeonServ.mod/event_neonserv_mode.c index f0794a9..3194dfd 100644 --- a/src/modules/NeonServ.mod/event_neonserv_mode.c +++ b/src/modules/NeonServ.mod/event_neonserv_mode.c @@ -52,7 +52,7 @@ static void neonserv_event_mode(struct UserNode *user, struct ChanNode *chan, ch cache->modes = strdup(modes); cache->argv = temp_argv; cache->argc = argc; - get_userlist_with_invisible(chan, neonserv_event_mode_userlist_lookup, cache); + get_userlist_with_invisible(chan, module_id, neonserv_event_mode_userlist_lookup, cache); } static USERLIST_CALLBACK(neonserv_event_mode_userlist_lookup) { diff --git a/src/modules/NeonServ.mod/event_neonserv_notice.c b/src/modules/NeonServ.mod/event_neonserv_notice.c index 84fb51a..cb598e1 100644 --- a/src/modules/NeonServ.mod/event_neonserv_notice.c +++ b/src/modules/NeonServ.mod/event_neonserv_notice.c @@ -41,7 +41,7 @@ static void neonserv_event_channotice(struct UserNode *user, struct ChanNode *ch cache->user = user; cache->chan = chan; cache->message = strdup(message); - get_userauth(user, neonserv_event_notice_nick_lookup, cache); + get_userauth(user, module_id, neonserv_event_notice_nick_lookup, cache); } else neonserv_event_notice_async1(client, user, chan, message); } @@ -93,7 +93,7 @@ static void neonserv_event_notice_async1(struct ClientSocket *client, struct Use char banidBuf[20]; sprintf(nameBuf, "ban_%d", banid); sprintf(banidBuf, "%d", banid); - timeq_add_name(nameBuf, duration, channel_ban_timeout, strdup(banidBuf)); + timeq_add_name(nameBuf, duration, module_id, channel_ban_timeout, strdup(banidBuf)); case 1: //KICKBAN if(!banmask) banmask = generate_banmask(user, banmaskBuf); diff --git a/src/modules/NeonServ.mod/event_neonserv_topic.c b/src/modules/NeonServ.mod/event_neonserv_topic.c index 577e0a3..da117de 100644 --- a/src/modules/NeonServ.mod/event_neonserv_topic.c +++ b/src/modules/NeonServ.mod/event_neonserv_topic.c @@ -41,7 +41,7 @@ static void neonserv_event_topic(struct UserNode *user, struct ChanNode *chan, c cache->user = user; cache->chan = chan; cache->new_topic = strdup(new_topic); - get_userauth(user, neonserv_event_topic_nick_lookup, cache); + get_userauth(user, module_id, neonserv_event_topic_nick_lookup, cache); } else neonserv_event_topic_async1(client, user, chan, new_topic); } diff --git a/src/modules/NeonSpam.mod/bot_NeonSpam.c b/src/modules/NeonSpam.mod/bot_NeonSpam.c index 8438381..33aa14e 100644 --- a/src/modules/NeonSpam.mod/bot_NeonSpam.c +++ b/src/modules/NeonSpam.mod/bot_NeonSpam.c @@ -324,6 +324,12 @@ static void createSpamNode(struct ChanUser *chanuser) { chanuser->spamnode = spamnode; } +static int neonspam_event_freechan(struct ChanNode *chan) { + if(chan->spam_settings) + freeNeonSpamSettings(chan->spam_settings); + return 1; +} + void init_NeonSpam(int type) { set_bot_alias(BOTID, BOTALIAS); @@ -332,13 +338,14 @@ void init_NeonSpam(int type) { if(type == MODSTATE_REBIND) return; //register events - bind_bot_ready(neonspam_bot_ready); - bind_join(neonspam_event_join); - bind_chanmsg(neonspam_event_chanmsg); - bind_privctcp(general_event_privctcp); - bind_kick(neonspam_event_kick); + bind_bot_ready(neonspam_bot_ready, module_id); + bind_join(neonspam_event_join, module_id); + bind_chanmsg(neonspam_event_chanmsg, module_id); + bind_privctcp(general_event_privctcp, module_id); + bind_kick(neonspam_event_kick, module_id); + bind_freechan(neonspam_event_freechan, module_id); - set_trigger_callback(BOTID, neonspam_trigger_callback); + set_trigger_callback(BOTID, module_id, neonspam_trigger_callback); register_default_language_table(msgtab); } diff --git a/src/modules/NeonSpam.mod/cmd_neonspam.c b/src/modules/NeonSpam.mod/cmd_neonspam.c index 073512b..b0295ef 100644 --- a/src/modules/NeonSpam.mod/cmd_neonspam.c +++ b/src/modules/NeonSpam.mod/cmd_neonspam.c @@ -24,7 +24,7 @@ void register_commands() { //NeonSpam Commands register_command_alias(2, "NeonSpam"); - #define USER_COMMAND(NAME,FUNCTION,PARAMCOUNT,PRIVS,FLAGS) register_command(2, NAME, FUNCTION, PARAMCOUNT, PRIVS, 0, FLAGS) + #define USER_COMMAND(NAME,FUNCTION,PARAMCOUNT,PRIVS,FLAGS) register_command(2, NAME, module_id, FUNCTION, PARAMCOUNT, PRIVS, 0, FLAGS) // NAME FUNCTION PARAMS PRIVS FLAGS USER_COMMAND("set", neonspam_cmd_set, 0, "#channel_setters", CMDFLAG_REQUIRE_CHAN | CMDFLAG_REGISTERED_CHAN | CMDFLAG_REQUIRE_AUTH | CMDFLAG_CHECK_AUTH | CMDFLAG_LOG); #undef USER_COMMAND diff --git a/src/modules/NeonSpam.mod/cmd_neonspam.h b/src/modules/NeonSpam.mod/cmd_neonspam.h index 383eeaf..02355cd 100644 --- a/src/modules/NeonSpam.mod/cmd_neonspam.h +++ b/src/modules/NeonSpam.mod/cmd_neonspam.h @@ -37,7 +37,9 @@ #include "../../version.h" #include "../../EventLogger.h" #include "../../bots.h" -#include "../../bot_NeonSpam.h" +#include "bot_NeonSpam.h" + +void register_commands(); CMD_BIND(neonspam_cmd_set); diff --git a/src/modules/NeonSpam.mod/event_neonspam_chanmsg.c b/src/modules/NeonSpam.mod/event_neonspam_chanmsg.c index 163315d..114ab0f 100644 --- a/src/modules/NeonSpam.mod/event_neonspam_chanmsg.c +++ b/src/modules/NeonSpam.mod/event_neonspam_chanmsg.c @@ -144,7 +144,7 @@ static void neonspam_event_chanmsg(struct UserNode *user, struct ChanNode *chan, cache->settings = settings; cache->warn = warn; cache->punish = punish; - get_userauth(user, neonspam_event_chanmsg_nick_lookup, cache); + get_userauth(user, module_id, neonspam_event_chanmsg_nick_lookup, cache); } } @@ -248,7 +248,7 @@ static void neonspam_event_chanmsg_punish(struct ClientSocket *client, struct Ch char banidBuf[20]; sprintf(nameBuf, "ban_%d", banid); sprintf(banidBuf, "%d", banid); - timeq_add_name(nameBuf, punish_time, channel_ban_timeout, strdup(banidBuf)); + timeq_add_name(nameBuf, punish_time, module_id, channel_ban_timeout, strdup(banidBuf)); } case 2: //KICKBAN if(!banmask) diff --git a/src/modules/NeonSpam.mod/event_neonspam_join.c b/src/modules/NeonSpam.mod/event_neonspam_join.c index 5a169f2..4903849 100644 --- a/src/modules/NeonSpam.mod/event_neonspam_join.c +++ b/src/modules/NeonSpam.mod/event_neonspam_join.c @@ -54,7 +54,7 @@ static void neonspam_event_join(struct ChanUser *chanuser) { cache->chanuser = chanuser; cache->settings = settings; cache->action = result; - get_userauth(chanuser->user, neonspam_event_join_nick_lookup, cache); + get_userauth(chanuser->user, module_id, neonspam_event_join_nick_lookup, cache); } } } @@ -102,7 +102,7 @@ static void neonspam_event_join_punish(struct ClientSocket *client, struct ChanU char banidBuf[20]; sprintf(nameBuf, "ban_%d", banid); sprintf(banidBuf, "%d", banid); - timeq_add_name(nameBuf, duration, channel_ban_timeout, strdup(banidBuf)); + timeq_add_name(nameBuf, duration, module_id, channel_ban_timeout, strdup(banidBuf)); } case 1: //KICKBAN if(!banmask) diff --git a/src/modules/global.mod/cmd_global_meminfo.c b/src/modules/global.mod/cmd_global_meminfo.c index bdcf45a..eb08ef5 100644 --- a/src/modules/global.mod/cmd_global_meminfo.c +++ b/src/modules/global.mod/cmd_global_meminfo.c @@ -16,7 +16,7 @@ */ #include "cmd_global.h" -#include "memoryInfo.h" +#include "../../memoryInfo.h" /* * no arguments diff --git a/src/modules/global.mod/cmd_global_netinfo.c b/src/modules/global.mod/cmd_global_netinfo.c index 3d01c98..a3e4f73 100644 --- a/src/modules/global.mod/cmd_global_netinfo.c +++ b/src/modules/global.mod/cmd_global_netinfo.c @@ -29,7 +29,7 @@ CMD_BIND(global_cmd_netinfo) { char *content[2]; content[0] = get_language_string(user, "NS_NETINFO_UPTIME"); - content[1] = timeToStr(user, (time(0) - start_time), 3, tmp); + content[1] = timeToStr(user, (time(0) - getStartTime()), 3, tmp); table_add(table, content); content[0] = get_language_string(user, "NS_NETINFO_BOTS"); @@ -146,25 +146,25 @@ CMD_BIND(global_cmd_netinfo) { #ifdef HAVE_THREADS content[0] = get_language_string(user, "NS_NETINFO_THREADS"); - sprintf(tmp, "%d (current thread: %i)", running_threads, getCurrentThreadID()); + sprintf(tmp, "%d (current thread: %i)", getRunningThreads(), getCurrentThreadID()); content[1] = tmp; table_add(table, content); #endif - if(strcmp(revision, "")) - sprintf(tmp, "%s.%d (%s)", NEONSERV_VERSION, patchlevel, revision); + if(strcmp(get_revision(), "")) + sprintf(tmp, "%s.%d (%s)", NEONSERV_VERSION, get_patchlevel(), get_revision()); else - sprintf(tmp, "%s.%d", NEONSERV_VERSION, patchlevel); + sprintf(tmp, "%s.%d", NEONSERV_VERSION, get_patchlevel()); content[0] = get_language_string(user, "NS_NETINFO_VERSION"); content[1] = tmp; table_add(table, content); content[0] = get_language_string(user, "NS_NETINFO_COMPILER"); - content[1] = build_language_string(user, tmp, "NS_NETINFO_COMPILER_VALUE", COMPILER, creation); + content[1] = build_language_string(user, tmp, "NS_NETINFO_COMPILER_VALUE", COMPILER, get_creation()); table_add(table, content); content[0] = get_language_string(user, "NS_NETINFO_CODE"); - content[1] = build_language_string(user, tmp, "NS_NETINFO_CODE_VALUE", codelines); + content[1] = build_language_string(user, tmp, "NS_NETINFO_CODE_VALUE", get_codelines()); table_add(table, content); char **table_lines = table_end(table); diff --git a/src/modules/global.mod/cmd_global_register.c b/src/modules/global.mod/cmd_global_register.c index 548860d..d6ec183 100644 --- a/src/modules/global.mod/cmd_global_register.c +++ b/src/modules/global.mod/cmd_global_register.c @@ -108,7 +108,7 @@ CMD_BIND(global_cmd_register) { cache->channel = strdup(channel); cache->multibot = multibot; cache->botname = (botname ? strdup(botname) : NULL); - lookup_authname(argv[1], global_cmd_register_auth_lookup, cache); + lookup_authname(argv[1], module_id, global_cmd_register_auth_lookup, cache); } } else { struct UserNode *cuser = getUserByNick(argv[1]); @@ -137,7 +137,7 @@ CMD_BIND(global_cmd_register) { cache->channel = strdup(channel); cache->multibot = multibot; cache->botname = (botname ? strdup(botname) : NULL); - get_userauth(cuser, global_cmd_register_nick_lookup, cache); + get_userauth(cuser, module_id, global_cmd_register_nick_lookup, cache); } } } diff --git a/src/modules/global.mod/cmd_global_setaccess.c b/src/modules/global.mod/cmd_global_setaccess.c index 0458bd6..8d1ffe2 100644 --- a/src/modules/global.mod/cmd_global_setaccess.c +++ b/src/modules/global.mod/cmd_global_setaccess.c @@ -69,7 +69,7 @@ CMD_BIND(global_cmd_setaccess) { cache->event = event; cache->access = caccess; cache->nick = strdup(argv[0]); - lookup_authname(argv[0], global_cmd_setaccess_auth_lookup, cache); + lookup_authname(argv[0], module_id, global_cmd_setaccess_auth_lookup, cache); } } else { struct UserNode *cuser = getUserByNick(argv[0]); @@ -95,7 +95,7 @@ CMD_BIND(global_cmd_setaccess) { cache->event = event; cache->access = caccess; cache->nick = strdup(argv[0]); - get_userauth(cuser, global_cmd_setaccess_nick_lookup, cache); + get_userauth(cuser, module_id, global_cmd_setaccess_nick_lookup, cache); } } } diff --git a/src/modules/global.mod/cmd_global_setbot.c b/src/modules/global.mod/cmd_global_setbot.c index 88ffeac..a95f8c3 100644 --- a/src/modules/global.mod/cmd_global_setbot.c +++ b/src/modules/global.mod/cmd_global_setbot.c @@ -385,7 +385,7 @@ static int global_cmd_setbot_class(struct UserNode *user, MYSQL_ROW bot, char *v struct ClientSocket *client; for(client = getBots(0, NULL); client; client = getBots(0, client)) { if(client->clientid == atoi(bot[15])) { - unbind_botwise_allcmd(client->clientid); + unbind_botwise_allcmd(0, client->clientid); client->botid = val; if(client->botid == 0) { MYSQL_RES *res; diff --git a/src/modules/global.mod/cmd_global_version.c b/src/modules/global.mod/cmd_global_version.c index 307e34c..1faaf38 100644 --- a/src/modules/global.mod/cmd_global_version.c +++ b/src/modules/global.mod/cmd_global_version.c @@ -22,8 +22,8 @@ */ CMD_BIND(global_cmd_version) { - reply(getTextBot(), user, "\002NeonServ %s.%d\002 (%s), written by pk910", NEONSERV_VERSION, patchlevel, (strcmp(revision, "") ? revision : "-")); - reply(getTextBot(), user, "Build (#%s) %s (%s lines, " COMPILER ")", compilation, creation, codelines); + reply(getTextBot(), user, "\002NeonServ %s.%d\002 (%s), written by pk910", NEONSERV_VERSION, get_patchlevel(), (strcmp(get_revision(), "") ? get_revision() : "-")); + reply(getTextBot(), user, "Build (#%s) %s (%s lines, " COMPILER ")", get_compilation(), get_creation(), get_codelines()); reply(getTextBot(), user, "NeonServ can be found on: http://dev.pk910.de/NeonServ"); //helpers :D reply(getTextBot(), user, "special thanks to:"); diff --git a/src/modules/module.h b/src/modules/module.h index 7e7575c..8c13294 100644 --- a/src/modules/module.h +++ b/src/modules/module.h @@ -77,7 +77,7 @@ extern int module_id; /* 047 */ #define renameAccount ((int (*)(char *, char *))global[47]) /* 048 */ #define deleteUser ((void (*)(int))global[48]) /* 049 */ #define logEvent ((void (*)(struct Event *))global[49]) -/* 050 */ #define lookup_authname ((void (*)(char *, authlookup_callback_t, void *))global[50]) +/* 050 */ #define lookup_authname ((void (*)(char *, int, authlookup_callback_t, void *))global[50]) /* 051 */ #define bind_join ((int (*)(join_func_t *, int))global[51]) /* 052 */ #define unbind_join ((void (*)(join_func_t *))global[52]) /* 053 */ #define bind_nick ((int (*)(nick_func_t *, int))global[53]) @@ -208,14 +208,16 @@ extern int module_id; /* 176 */ #define getAllUsers ((struct UserNode * (*)(struct UserNode *))global[176]) /* 177 */ #define getUsersWithAuth ((struct UserNode * (*)(const char *, struct UserNode *))global[177]) /* 178 */ #define getUserCount ((int (*)(void))global[178]) -/* 179 */ #define get_userlist ((void (*)(struct ChanNode *, int, userlist_callback_t, void *))global[179]) -/* 180 */ #define _get_userlist_with_invisible ((void (*)(struct ChanNode *, int, userlist_callback_t, void *, int))global[180]) -/* 181 */ #define get_userauth ((void (*)(struct UserNode *, int, userauth_callback_t, void *))global[181]) -/* 182 */ #define compilation ((const char *) *global[182]) -/* 183 */ #define creation ((const char *) *global[183]) -/* 184 */ #define revision ((const char *) *global[184]) -/* 185 */ #define codelines ((const char *) *global[185]) -/* 186 */ #define patchlevel ((const int) *global[186]) +/* 179 */ #define createTempUser ((struct UserNode * (*)(const char *))global[179]) +/* 180 */ #define createTempUserMask ((struct UserNode * (*)(const char *))global[180]) +/* 181 */ #define get_userlist ((void (*)(struct ChanNode *, int, userlist_callback_t, void *))global[181]) +/* 182 */ #define _get_userlist_with_invisible ((void (*)(struct ChanNode *, int, userlist_callback_t, void *, int))global[182]) +/* 183 */ #define get_userauth ((void (*)(struct UserNode *, int, userauth_callback_t, void *))global[183]) +/* 184 */ #define get_compilation ((const char * (*)(void))global[184]) +/* 185 */ #define get_creation ((const char * (*)(void))global[185]) +/* 186 */ #define get_revision ((const char * (*)(void))global[186]) +/* 187 */ #define get_codelines ((const char * (*)(void))global[187]) +/* 188 */ #define get_patchlevel ((const int (*)(void))global[188]) #define MODULE_HEADER(initfunc,startfunc,loopfunc,stopfunc) \ void **global = NULL; \ diff --git a/src/version.h b/src/version.h index 8784d08..8c22f99 100644 --- a/src/version.h +++ b/src/version.h @@ -27,5 +27,11 @@ extern const char *creation; extern const char *revision; extern const char *codelines; extern const int patchlevel; + +const char *get_compilation(); +const char *get_creation(); +const char *get_revision(); +const char *get_codelines(); +const int get_patchlevel(); #endif #endif diff --git a/src/version.sh b/src/version.sh index 2cdc0f4..4af226e 100644 --- a/src/version.sh +++ b/src/version.sh @@ -62,5 +62,25 @@ const char *codelines = "$codelines"; const int patchlevel = ($git_commitcount ? ($git_commitcount - VERSION_PATCHLEVEL) : 0); +const char *get_compilation() { + return compilation; +} + +const char *get_creation() { + return creation; +} + +const char *get_revision() { + return revision; +} + +const char *get_codelines() { + return codelines; +} + +const int get_patchlevel() { + return patchlevel; +} + !SUB!THIS!