* See: http://www.inspircd.org/wiki/index.php/Credits
*
* This program is free but copyrighted software; see
- * the file COPYING for details.
+ * the file COPYING for details.
*
* ---------------------------------------------------
*/
*/
typedef std::vector<ircd_module*> FactoryList;
+
+#define MODULE_INIT(y) \
+ class Factory : public ModuleFactory \
+ { \
+ public: \
+ virtual Module * CreateModule(InspIRCd* Me) \
+ { \
+ return new y(Me); \
+ } \
+ }; \
+ extern "C" DllExport void * init_module(void) \
+ { \
+ return new Factory; \
+ }
+
#endif
+
}
};
-
-class ModuleAliasFactory : public ModuleFactory
-{
- public:
- ModuleAliasFactory()
- {
- }
-
- ~ModuleAliasFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleAlias(Me);
- }
-};
-
-
-extern "C" DllExport void * init_module( void )
-{
- return new ModuleAliasFactory;
-}
+MODULE_INIT(ModuleAlias);
}
};
-
-class ModuleTestCommandFactory : public ModuleFactory
-{
- public:
- ModuleTestCommandFactory()
- {
- }
-
- ~ModuleTestCommandFactory()
- {
- }
-
- virtual Module * CreateModule(InspIRCd* Me)
- {
- return new ModuleTestCommand(Me);
- }
-
-};
-
-
-extern "C" DllExport void * init_module( void )
-{
- return new ModuleTestCommandFactory;
-}
-
+MODULE_INIT(ModuleTestCommand);