]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Jason, try this..
[user/henk/code/inspircd.git] / include / modules.h
index 7b1ee43b480721aa733f4d0d88e685962fe8d3f3..722bf4e3c4467696722ea3b921e44c9cbc078ea3 100644 (file)
@@ -1037,7 +1037,7 @@ class CoreExport Module : public Extensible
         * @param original_line The entire original line as passed to the parser from the user
         * @return 1 to block the command, 0 to allow
         */
-       virtual int OnPreCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, bool validated, const std::string &original_line);
+       virtual int OnPreCommand(const std::string &command, const std::vector<std::string>& parameters, User *user, bool validated, const std::string &original_line);
 
        /** Called after any command has been executed.
         * This event occurs for all registered commands, wether they are registered in the core,
@@ -1051,7 +1051,7 @@ class CoreExport Module : public Extensible
         * @param result The return code given by the command handler, one of CMD_SUCCESS or CMD_FAILURE
         * @param original_line The entire original line as passed to the parser from the user
         */
-       virtual void OnPostCommand(const std::string &command, const char* const* parameters, int pcnt, User *user, CmdResult result, const std::string &original_line);
+       virtual void OnPostCommand(const std::string &command, const std::vector<std::string>& parameters, User *user, CmdResult result, const std::string &original_line);
 
        /** Called to check if a user who is connecting can now be allowed to register
         * If any modules return false for this function, the user is held in the waiting
@@ -1862,10 +1862,31 @@ class CoreExport ModuleManager : public classbase
  * and functions needed to make a module loadable by the OS.
  * It defines the class factory and external init_module function.
  */
+#ifdef WINDOWS
+
 #define MODULE_INIT(y) \
        extern "C" DllExport Module * init_module(InspIRCd* Me) \
        { \
                return new y(Me); \
+       } \
+       BOOLEAN WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) \
+       { \
+               switch ( nReason ) \
+               { \
+                       case DLL_PROCESS_ATTACH: \
+                       case DLL_PROCESS_DETACH: \
+                               break; \
+               } \
+               return TRUE; \
        }
 
+#else
+
+#define MODULE_INIT(y) \
+       extern "C" DllExport Module * init_module(InspIRCd* Me) \
+       { \
+               return new y(Me); \
+       }
+#endif
+
 #endif