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

MOD_LOAD(xyz) is now just MOD_LOAD(), same for MOD_TEST, MOD_INIT,

MOD_UNLOAD. And MOD_HEADER(xyz) is now MOD_HEADER even without ()
since this isn't a function, really.
To make things understandable I added the following to the
developer section of the release notes:

* The module header is now as follows:
  ModuleHeader MOD_HEADER
    = {
          "nameofmodule",
          "5.0",
          "Some description",
          "Name of Author",
          "unrealircd-5",
      };
  There's a new author field, the version must start with a digit,
  and also the name of the module must match the loadmodule name.
  So for example third/funmod must also be named third/funmod.
* The MOD_TEST, MOD_INIT, MOD_LOAD and MOD_UNLOAD functions no longer
  take a name argument. So: MOD_INIT(mymod) is now MOD_INIT()
This commit is contained in:
Bram Matthys
2019-09-13 15:15:47 +02:00
parent 9114c0ed85
commit bb1bb35f50
178 changed files with 778 additions and 770 deletions
+6 -6
View File
@@ -22,7 +22,7 @@
#define MSG_SMOD "SMOD"
ModuleHeader MOD_HEADER(require_module) = {
ModuleHeader MOD_HEADER = {
"require-module",
"5.0",
"Check for required modules across the network",
@@ -67,13 +67,13 @@ struct cfgstruct {
};
static struct cfgstruct cfg;
MOD_TEST(require_module)
MOD_TEST()
{
HookAdd(modinfo->handle, HOOKTYPE_CONFIGTEST, 0, reqmods_configtest);
return MOD_SUCCESS;
}
MOD_INIT(require_module)
MOD_INIT()
{
MARK_AS_OFFICIAL_MODULE(modinfo);
MARK_AS_GLOBAL_MODULE(modinfo);
@@ -85,17 +85,17 @@ MOD_INIT(require_module)
return MOD_SUCCESS;
}
MOD_LOAD(require_module)
MOD_LOAD()
{
if (ModuleGetError(modinfo->handle) != MODERR_NOERROR)
{
config_error("A critical error occurred when loading module %s: %s", MOD_HEADER(require_module).name, ModuleGetErrorStr(modinfo->handle));
config_error("A critical error occurred when loading module %s: %s", MOD_HEADER.name, ModuleGetErrorStr(modinfo->handle));
return MOD_FAILED;
}
return MOD_SUCCESS;
}
MOD_UNLOAD(require_module)
MOD_UNLOAD()
{
DenyMod *dmod, *next;
for (dmod = DenyModList; dmod; dmod = next)