1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 11:13:12 +02:00

Made it so it is no longer necessary for modules to copy the ModuleInfo structure

This commit is contained in:
codemastr
2003-05-10 18:53:50 +00:00
parent f0a5ab1310
commit 370acc2abe
6 changed files with 67 additions and 70 deletions
+49 -50
View File
@@ -48,7 +48,7 @@
#endif
extern ModuleHeader m_svsnoop_Header;
ModuleInfo ModCmdsInfo;
ModuleInfo *ModCmdsInfo;
/* Place includes here */
/* replace this with a common name of your module */
#ifdef DYNAMIC_LINKING
@@ -136,8 +136,8 @@ int l_commands_Test(ModuleInfo *modinfo)
#ifdef SCAN_API
Module p;
#endif
bcopy(modinfo,&ModCmdsInfo,modinfo->size);
m_htm_Test(&ModCmdsInfo);
ModCmdsInfo = modinfo;
m_htm_Test(ModCmdsInfo);
return MOD_SUCCESS;
}
@@ -155,54 +155,53 @@ int l_commands_Init(ModuleInfo *modinfo)
/*
* We call our add_Command crap here
*/
bcopy(modinfo,&ModCmdsInfo,modinfo->size);
module_load = ModCmdsInfo.module_load;
m_sethost_Init(&ModCmdsInfo);
m_setname_Init(&ModCmdsInfo);
m_chghost_Init(&ModCmdsInfo);
m_chgident_Init(&ModCmdsInfo);
m_setident_Init(&ModCmdsInfo);
m_sdesc_Init(&ModCmdsInfo);
m_svsmode_Init(&ModCmdsInfo);
m_swhois_Init(&ModCmdsInfo);
m_svsmotd_Init(&ModCmdsInfo);
m_svsnline_Init(&ModCmdsInfo);
m_who_Init(&ModCmdsInfo);
m_mkpasswd_Init(&ModCmdsInfo);
m_away_Init(&ModCmdsInfo);
m_svsnoop_Init(&ModCmdsInfo);
m_svso_Init(&ModCmdsInfo);
m_svsnick_Init(&ModCmdsInfo);
m_adminchat_Init(&ModCmdsInfo);
m_nachat_Init(&ModCmdsInfo);
m_lag_Init(&ModCmdsInfo);
m_rping_Init(&ModCmdsInfo);
m_sendumode_Init(&ModCmdsInfo);
m_tsctl_Init(&ModCmdsInfo);
m_htm_Init(&ModCmdsInfo);
m_chgname_Init(&ModCmdsInfo);
m_message_Init(&ModCmdsInfo);
m_whois_Init(&ModCmdsInfo);
m_quit_Init(&ModCmdsInfo);
m_kill_Init(&ModCmdsInfo);
m_pingpong_Init(&ModCmdsInfo);
m_oper_Init(&ModCmdsInfo);
m_akill_Init(&ModCmdsInfo);
m_rakill_Init(&ModCmdsInfo);
m_unzline_Init(&ModCmdsInfo);
m_unkline_Init(&ModCmdsInfo);
m_sqline_Init(&ModCmdsInfo);
m_unsqline_Init(&ModCmdsInfo);
m_tkl_Init(&ModCmdsInfo);
m_vhost_Init(&ModCmdsInfo);
m_cycle_Init(&ModCmdsInfo);
m_svsjoin_Init(&ModCmdsInfo);
m_svspart_Init(&ModCmdsInfo);
m_svswatch_Init(&ModCmdsInfo);
m_svssilence_Init(&ModCmdsInfo);
m_svslusers_Init(&ModCmdsInfo);
module_load = ModCmdsInfo->module_load;
m_sethost_Init(ModCmdsInfo);
m_setname_Init(ModCmdsInfo);
m_chghost_Init(ModCmdsInfo);
m_chgident_Init(ModCmdsInfo);
m_setident_Init(ModCmdsInfo);
m_sdesc_Init(ModCmdsInfo);
m_svsmode_Init(ModCmdsInfo);
m_swhois_Init(ModCmdsInfo);
m_svsmotd_Init(ModCmdsInfo);
m_svsnline_Init(ModCmdsInfo);
m_who_Init(ModCmdsInfo);
m_mkpasswd_Init(ModCmdsInfo);
m_away_Init(ModCmdsInfo);
m_svsnoop_Init(ModCmdsInfo);
m_svso_Init(ModCmdsInfo);
m_svsnick_Init(ModCmdsInfo);
m_adminchat_Init(ModCmdsInfo);
m_nachat_Init(ModCmdsInfo);
m_lag_Init(ModCmdsInfo);
m_rping_Init(ModCmdsInfo);
m_sendumode_Init(ModCmdsInfo);
m_tsctl_Init(ModCmdsInfo);
m_htm_Init(ModCmdsInfo);
m_chgname_Init(ModCmdsInfo);
m_message_Init(ModCmdsInfo);
m_whois_Init(ModCmdsInfo);
m_quit_Init(ModCmdsInfo);
m_kill_Init(ModCmdsInfo);
m_pingpong_Init(ModCmdsInfo);
m_oper_Init(ModCmdsInfo);
m_akill_Init(ModCmdsInfo);
m_rakill_Init(ModCmdsInfo);
m_unzline_Init(ModCmdsInfo);
m_unkline_Init(ModCmdsInfo);
m_sqline_Init(ModCmdsInfo);
m_unsqline_Init(ModCmdsInfo);
m_tkl_Init(ModCmdsInfo);
m_vhost_Init(ModCmdsInfo);
m_cycle_Init(ModCmdsInfo);
m_svsjoin_Init(ModCmdsInfo);
m_svspart_Init(ModCmdsInfo);
m_svswatch_Init(ModCmdsInfo);
m_svssilence_Init(ModCmdsInfo);
m_svslusers_Init(ModCmdsInfo);
#ifdef GUEST
m_guest_Init(&ModCmdsInfo);
m_guest_Init(ModCmdsInfo);
#endif
return MOD_SUCCESS;
}
+3 -3
View File
@@ -62,7 +62,7 @@ ModuleHeader Mod_Header
NULL
};
ModuleInfo ModGuestInfo;
ModuleInfo *ModGuestInfo;
/* The purpose of these ifdefs, are that we can "static" link the ircd if we
* want to
*/
@@ -78,8 +78,8 @@ int m_guest_Init(ModuleInfo *modinfo)
* We call our add_Command crap here
*/
#ifdef GUEST
bcopy(modinfo,&ModGuestInfo,modinfo.size);
GuestHook = HookAddEx(ModGuestInfo.handle, HOOKTYPE_GUEST, m_guest);
ModGuestInfo = modinfo;
GuestHook = HookAddEx(ModGuestInfo->handle, HOOKTYPE_GUEST, m_guest);
#endif
return MOD_SUCCESS;
+7 -7
View File
@@ -69,7 +69,7 @@ DLLFUNC int htm_config_test(ConfigFile *, ConfigEntry *, int, int *);
DLLFUNC int htm_config_run(ConfigFile *, ConfigEntry *, int);
DLLFUNC int htm_stats(aClient *, char *);
ModuleInfo HtmModInfo;
ModuleInfo *HtmModInfo;
static Hook *ConfTest, *ConfRun, *ServerStats;
#ifndef DYNAMIC_LINKING
ModuleHeader m_htm_Header
@@ -99,8 +99,8 @@ int m_htm_Test(ModuleInfo *modinfo)
/*
* We call our add_Command crap here
*/
bcopy(modinfo,&HtmModInfo,modinfo->size);
ConfTest = HookAddEx(HtmModInfo.handle, HOOKTYPE_CONFIGTEST, htm_config_test);
HtmModInfo = modinfo;
ConfTest = HookAddEx(HtmModInfo->handle, HOOKTYPE_CONFIGTEST, htm_config_test);
return MOD_SUCCESS;
}
@@ -116,12 +116,12 @@ int m_htm_Init(ModuleInfo *modinfo)
* We call our add_Command crap here
*/
add_Command(MSG_HTM, TOK_HTM, m_htm, MAXPARA);
ConfRun = HookAddEx(HtmModInfo.handle, HOOKTYPE_CONFIGRUN, htm_config_run);
ServerStats = HookAddEx(HtmModInfo.handle, HOOKTYPE_STATS, htm_stats);
ConfRun = HookAddEx(HtmModInfo->handle, HOOKTYPE_CONFIGRUN, htm_config_run);
ServerStats = HookAddEx(HtmModInfo->handle, HOOKTYPE_STATS, htm_stats);
#ifndef NO_FDLIST
LockEventSystem();
e_lcf = EventAddEx(HtmModInfo.handle, "lcf", LCF, 0, lcf_check, NULL);
e_htmcalc = EventAddEx(HtmModInfo.handle, "htmcalc", 1, 0, htm_calc, NULL);
e_lcf = EventAddEx(HtmModInfo->handle, "lcf", LCF, 0, lcf_check, NULL);
e_htmcalc = EventAddEx(HtmModInfo->handle, "htmcalc", 1, 0, htm_calc, NULL);
UnlockEventSystem();
#endif
return MOD_SUCCESS;