diff --git a/include/modules.h b/include/modules.h index 4d268f2e2..687e5b40f 100644 --- a/include/modules.h +++ b/include/modules.h @@ -638,9 +638,7 @@ extern MODVAR Callback *Callbacks[MAXCALLBACKS], *RCallbacks[MAXCALLBACKS]; extern MODVAR Efunction *Efunctions[MAXEFUNCTIONS]; extern MODVAR ClientCapability *clicaps; -#define EventAdd(name, every, howmany, event, data) EventAddEx(NULL, name, every, howmany, event, data) -extern Event *EventAddEx(Module *, char *name, long every, long howmany, - vFP event, void *data); +extern Event *EventAdd(Module *, char *name, long every, long howmany, vFP event, void *data); extern Event *EventDel(Event *event); extern Event *EventMarkDel(Event *event); extern Event *EventFind(char *name); diff --git a/src/events.c b/src/events.c index 93d7a6aa7..295398bd9 100644 --- a/src/events.c +++ b/src/events.c @@ -56,7 +56,7 @@ void UnlockEventSystem(void) } -Event *EventAddEx(Module *module, char *name, long every, long howmany, +Event *EventAdd(Module *module, char *name, long every, long howmany, vFP event, void *data) { Event *newevent; @@ -208,14 +208,14 @@ void SetupEvents(void) LockEventSystem(); /* Start events */ - EventAddEx(NULL, "tunefile", 300, 0, save_tunefile, NULL); - EventAddEx(NULL, "garbage", GARBAGE_COLLECT_EVERY, 0, garbage_collect, NULL); - EventAddEx(NULL, "loop", 0, 0, loop_event, NULL); - EventAddEx(NULL, "unrealdns_removeoldrecords", 15, 0, unrealdns_removeoldrecords, NULL); - EventAddEx(NULL, "check_pings", 1, 0, check_pings, NULL); - EventAddEx(NULL, "check_deadsockets", 1, 0, check_deadsockets, NULL); - EventAddEx(NULL, "check_unknowns", 1, 0, check_unknowns, NULL); - EventAddEx(NULL, "try_connections", 2, 0, try_connections, NULL); + EventAdd(NULL, "tunefile", 300, 0, save_tunefile, NULL); + EventAdd(NULL, "garbage", GARBAGE_COLLECT_EVERY, 0, garbage_collect, NULL); + EventAdd(NULL, "loop", 0, 0, loop_event, NULL); + EventAdd(NULL, "unrealdns_removeoldrecords", 15, 0, unrealdns_removeoldrecords, NULL); + EventAdd(NULL, "check_pings", 1, 0, check_pings, NULL); + EventAdd(NULL, "check_deadsockets", 1, 0, check_deadsockets, NULL); + EventAdd(NULL, "check_unknowns", 1, 0, check_unknowns, NULL); + EventAdd(NULL, "try_connections", 2, 0, try_connections, NULL); UnlockEventSystem(); } diff --git a/src/hash.c b/src/hash.c index 8ea2f592b..001f86f2a 100644 --- a/src/hash.c +++ b/src/hash.c @@ -737,7 +737,7 @@ long v; if (v > 5) v = 5; /* accuracy, please */ } - EventAddEx(NULL, "bucketcleaning", v, 0, e_clean_out_throttling_buckets, NULL); + EventAdd(NULL, "bucketcleaning", v, 0, e_clean_out_throttling_buckets, NULL); } int hash_throttling(char *ip) diff --git a/src/mempool.c b/src/mempool.c index 74098e266..5e4129a2a 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -230,7 +230,7 @@ static mp_pool_t *mp_allocated_pools = NULL; void mp_pool_init(void) { - EventAddEx(NULL, "mp_pool_garbage_collect", 119, 0, &mp_pool_garbage_collect, NULL); + EventAdd(NULL, "mp_pool_garbage_collect", 119, 0, &mp_pool_garbage_collect, NULL); } /** Helper: Allocate and return a new memory chunk for pool. Does not diff --git a/src/modules/chanmodes/floodprot.c b/src/modules/chanmodes/floodprot.c index 079033552..45804b48c 100644 --- a/src/modules/chanmodes/floodprot.c +++ b/src/modules/chanmodes/floodprot.c @@ -164,7 +164,7 @@ MOD_INIT(floodprot) MOD_LOAD(floodprot) { - EventAddEx(ModInfo->handle, "modef_event", 10, 0, modef_event, NULL); + EventAdd(ModInfo->handle, "modef_event", 10, 0, modef_event, NULL); floodprot_rehash_complete(); return MOD_SUCCESS; } diff --git a/src/modules/chanmodes/history.c b/src/modules/chanmodes/history.c index 3030f0e68..73d7dfd9b 100644 --- a/src/modules/chanmodes/history.c +++ b/src/modules/chanmodes/history.c @@ -103,7 +103,7 @@ MOD_INIT(history) MOD_LOAD(history) { - EventAddEx(modinfo->handle, "history_clean", HISTORY_TIMER_EVERY, 0, history_clean, NULL); + EventAdd(modinfo->handle, "history_clean", HISTORY_TIMER_EVERY, 0, history_clean, NULL); return MOD_SUCCESS; } diff --git a/src/modules/connthrottle.c b/src/modules/connthrottle.c index 45916d127..615488098 100644 --- a/src/modules/connthrottle.c +++ b/src/modules/connthrottle.c @@ -113,7 +113,7 @@ MOD_INIT(connthrottle) MOD_LOAD(connthrottle) { rehash_read_settings(); - EventAddEx(modinfo->handle, "connthrottle_evt", 1, 0, connthrottle_evt, NULL); + EventAdd(modinfo->handle, "connthrottle_evt", 1, 0, connthrottle_evt, NULL); return MOD_SUCCESS; } diff --git a/src/modules/extbans/timedban.c b/src/modules/extbans/timedban.c index 43a3284b0..49f1f58d4 100644 --- a/src/modules/extbans/timedban.c +++ b/src/modules/extbans/timedban.c @@ -91,7 +91,7 @@ ExtbanInfo extban; return MOD_FAILED; } - EventAddEx(modinfo->handle, "timedban_timeout", TIMEDBAN_TIMER, 0, timedban_timeout, NULL); + EventAdd(modinfo->handle, "timedban_timeout", TIMEDBAN_TIMER, 0, timedban_timeout, NULL); return MOD_SUCCESS; } diff --git a/src/modules/jointhrottle.c b/src/modules/jointhrottle.c index 52e29c0c1..527dec461 100644 --- a/src/modules/jointhrottle.c +++ b/src/modules/jointhrottle.c @@ -100,7 +100,7 @@ MOD_INIT(jointhrottle) MOD_LOAD(jointhrottle) { - EventAddEx(ModInfo->handle, "jointhrottle_cleanup_structs", 60, 0, jointhrottle_cleanup_structs, NULL); + EventAdd(ModInfo->handle, "jointhrottle_cleanup_structs", 60, 0, jointhrottle_cleanup_structs, NULL); return MOD_SUCCESS; } diff --git a/src/modules/link-security.c b/src/modules/link-security.c index 6a096ca1d..f7a9681cb 100644 --- a/src/modules/link-security.c +++ b/src/modules/link-security.c @@ -81,7 +81,7 @@ MOD_LOAD(link_security) cap.parameter = link_security_capability_parameter; ClientCapabilityAdd(modinfo->handle, &cap, NULL); - EventAddEx(modinfo->handle, "checklinksec", 2, 0, checklinksec, NULL); + EventAdd(modinfo->handle, "checklinksec", 2, 0, checklinksec, NULL); checklinksec(NULL); return MOD_SUCCESS; } diff --git a/src/modules/m_list.c b/src/modules/m_list.c index 3df832683..ea121b62b 100644 --- a/src/modules/m_list.c +++ b/src/modules/m_list.c @@ -48,7 +48,7 @@ MOD_TEST(m_list) MOD_INIT(m_list) { CommandAdd(modinfo->handle, MSG_LIST, m_list, MAXPARA, M_USER); - EventAddEx(modinfo->handle, "send_queued_list_data", 1, 0, send_queued_list_data, NULL); + EventAdd(modinfo->handle, "send_queued_list_data", 1, 0, send_queued_list_data, NULL); MARK_AS_OFFICIAL_MODULE(modinfo); return MOD_SUCCESS; } diff --git a/src/modules/m_tkl.c b/src/modules/m_tkl.c index 5ca16af89..6c9ce0648 100644 --- a/src/modules/m_tkl.c +++ b/src/modules/m_tkl.c @@ -145,7 +145,7 @@ MOD_INIT(m_tkl) /* Is first run when server is 100% ready */ MOD_LOAD(m_tkl) { - EventAddEx(TklModInfo->handle, "tklexpire", 5, 0, tkl_check_expire, NULL); + EventAdd(TklModInfo->handle, "tklexpire", 5, 0, tkl_check_expire, NULL); return MOD_SUCCESS; } diff --git a/src/modules/reputation.c b/src/modules/reputation.c index e7dfc200a..2e27f1a31 100644 --- a/src/modules/reputation.c +++ b/src/modules/reputation.c @@ -167,9 +167,9 @@ MOD_LOAD(reputation) load_db(); if (reputation_starttime == 0) reputation_starttime = TStime(); - EventAddEx(ModInf.handle, "delete_old_records", DELETE_OLD_EVERY, 0, delete_old_records, NULL); - EventAddEx(ModInf.handle, "add_scores", BUMP_SCORE_EVERY, 0, add_scores, NULL); - EventAddEx(ModInf.handle, "save_db", SAVE_DB_EVERY, 0, save_db_evt, NULL); + EventAdd(ModInf.handle, "delete_old_records", DELETE_OLD_EVERY, 0, delete_old_records, NULL); + EventAdd(ModInf.handle, "add_scores", BUMP_SCORE_EVERY, 0, add_scores, NULL); + EventAdd(ModInf.handle, "save_db", SAVE_DB_EVERY, 0, save_db_evt, NULL); return MOD_SUCCESS; } diff --git a/src/modules/tkldb.c b/src/modules/tkldb.c index 59e6c6c49..fad0ba856 100644 --- a/src/modules/tkldb.c +++ b/src/modules/tkldb.c @@ -151,7 +151,7 @@ MOD_INIT(tkldb) MOD_LOAD(tkldb) { - EventAddEx(modinfo->handle, "tkldb_write_tkldb", TKL_DB_SAVE_EVERY, 0, write_tkldb_evt, NULL); + EventAdd(modinfo->handle, "tkldb_write_tkldb", TKL_DB_SAVE_EVERY, 0, write_tkldb_evt, NULL); if (ModuleGetError(modinfo->handle) != MODERR_NOERROR) { config_error("A critical error occurred when loading module %s: %s", MOD_HEADER(tkldb).name, ModuleGetErrorStr(modinfo->handle)); diff --git a/src/res.c b/src/res.c index a62db77d0..36cddeac1 100644 --- a/src/res.c +++ b/src/res.c @@ -183,7 +183,7 @@ int optmask; } ares_set_socket_callback(resolver_channel, unrealdns_sock_create_cb, NULL); - unrealdns_timeout_hdl = EventAddEx(NULL, "unrealdns_timeout", 0, 0, unrealdns_timeout, NULL); + unrealdns_timeout_hdl = EventAdd(NULL, "unrealdns_timeout", 0, 0, unrealdns_timeout, NULL); } void reinit_resolver(aClient *sptr) diff --git a/src/s_conf.c b/src/s_conf.c index cb868ca72..9dbe8c1f1 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -10917,7 +10917,7 @@ void special_delayed_unloading(void) { config_warn("Delaying module unloading of '%s' due to moddata", m->header->name); m->flags |= MODFLAG_DELAYED; - EventAddEx(NULL, "e_unload_module_delayed", 5, 1, e_unload_module_delayed, m->header->name); + EventAdd(NULL, "e_unload_module_delayed", 5, 1, e_unload_module_delayed, m->header->name); } } } diff --git a/src/url.c b/src/url.c index 34b52c653..3d0e5b848 100644 --- a/src/url.c +++ b/src/url.c @@ -382,7 +382,7 @@ void url_init(void) multihandle = curl_multi_init(); curl_multi_setopt(multihandle, CURLMOPT_SOCKETFUNCTION, url_socket_cb); - curl_socket_timeout_hdl = EventAddEx(NULL, "curl_socket_timeout", 1, 0, curl_socket_timeout, NULL); + curl_socket_timeout_hdl = EventAdd(NULL, "curl_socket_timeout", 1, 0, curl_socket_timeout, NULL); } /*