diff --git a/extensions/chm_adminonly.c b/extensions/chm_adminonly.c index eba49cdc..445a3014 100644 --- a/extensions/chm_adminonly.c +++ b/extensions/chm_adminonly.c @@ -13,10 +13,10 @@ static const char chm_adminonly_desc[] = "Enables channel mode +A that blocks non-admins from joining a channel"; -static void h_can_join(hook_data_channel *); +static void h_can_join(void *); mapi_hfn_list_av1 adminonly_hfnlist[] = { - { "can_join", (hookfn) h_can_join }, + { "can_join", h_can_join }, { NULL, NULL } }; @@ -41,8 +41,9 @@ _moddeinit(void) DECLARE_MODULE_AV2(chm_adminonly, _modinit, _moddeinit, NULL, NULL, adminonly_hfnlist, NULL, NULL, chm_adminonly_desc); static void -h_can_join(hook_data_channel *data) +h_can_join(void *data_) { + hook_data_channel *data = data_; struct Client *source_p = data->client; struct Channel *chptr = data->chptr; diff --git a/extensions/chm_insecure.c b/extensions/chm_insecure.c index b2c4ba5e..177273ba 100644 --- a/extensions/chm_insecure.c +++ b/extensions/chm_insecure.c @@ -14,10 +14,10 @@ static const char chm_insecure_desc[] = "Adds channel mode +U that allows non-SSL users to join a channel, " "disallowing them by default"; -static void h_can_join(hook_data_channel *); +static void h_can_join(void *); mapi_hfn_list_av1 sslonly_hfnlist[] = { - { "can_join", (hookfn) h_can_join }, + { "can_join", h_can_join }, { NULL, NULL } }; @@ -43,8 +43,9 @@ _moddeinit(void) DECLARE_MODULE_AV2(chm_insecure, _modinit, _moddeinit, NULL, NULL, sslonly_hfnlist, NULL, NULL, chm_insecure_desc); static void -h_can_join(hook_data_channel *data) +h_can_join(void *data_) { + hook_data_channel *data = data_; struct Client *source_p = data->client; struct Channel *chptr = data->chptr; diff --git a/extensions/chm_nonotice.c b/extensions/chm_nonotice.c index 91691865..f0a42523 100644 --- a/extensions/chm_nonotice.c +++ b/extensions/chm_nonotice.c @@ -40,16 +40,18 @@ static const char chm_nonotice_desc[] = static unsigned int mode_nonotice; -static void chm_nonotice_process(hook_data_privmsg_channel *); +static void chm_nonotice_process(void *); mapi_hfn_list_av1 chm_nonotice_hfnlist[] = { - { "privmsg_channel", (hookfn) chm_nonotice_process }, + { "privmsg_channel", chm_nonotice_process }, { NULL, NULL } }; static void -chm_nonotice_process(hook_data_privmsg_channel *data) +chm_nonotice_process(void *data_) { + hook_data_privmsg_channel *data = data_; + /* don't waste CPU if message is already blocked */ if (data->approved || data->msgtype != MESSAGE_TYPE_NOTICE) return; diff --git a/extensions/chm_operonly.c b/extensions/chm_operonly.c index ba4df9dd..4295ee83 100644 --- a/extensions/chm_operonly.c +++ b/extensions/chm_operonly.c @@ -13,10 +13,10 @@ static const char chm_operonly_desc[] = "Adds channel mode +O which makes a channel operator-only"; -static void h_can_join(hook_data_channel *); +static void h_can_join(void *); mapi_hfn_list_av1 operonly_hfnlist[] = { - { "can_join", (hookfn) h_can_join }, + { "can_join", h_can_join }, { NULL, NULL } }; @@ -42,8 +42,9 @@ _moddeinit(void) DECLARE_MODULE_AV2(chm_operonly, _modinit, _moddeinit, NULL, NULL, operonly_hfnlist, NULL, NULL, chm_operonly_desc); static void -h_can_join(hook_data_channel *data) +h_can_join(void *data_) { + hook_data_channel *data = data_; struct Client *source_p = data->client; struct Channel *chptr = data->chptr; diff --git a/extensions/chm_operpeace.c b/extensions/chm_operpeace.c index f0d1afaa..53a22d9b 100644 --- a/extensions/chm_operpeace.c +++ b/extensions/chm_operpeace.c @@ -21,10 +21,10 @@ static const char chm_operpeace_desc[] = "Adds channel mode +M which prohibits operators from being kicked"; -static void hdl_can_kick(hook_data_channel_approval *); +static void hdl_can_kick(void *); mapi_hfn_list_av1 chm_operpeace_hfnlist[] = { - { "can_kick", (hookfn) hdl_can_kick }, + { "can_kick", hdl_can_kick }, { NULL, NULL } }; @@ -49,8 +49,9 @@ _moddeinit(void) DECLARE_MODULE_AV2(chm_operpeace, _modinit, _moddeinit, NULL, NULL, chm_operpeace_hfnlist, NULL, NULL, chm_operpeace_desc); static void -hdl_can_kick(hook_data_channel_approval *data) +hdl_can_kick(void *data_) { + hook_data_channel_approval *data = data_; struct Client *source_p = data->client; struct Client *who = data->target; struct Channel *chptr = data->chptr; diff --git a/extensions/chm_regmsg.c b/extensions/chm_regmsg.c index 9bf81523..97c851ff 100644 --- a/extensions/chm_regmsg.c +++ b/extensions/chm_regmsg.c @@ -43,7 +43,7 @@ static unsigned int mode_regmsg; static void chm_regmsg_process(void *); mapi_hfn_list_av1 chm_regmsg_hfnlist[] = { - { "privmsg_channel", (hookfn) chm_regmsg_process }, + { "privmsg_channel", chm_regmsg_process }, { NULL, NULL } }; diff --git a/extensions/chm_sslonly.c b/extensions/chm_sslonly.c index 4c233ccc..183d843a 100644 --- a/extensions/chm_sslonly.c +++ b/extensions/chm_sslonly.c @@ -13,10 +13,10 @@ static const char chm_sslonly_desc[] = "Adds channel mode +S that bans non-SSL users from joing a channel"; -static void h_can_join(hook_data_channel *); +static void h_can_join(void *); mapi_hfn_list_av1 sslonly_hfnlist[] = { - { "can_join", (hookfn) h_can_join }, + { "can_join", h_can_join }, { NULL, NULL } }; @@ -41,8 +41,9 @@ _moddeinit(void) DECLARE_MODULE_AV2(chm_sslonly, _modinit, _moddeinit, NULL, NULL, sslonly_hfnlist, NULL, NULL, chm_sslonly_desc); static void -h_can_join(hook_data_channel *data) +h_can_join(void *data_) { + hook_data_channel *data = data_; struct Client *source_p = data->client; struct Channel *chptr = data->chptr; diff --git a/extensions/createauthonly.c b/extensions/createauthonly.c index 78ad3da2..2baa2e5a 100644 --- a/extensions/createauthonly.c +++ b/extensions/createauthonly.c @@ -19,18 +19,19 @@ static const char restrict_desc[] = "Restricts channel creation to authenticated users and IRC operators only"; -static void h_can_create_channel_authenticated(hook_data_client_approval *); +static void h_can_create_channel_authenticated(void *); mapi_hfn_list_av1 restrict_hfnlist[] = { - { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, + { "can_create_channel", h_can_create_channel_authenticated }, { NULL, NULL } }; DECLARE_MODULE_AV2(createauthonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NULL, NULL, restrict_desc); static void -h_can_create_channel_authenticated(hook_data_client_approval *data) +h_can_create_channel_authenticated(void *data_) { + hook_data_client_approval *data = data_; struct Client *source_p = data->client; if (*source_p->user->suser == '\0' && !IsOperGeneral(source_p)) diff --git a/extensions/createoperonly.c b/extensions/createoperonly.c index fb004783..50d996de 100644 --- a/extensions/createoperonly.c +++ b/extensions/createoperonly.c @@ -19,18 +19,19 @@ static const char restrict_desc[] = "Restricts channel creation to IRC operators"; -static void h_can_create_channel_authenticated(hook_data_client_approval *); +static void h_can_create_channel_authenticated(void *); mapi_hfn_list_av1 restrict_hfnlist[] = { - { "can_create_channel", (hookfn) h_can_create_channel_authenticated }, + { "can_create_channel", h_can_create_channel_authenticated }, { NULL, NULL } }; DECLARE_MODULE_AV2(createoperonly, NULL, NULL, NULL, NULL, restrict_hfnlist, NULL, NULL, restrict_desc); static void -h_can_create_channel_authenticated(hook_data_client_approval *data) +h_can_create_channel_authenticated(void *data_) { + hook_data_client_approval *data = data_; struct Client *source_p = data->client; if (!IsOperGeneral(source_p)) diff --git a/extensions/drain.c b/extensions/drain.c index 9829eeb6..2b44567e 100644 --- a/extensions/drain.c +++ b/extensions/drain.c @@ -6,7 +6,7 @@ static void check_new_user(void *data); mapi_hfn_list_av1 drain_hfnlist[] = { - { "new_local_user", (hookfn) check_new_user }, + { "new_local_user", check_new_user }, { NULL, NULL } }; diff --git a/extensions/example_module.c b/extensions/example_module.c index bc277316..d20fd42b 100644 --- a/extensions/example_module.c +++ b/extensions/example_module.c @@ -112,7 +112,7 @@ mapi_hlist_av1 test_hlist[] = { static void show_example_hook(void *unused); mapi_hfn_list_av1 test_hfnlist[] = { - { "doing_example_hook", (hookfn) show_example_hook }, + { "doing_example_hook", show_example_hook }, { NULL, NULL } }; diff --git a/extensions/filter.c b/extensions/filter.c index 02d75ab3..bebcbdfc 100644 --- a/extensions/filter.c +++ b/extensions/filter.c @@ -90,10 +90,10 @@ static char check_str[21] = ""; static unsigned filter_chmode, filter_umode; mapi_hfn_list_av1 filter_hfnlist[] = { - { "privmsg_user", (hookfn) filter_msg_user }, - { "privmsg_channel", (hookfn) filter_msg_channel }, - { "client_quit", (hookfn) filter_client_quit }, - { "client_exit", (hookfn) on_client_exit }, + { "privmsg_user", filter_msg_user }, + { "privmsg_channel", filter_msg_channel }, + { "client_quit", filter_client_quit }, + { "client_exit", on_client_exit }, { NULL, NULL } }; diff --git a/extensions/force_user_invis.c b/extensions/force_user_invis.c index 8a94d33d..f4970df7 100644 --- a/extensions/force_user_invis.c +++ b/extensions/force_user_invis.c @@ -18,18 +18,19 @@ static const char noi_desc[] = "Do not allow users to remove user mode +i unless they are operators"; -static void h_noi_umode_changed(hook_data_umode_changed *); +static void h_noi_umode_changed(void *); mapi_hfn_list_av1 noi_hfnlist[] = { - { "umode_changed", (hookfn) h_noi_umode_changed }, + { "umode_changed", h_noi_umode_changed }, { NULL, NULL } }; DECLARE_MODULE_AV2(force_user_invis, NULL, NULL, NULL, NULL, noi_hfnlist, NULL, NULL, noi_desc); static void -h_noi_umode_changed(hook_data_umode_changed *hdata) +h_noi_umode_changed(void *data) { + hook_data_umode_changed *hdata = data; struct Client *source_p = hdata->client; if (MyClient(source_p) && !IsOperGeneral(source_p) && !IsInvisible(source_p)) { diff --git a/extensions/helpops.c b/extensions/helpops.c index 72d81290..58dc8e02 100644 --- a/extensions/helpops.c +++ b/extensions/helpops.c @@ -17,11 +17,11 @@ static const char helpops_desc[] = "The helpops system as used by freenode"; static rb_dlink_list helper_list = { NULL, NULL, 0 }; -static void h_hdl_stats_request(hook_data_int *hdata); -static void h_hdl_new_remote_user(struct Client *client_p); -static void h_hdl_client_exit(hook_data_client_exit *hdata); -static void h_hdl_umode_changed(hook_data_umode_changed *hdata); -static void h_hdl_whois(hook_data_client *hdata); +static void h_hdl_stats_request(void *hdata); +static void h_hdl_new_remote_user(void *client_p); +static void h_hdl_client_exit(void *hdata); +static void h_hdl_umode_changed(void *hdata); +static void h_hdl_whois(void *hdata); static void recurse_client_exit(struct Client *client_p); static void helper_add(struct Client *client_p); static void helper_delete(struct Client *client_p); @@ -30,12 +30,12 @@ static void me_dehelper(struct MsgBuf *, struct Client *, struct Client *, int, static void do_dehelper(struct Client *source_p, struct Client *target_p); mapi_hfn_list_av1 helpops_hfnlist[] = { - { "doing_stats", (hookfn) h_hdl_stats_request }, - { "new_remote_user", (hookfn) h_hdl_new_remote_user }, - { "client_exit", (hookfn) h_hdl_client_exit }, - { "umode_changed", (hookfn) h_hdl_umode_changed }, - { "doing_whois", (hookfn) h_hdl_whois }, - { "doing_whois_global", (hookfn) h_hdl_whois }, + { "doing_stats", h_hdl_stats_request }, + { "new_remote_user", h_hdl_new_remote_user }, + { "client_exit", h_hdl_client_exit }, + { "umode_changed", h_hdl_umode_changed }, + { "doing_whois", h_hdl_whois }, + { "doing_whois_global", h_hdl_whois }, { NULL, NULL } }; @@ -137,8 +137,9 @@ _moddeinit(void) } static void -h_hdl_stats_request(hook_data_int *hdata) +h_hdl_stats_request(void *data) { + hook_data_int *hdata = data; struct Client *target_p; rb_dlink_node *helper_ptr; unsigned int count = 0; @@ -183,8 +184,9 @@ helper_delete(struct Client *client_p) } static void -h_hdl_new_remote_user(struct Client *client_p) +h_hdl_new_remote_user(void *data) { + struct Client *client_p = data; if (client_p->umodes & user_modes[UMODECHAR_HELPOPS]) helper_add(client_p); } @@ -210,14 +212,16 @@ recurse_client_exit(struct Client *client_p) } static void -h_hdl_client_exit(hook_data_client_exit *hdata) +h_hdl_client_exit(void *data) { + hook_data_client_exit *hdata = data; recurse_client_exit(hdata->target); } static void -h_hdl_umode_changed(hook_data_umode_changed *hdata) +h_hdl_umode_changed(void *data) { + hook_data_umode_changed *hdata = data; struct Client *source_p = hdata->client; /* didn't change +h umode, we don't need to do anything */ @@ -245,8 +249,9 @@ h_hdl_umode_changed(hook_data_umode_changed *hdata) } static void -h_hdl_whois(hook_data_client *hdata) +h_hdl_whois(void *data) { + hook_data_client *hdata = data; struct Client *source_p = hdata->client; struct Client *target_p = hdata->target; diff --git a/extensions/hide_uncommon_channels.c b/extensions/hide_uncommon_channels.c index f9587b64..5f087b59 100644 --- a/extensions/hide_uncommon_channels.c +++ b/extensions/hide_uncommon_channels.c @@ -17,7 +17,7 @@ static const char hide_desc[] = "Hides channel memberships not shared"; static void h_huc_doing_whois_channel_visibility(void *); mapi_hfn_list_av1 huc_hfnlist[] = { - { "doing_whois_channel_visibility", (hookfn) h_huc_doing_whois_channel_visibility }, + { "doing_whois_channel_visibility", h_huc_doing_whois_channel_visibility }, { NULL, NULL } }; diff --git a/extensions/hurt.c b/extensions/hurt.c index 25eafef1..851665aa 100644 --- a/extensions/hurt.c +++ b/extensions/hurt.c @@ -55,9 +55,9 @@ static void me_heal(struct MsgBuf *msgbuf_p, struct Client *, struct Client *, i static int modinit(void); static void modfini(void); -static void client_exit_hook(hook_data_client_exit *); -static void new_local_user_hook(struct Client *); -static void doing_stats_hook(hook_data_int *hdata); +static void client_exit_hook(void *); +static void new_local_user_hook(void *); +static void doing_stats_hook(void *); static void hurt_check_event(void *); static void hurt_expire_event(void *); @@ -98,9 +98,9 @@ struct Message heal_msgtab = { /* {{{ Misc module stuff */ mapi_hfn_list_av1 hurt_hfnlist[] = { - {"client_exit", (hookfn) client_exit_hook}, - {"new_local_user", (hookfn) new_local_user_hook}, - {"doing_stats", (hookfn) doing_stats_hook}, + {"client_exit", client_exit_hook}, + {"new_local_user", new_local_user_hook}, + {"doing_stats", doing_stats_hook}, {NULL, NULL}, }; @@ -429,8 +429,9 @@ hurt_expire_event(void *unused) /* {{{ static void client_exit_hook() */ static void -client_exit_hook(hook_data_client_exit *data) +client_exit_hook(void *data_) { + hook_data_client_exit *data = data_; s_assert(data != NULL); s_assert(data->target != NULL); @@ -440,8 +441,9 @@ client_exit_hook(hook_data_client_exit *data) /* {{{ static void new_local_user_hook() */ static void -new_local_user_hook(struct Client *source_p) +new_local_user_hook(void *data) { + struct Client *source_p = data; if (IsAnyDead(source_p) || !EmptyString(source_p->user->suser) || IsExemptKline(source_p)) return; @@ -458,8 +460,9 @@ new_local_user_hook(struct Client *source_p) /* {{{ static void doing_stats_hook() */ static void -doing_stats_hook(hook_data_int *hdata) +doing_stats_hook(void *data) { + hook_data_int *hdata = data; rb_dlink_node *ptr; hurt_t *hurt; struct Client *source_p; diff --git a/extensions/invex_regonly.c b/extensions/invex_regonly.c index 2cce04ab..c958fb39 100644 --- a/extensions/invex_regonly.c +++ b/extensions/invex_regonly.c @@ -8,18 +8,19 @@ #include "s_conf.h" #include "numeric.h" -static void h_can_join(hook_data_channel *); +static void h_can_join(void *); mapi_hfn_list_av1 invex_regonly_hfnlist[] = { - { "can_join", (hookfn) h_can_join }, + { "can_join", h_can_join }, { NULL, NULL } }; DECLARE_MODULE_AV1(invex_regonly, NULL, NULL, NULL, NULL, invex_regonly_hfnlist, "$Revision$"); static void -h_can_join(hook_data_channel *data) +h_can_join(void *data_) { + hook_data_channel *data = data_; struct Client *source_p = data->client; struct Channel *chptr = data->chptr; struct Ban *invex = NULL; diff --git a/extensions/ip_cloaking.c b/extensions/ip_cloaking.c index 4ae0ca92..cf2796c6 100644 --- a/extensions/ip_cloaking.c +++ b/extensions/ip_cloaking.c @@ -40,8 +40,8 @@ _moddeinit(void) static void check_umode_change(void *data); static void check_new_user(void *data); mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { - { "umode_changed", (hookfn) check_umode_change }, - { "new_local_user", (hookfn) check_new_user }, + { "umode_changed", check_umode_change }, + { "new_local_user", check_new_user }, { NULL, NULL } }; diff --git a/extensions/ip_cloaking_3.0.c b/extensions/ip_cloaking_3.0.c index 2b6f2dcb..16912d96 100644 --- a/extensions/ip_cloaking_3.0.c +++ b/extensions/ip_cloaking_3.0.c @@ -36,8 +36,8 @@ _moddeinit(void) static void check_umode_change(void *data); static void check_new_user(void *data); mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { - { "umode_changed", (hookfn) check_umode_change }, - { "new_local_user", (hookfn) check_new_user }, + { "umode_changed", check_umode_change }, + { "new_local_user", check_new_user }, { NULL, NULL } }; diff --git a/extensions/ip_cloaking_4.0.c b/extensions/ip_cloaking_4.0.c index e298651c..d7313af6 100644 --- a/extensions/ip_cloaking_4.0.c +++ b/extensions/ip_cloaking_4.0.c @@ -40,8 +40,8 @@ _moddeinit(void) static void check_umode_change(void *data); static void check_new_user(void *data); mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { - { "umode_changed", (hookfn) check_umode_change }, - { "new_local_user", (hookfn) check_new_user }, + { "umode_changed", check_umode_change }, + { "new_local_user", check_new_user }, { NULL, NULL } }; diff --git a/extensions/ip_cloaking_old.c b/extensions/ip_cloaking_old.c index 8333e362..a4736df7 100644 --- a/extensions/ip_cloaking_old.c +++ b/extensions/ip_cloaking_old.c @@ -36,8 +36,8 @@ _moddeinit(void) static void check_umode_change(void *data); static void check_new_user(void *data); mapi_hfn_list_av1 ip_cloaking_hfnlist[] = { - { "umode_changed", (hookfn) check_umode_change }, - { "new_local_user", (hookfn) check_new_user }, + { "umode_changed", check_umode_change }, + { "new_local_user", check_new_user }, { NULL, NULL } }; diff --git a/extensions/m_remove.c b/extensions/m_remove.c index daea314b..f2940138 100644 --- a/extensions/m_remove.c +++ b/extensions/m_remove.c @@ -42,7 +42,7 @@ static const char description[] = "Provides the REMOVE command, an alternative to KICK"; static void m_remove(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static void remove_quote_part(hook_data_privmsg_channel *); +static void remove_quote_part(void *); unsigned int CAP_REMOVE; static char part_buf[REASONLEN + 1]; @@ -54,7 +54,7 @@ struct Message remove_msgtab = { mapi_clist_av1 remove_clist[] = { &remove_msgtab, NULL }; mapi_hfn_list_av1 remove_hfnlist[] = { - { "privmsg_channel", (hookfn) remove_quote_part }, + { "privmsg_channel", remove_quote_part }, { NULL, NULL } }; mapi_cap_list_av2 remove_cap_list[] = { @@ -213,8 +213,9 @@ m_remove(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source } static void -remove_quote_part(hook_data_privmsg_channel *data) +remove_quote_part(void *data_) { + hook_data_privmsg_channel *data = data_; if (data->approved || EmptyString(data->text) || data->msgtype != MESSAGE_TYPE_PART) return; diff --git a/extensions/m_webirc.c b/extensions/m_webirc.c index f169435d..d0b648c3 100644 --- a/extensions/m_webirc.c +++ b/extensions/m_webirc.c @@ -67,7 +67,7 @@ mapi_clist_av1 webirc_clist[] = { &webirc_msgtab, NULL }; static void new_local_user(void *data); mapi_hfn_list_av1 webirc_hfnlist[] = { /* unintuitive but correct--we want to be called first */ - { "new_local_user", (hookfn) new_local_user, HOOK_LOWEST }, + { "new_local_user", new_local_user, HOOK_LOWEST }, { NULL, NULL } }; diff --git a/extensions/no_kill_services.c b/extensions/no_kill_services.c index 15f6365c..09c10d3c 100644 --- a/extensions/no_kill_services.c +++ b/extensions/no_kill_services.c @@ -25,7 +25,7 @@ static const char nokill_desc[] = "Prevents operators from killing services"; static void block_services_kill(void *data); mapi_hfn_list_av1 no_kill_services_hfnlist[] = { - { "can_kill", (hookfn) block_services_kill }, + { "can_kill", block_services_kill }, { NULL, NULL } }; diff --git a/extensions/no_locops.c b/extensions/no_locops.c index 7fc7d1b6..077a4653 100644 --- a/extensions/no_locops.c +++ b/extensions/no_locops.c @@ -14,18 +14,19 @@ static const char no_locops_desc[] = "Disables local operators"; -static void h_nl_umode_changed(hook_data_umode_changed *); +static void h_nl_umode_changed(void *); mapi_hfn_list_av1 nl_hfnlist[] = { - { "umode_changed", (hookfn) h_nl_umode_changed }, + { "umode_changed", h_nl_umode_changed }, { NULL, NULL } }; DECLARE_MODULE_AV2(no_locops, NULL, NULL, NULL, NULL, nl_hfnlist, NULL, NULL, no_locops_desc); static void -h_nl_umode_changed(hook_data_umode_changed *hdata) +h_nl_umode_changed(void *data) { + hook_data_umode_changed *hdata = data; struct Client *source_p = hdata->client; if (MyClient(source_p) && source_p->umodes & UMODE_LOCOPS) diff --git a/extensions/no_oper_invis.c b/extensions/no_oper_invis.c index def1b016..4b47237f 100644 --- a/extensions/no_oper_invis.c +++ b/extensions/no_oper_invis.c @@ -16,18 +16,19 @@ static const char noi_desc[] = "Disallow operators from setting user mode +i on themselves"; -static void h_noi_umode_changed(hook_data_umode_changed *); +static void h_noi_umode_changed(void *); mapi_hfn_list_av1 noi_hfnlist[] = { - { "umode_changed", (hookfn) h_noi_umode_changed }, + { "umode_changed", h_noi_umode_changed }, { NULL, NULL } }; DECLARE_MODULE_AV2(no_oper_invis, NULL, NULL, NULL, NULL, noi_hfnlist, NULL, NULL, noi_desc); static void -h_noi_umode_changed(hook_data_umode_changed *hdata) +h_noi_umode_changed(void *data) { + hook_data_umode_changed *hdata = data; struct Client *source_p = hdata->client; if (MyClient(source_p) && IsOper(source_p) && !IsOperInvis(source_p) && diff --git a/extensions/override.c b/extensions/override.c index d0934347..5b1f60fb 100644 --- a/extensions/override.c +++ b/extensions/override.c @@ -34,13 +34,13 @@ static void hack_can_invite(void *data); static void handle_client_exit(void *data); mapi_hfn_list_av1 override_hfnlist[] = { - { "umode_changed", (hookfn) check_umode_change }, - { "get_channel_access", (hookfn) hack_channel_access, HOOK_HIGHEST }, - { "can_join", (hookfn) hack_can_join, HOOK_HIGHEST }, - { "can_kick", (hookfn) hack_can_kick, HOOK_HIGHEST }, - { "can_send", (hookfn) hack_can_send, HOOK_HIGHEST }, - { "can_invite", (hookfn) hack_can_invite, HOOK_HIGHEST }, - { "client_exit", (hookfn) handle_client_exit }, + { "umode_changed", check_umode_change }, + { "get_channel_access", hack_channel_access, HOOK_HIGHEST }, + { "can_join", hack_can_join, HOOK_HIGHEST }, + { "can_kick", hack_can_kick, HOOK_HIGHEST }, + { "can_send", hack_can_send, HOOK_HIGHEST }, + { "can_invite", hack_can_invite, HOOK_HIGHEST }, + { "client_exit", handle_client_exit }, { NULL, NULL } }; diff --git a/extensions/override_kick_immunity.c b/extensions/override_kick_immunity.c index df10ae8b..2d880102 100644 --- a/extensions/override_kick_immunity.c +++ b/extensions/override_kick_immunity.c @@ -14,7 +14,7 @@ static const char override_kick_immunity_desc[] = static void can_kick(void *data); mapi_hfn_list_av1 override_kick_immunity_hfnlist[] = { - { "can_kick", (hookfn) can_kick, HOOK_HIGHEST }, + { "can_kick", can_kick, HOOK_HIGHEST }, { NULL, NULL } }; diff --git a/extensions/restrict-unauthenticated.c b/extensions/restrict-unauthenticated.c index 16267a22..9ce4ef08 100644 --- a/extensions/restrict-unauthenticated.c +++ b/extensions/restrict-unauthenticated.c @@ -22,7 +22,7 @@ static const char restrict_desc[] = static void hack_channel_access(void *data); mapi_hfn_list_av1 restrict_unauthenticated_hfnlist[] = { - { "get_channel_access", (hookfn) hack_channel_access }, + { "get_channel_access", hack_channel_access }, { NULL, NULL } }; diff --git a/extensions/sno_channelcreate.c b/extensions/sno_channelcreate.c index 4259bf94..ba81dd19 100644 --- a/extensions/sno_channelcreate.c +++ b/extensions/sno_channelcreate.c @@ -20,7 +20,7 @@ static void _moddeinit(void); static void h_scc_channel_join(void *); mapi_hfn_list_av1 scc_hfnlist[] = { - { "channel_join", (hookfn) h_scc_channel_join }, + { "channel_join", h_scc_channel_join }, { NULL, NULL } }; diff --git a/extensions/sno_farconnect.c b/extensions/sno_farconnect.c index 89a8f045..780783d5 100644 --- a/extensions/sno_farconnect.c +++ b/extensions/sno_farconnect.c @@ -20,12 +20,12 @@ static const char sno_desc[] = static int _modinit(void); static void _moddeinit(void); -static void h_gcn_new_remote_user(struct Client *); -static void h_gcn_client_exit(hook_data_client_exit *); +static void h_gcn_new_remote_user(void *); +static void h_gcn_client_exit(void *); mapi_hfn_list_av1 gcn_hfnlist[] = { - { "new_remote_user", (hookfn) h_gcn_new_remote_user }, - { "client_exit", (hookfn) h_gcn_client_exit }, + { "new_remote_user", h_gcn_new_remote_user }, + { "client_exit", h_gcn_client_exit }, { NULL, NULL } }; @@ -51,8 +51,9 @@ _moddeinit(void) } static void -h_gcn_new_remote_user(struct Client *source_p) +h_gcn_new_remote_user(void *data) { + struct Client *source_p = data; if (!HasSentEob(source_p->servptr)) return; @@ -65,8 +66,9 @@ h_gcn_new_remote_user(struct Client *source_p) } static void -h_gcn_client_exit(hook_data_client_exit *hdata) +h_gcn_client_exit(void *data) { + hook_data_client_exit *hdata = data; struct Client *source_p; source_p = hdata->target; diff --git a/extensions/sno_globalnickchange.c b/extensions/sno_globalnickchange.c index 0e338c5c..7d3c2196 100644 --- a/extensions/sno_globalnickchange.c +++ b/extensions/sno_globalnickchange.c @@ -15,10 +15,10 @@ static const char sno_desc[] = "Adds server notices for remote nick changes"; static int _modinit(void); -static void h_gnc_nick_change(hook_data *data); +static void h_gnc_nick_change(void *data); mapi_hfn_list_av1 gcn_hfnlist[] = { - { "remote_nick_change", (hookfn) h_gnc_nick_change }, + { "remote_nick_change", h_gnc_nick_change }, { NULL, NULL } }; @@ -34,8 +34,9 @@ _modinit(void) } static void -h_gnc_nick_change(hook_data *data) +h_gnc_nick_change(void *data_) { + hook_data *data = data_; struct Client *source_p = data->client; const char *oldnick = data->arg1; const char *newnick = data->arg2; diff --git a/extensions/sno_globaloper.c b/extensions/sno_globaloper.c index ea5476c2..5df90d67 100644 --- a/extensions/sno_globaloper.c +++ b/extensions/sno_globaloper.c @@ -17,7 +17,7 @@ static const char sno_desc[] = static void h_sgo_umode_changed(void *); mapi_hfn_list_av1 sgo_hfnlist[] = { - { "umode_changed", (hookfn) h_sgo_umode_changed }, + { "umode_changed", h_sgo_umode_changed }, { NULL, NULL } }; diff --git a/extensions/umode_noctcp.c b/extensions/umode_noctcp.c index 0a485733..1325a62e 100644 --- a/extensions/umode_noctcp.c +++ b/extensions/umode_noctcp.c @@ -33,15 +33,17 @@ static const char umode_noctcp_desc[] = "Adds user mode +C which blocks CTCPs to the user."; -static void umode_noctcp_process(hook_data_privmsg_user *); +static void umode_noctcp_process(void *); mapi_hfn_list_av1 umode_noctcp_hfnlist[] = { - { "privmsg_user", (hookfn) umode_noctcp_process }, + { "privmsg_user", umode_noctcp_process }, { NULL, NULL } }; static void -umode_noctcp_process(hook_data_privmsg_user *data) { +umode_noctcp_process(void *data_) +{ + hook_data_privmsg_user *data = data_; if (!MyClient(data->target_p)) return; diff --git a/modules/cap_account_tag.c b/modules/cap_account_tag.c index 2ea5fa69..323309a0 100644 --- a/modules/cap_account_tag.c +++ b/modules/cap_account_tag.c @@ -37,11 +37,11 @@ static const char cap_account_tag_desc[] = "Provides the account-tag client capability"; -static void cap_account_tag_process(hook_data *); +static void cap_account_tag_process(void *); unsigned int CLICAP_ACCOUNT_TAG = 0; mapi_hfn_list_av1 cap_account_tag_hfnlist[] = { - { "outbound_msgbuf", (hookfn) cap_account_tag_process }, + { "outbound_msgbuf", cap_account_tag_process }, { NULL, NULL } }; mapi_cap_list_av2 cap_account_tag_cap_list[] = { @@ -49,8 +49,9 @@ mapi_cap_list_av2 cap_account_tag_cap_list[] = { { 0, NULL, NULL, NULL }, }; static void -cap_account_tag_process(hook_data *data) +cap_account_tag_process(void *data_) { + hook_data *data = data_; struct MsgBuf *msgbuf = data->arg1; if (data->client != NULL && IsPerson(data->client) && *data->client->user->suser) diff --git a/modules/cap_server_time.c b/modules/cap_server_time.c index 5a8f1289..49449880 100644 --- a/modules/cap_server_time.c +++ b/modules/cap_server_time.c @@ -37,11 +37,11 @@ static const char cap_server_time_desc[] = "Provides the server-time client capability"; -static void cap_server_time_process(hook_data *); +static void cap_server_time_process(void *); unsigned int CLICAP_SERVER_TIME = 0; mapi_hfn_list_av1 cap_server_time_hfnlist[] = { - { "outbound_msgbuf", (hookfn) cap_server_time_process }, + { "outbound_msgbuf", cap_server_time_process }, { NULL, NULL } }; mapi_cap_list_av2 cap_server_time_cap_list[] = { @@ -50,8 +50,9 @@ mapi_cap_list_av2 cap_server_time_cap_list[] = { }; static void -cap_server_time_process(hook_data *data) +cap_server_time_process(void *data_) { + hook_data *data = data_; static char buf[BUFSIZE]; struct MsgBuf *msgbuf = data->arg1; struct timeval tv; diff --git a/modules/chm_nocolour.c b/modules/chm_nocolour.c index 003788cd..fcad1bab 100644 --- a/modules/chm_nocolour.c +++ b/modules/chm_nocolour.c @@ -40,16 +40,17 @@ static const char chm_nocolour_desc[] = static char buf[BUFSIZE]; static unsigned int mode_nocolour; -static void chm_nocolour_process(hook_data_privmsg_channel *); +static void chm_nocolour_process(void *); mapi_hfn_list_av1 chm_nocolour_hfnlist[] = { - { "privmsg_channel", (hookfn) chm_nocolour_process }, + { "privmsg_channel", chm_nocolour_process }, { NULL, NULL } }; static void -chm_nocolour_process(hook_data_privmsg_channel *data) +chm_nocolour_process(void *data_) { + hook_data_privmsg_channel *data = data_; /* don't waste CPU if message is already blocked */ if (data->approved) return; diff --git a/modules/chm_noctcp.c b/modules/chm_noctcp.c index b0f46916..b1f8a7e5 100644 --- a/modules/chm_noctcp.c +++ b/modules/chm_noctcp.c @@ -39,16 +39,17 @@ static const char chm_noctcp_desc[] = static unsigned int mode_noctcp; -static void chm_noctcp_process(hook_data_privmsg_channel *); +static void chm_noctcp_process(void *); mapi_hfn_list_av1 chm_noctcp_hfnlist[] = { - { "privmsg_channel", (hookfn) chm_noctcp_process }, + { "privmsg_channel", chm_noctcp_process }, { NULL, NULL } }; static void -chm_noctcp_process(hook_data_privmsg_channel *data) +chm_noctcp_process(void *data_) { + hook_data_privmsg_channel *data = data_; /* don't waste CPU if message is already blocked */ if (data->approved || data->msgtype == MESSAGE_TYPE_NOTICE) return; diff --git a/modules/m_alias.c b/modules/m_alias.c index b8f1b035..2645f121 100644 --- a/modules/m_alias.c +++ b/modules/m_alias.c @@ -37,11 +37,11 @@ static const char alias_desc[] = "Provides the system for services aliases"; static int _modinit(void); static void _moddeinit(void); -static int reload_aliases(hook_data *); +static void reload_aliases(void *); static void m_alias(struct MsgBuf *, struct Client *, struct Client *, int, const char **); mapi_hfn_list_av1 alias_hfnlist[] = { - { "rehash", (hookfn)reload_aliases }, + { "rehash", reload_aliases }, { NULL, NULL }, }; @@ -100,12 +100,11 @@ _moddeinit(void) destroy_aliases(); } -static int -reload_aliases(hook_data *data) +static void +reload_aliases(void *data) { destroy_aliases(); /* Clear old aliases */ create_aliases(); - return 0; } /* The below was mostly taken from the old do_alias */ diff --git a/modules/m_list.c b/modules/m_list.c index 1b3c07ff..59026e90 100644 --- a/modules/m_list.c +++ b/modules/m_list.c @@ -66,7 +66,7 @@ static void mo_list(struct MsgBuf *, struct Client *, struct Client *, int, cons static void list_one_channel(struct Client *source_p, struct Channel *chptr, int visible); static void safelist_one_channel(struct Client *source_p, struct Channel *chptr, struct ListClient *params); -static void safelist_check_cliexit(hook_data_client_exit * hdata); +static void safelist_check_cliexit(void *); static void safelist_client_instantiate(struct Client *, struct ListClient *); static void safelist_client_release(struct Client *); static void safelist_iterate_client(struct Client *source_p); @@ -81,7 +81,7 @@ struct Message list_msgtab = { mapi_clist_av1 list_clist[] = { &list_msgtab, NULL }; mapi_hfn_list_av1 list_hfnlist[] = { - {"client_exit", (hookfn) safelist_check_cliexit}, + {"client_exit", safelist_check_cliexit}, {NULL, NULL} }; @@ -113,8 +113,9 @@ static void _moddeinit(void) delete_isupport("ELIST"); } -static void safelist_check_cliexit(hook_data_client_exit * hdata) +static void safelist_check_cliexit(void *data) { + hook_data_client_exit * hdata = data; /* Cancel the safelist request if we are disconnecting * from the server. That way it doesn't core. :P --nenolod */ diff --git a/modules/m_sasl.c b/modules/m_sasl.c index 2b407a10..c5c74ba1 100644 --- a/modules/m_sasl.c +++ b/modules/m_sasl.c @@ -49,8 +49,8 @@ static void m_authenticate(struct MsgBuf *, struct Client *, struct Client *, in static void me_sasl(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static void me_mechlist(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static void abort_sasl(struct Client *); -static void abort_sasl_exit(hook_data_client_exit *); +static void abort_sasl(void *); +static void abort_sasl_exit(void *); static unsigned int CLICAP_SASL = 0; static char mechlist_buf[BUFSIZE]; @@ -72,8 +72,8 @@ mapi_clist_av1 sasl_clist[] = { &authenticate_msgtab, &sasl_msgtab, &mechlist_msgtab, NULL }; mapi_hfn_list_av1 sasl_hfnlist[] = { - { "new_local_user", (hookfn) abort_sasl }, - { "client_exit", (hookfn) abort_sasl_exit }, + { "new_local_user", abort_sasl }, + { "client_exit", abort_sasl_exit }, { NULL, NULL } }; @@ -304,8 +304,9 @@ me_mechlist(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sou * registering anyway, abort the exchange. */ static void -abort_sasl(struct Client *data) +abort_sasl(void *data_) { + struct Client *data = data_; if(data->localClient->sasl_out == 0 || data->localClient->sasl_complete) return; @@ -331,8 +332,9 @@ abort_sasl(struct Client *data) } static void -abort_sasl_exit(hook_data_client_exit *data) +abort_sasl_exit(void *data_) { + hook_data_client_exit *data = data_; if (data->target->localClient) abort_sasl(data->target); } diff --git a/modules/m_services.c b/modules/m_services.c index 143c8cb8..63a53480 100644 --- a/modules/m_services.c +++ b/modules/m_services.c @@ -59,9 +59,9 @@ static void me_login(struct MsgBuf *, struct Client *, struct Client *, int, con static void me_rsfnc(struct MsgBuf *, struct Client *, struct Client *, int, const char **); static void me_nickdelay(struct MsgBuf *, struct Client *, struct Client *, int, const char **); -static void h_svc_server_introduced(hook_data_client *); -static void h_svc_whois(hook_data_client *); -static void h_svc_stats(hook_data_int *); +static void h_svc_server_introduced(void *); +static void h_svc_whois(void *); +static void h_svc_stats(void *); static void h_svc_conf_read_start(void *); static void h_svc_conf_read_end(void *); @@ -86,12 +86,12 @@ mapi_clist_av1 services_clist[] = { &su_msgtab, &login_msgtab, &rsfnc_msgtab, &nickdelay_msgtab, NULL }; mapi_hfn_list_av1 services_hfnlist[] = { - { "doing_stats", (hookfn) h_svc_stats }, - { "doing_whois", (hookfn) h_svc_whois }, - { "doing_whois_global", (hookfn) h_svc_whois }, - { "server_introduced", (hookfn) h_svc_server_introduced }, - { "conf_read_start", (hookfn) h_svc_conf_read_start }, - { "conf_read_end", (hookfn) h_svc_conf_read_end }, + { "doing_stats", h_svc_stats }, + { "doing_whois", h_svc_whois }, + { "doing_whois_global", h_svc_whois }, + { "server_introduced", h_svc_server_introduced }, + { "conf_read_start", h_svc_conf_read_start }, + { "conf_read_end", h_svc_conf_read_end }, { NULL, NULL } }; @@ -300,8 +300,9 @@ me_nickdelay(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so } static void -h_svc_server_introduced(hook_data_client *hdata) +h_svc_server_introduced(void *data) { + hook_data_client *hdata = data; rb_dlink_node *ptr; RB_DLINK_FOREACH(ptr, service_list.head) @@ -315,8 +316,9 @@ h_svc_server_introduced(hook_data_client *hdata) } static void -h_svc_whois(hook_data_client *data) +h_svc_whois(void *data_) { + hook_data_client *data = data_; char *p = data->target->user->suser; if(!EmptyString(p)) { @@ -336,8 +338,9 @@ h_svc_whois(hook_data_client *data) } static void -h_svc_stats(hook_data_int *data) +h_svc_stats(void *data_) { + hook_data_int *data = data_; char statchar = (char) data->arg2; rb_dlink_node *ptr; diff --git a/modules/sno_routing.c b/modules/sno_routing.c index 608ef4ff..271a1e8d 100644 --- a/modules/sno_routing.c +++ b/modules/sno_routing.c @@ -36,12 +36,12 @@ #include "ircd.h" #include "send.h" -static void h_nn_server_eob(struct Client *); -static void h_nn_client_exit(hook_data_client_exit *); +static void h_nn_server_eob(void *); +static void h_nn_client_exit(void *); mapi_hfn_list_av1 nn_hfnlist[] = { - { "server_eob", (hookfn) h_nn_server_eob }, - { "client_exit", (hookfn) h_nn_client_exit }, + { "server_eob", h_nn_server_eob }, + { "client_exit", h_nn_client_exit }, { NULL, NULL } }; @@ -73,8 +73,9 @@ count_mark_downlinks(struct Client *server_p, int *pservcount, int *pusercount) } static void -h_nn_server_eob(struct Client *source_p) +h_nn_server_eob(void *data) { + struct Client *source_p = data; int s = 0, u = 0; if (IsFloodDone(source_p)) @@ -86,8 +87,9 @@ h_nn_server_eob(struct Client *source_p) } static void -h_nn_client_exit(hook_data_client_exit *hdata) +h_nn_client_exit(void *data) { + hook_data_client_exit *hdata = data; struct Client *source_p; int s = 0, u = 0; char *fromnick;