]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Switch <stdint.h> test to use a test file too.
[user/henk/code/inspircd.git] / include / modules.h
index 49c16ae6115ab549faee1e3ec72420b2e9c084d5..9857012fcfc0ac1c71793198e15f5b0a902d5e0c 100644 (file)
@@ -116,7 +116,7 @@ struct ModResult {
  * and numerical comparisons in preprocessor macros if they wish to support
  * multiple versions of InspIRCd in one file.
  */
-#define INSPIRCD_VERSION_API 1
+#define INSPIRCD_VERSION_API 9
 
 /**
  * This #define allows us to call a method in all
@@ -338,7 +338,7 @@ enum Implementation
        I_OnPostOper, I_OnSyncNetwork, I_OnSetAway, I_OnPostCommand, I_OnPostJoin,
        I_OnWhoisLine, I_OnBuildNeighborList, I_OnGarbageCollect, I_OnSetConnectClass,
        I_OnText, I_OnPassCompare, I_OnRunTestSuite, I_OnNamesListItem, I_OnNumeric, I_OnHookIO,
-       I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent,
+       I_OnPreRehash, I_OnModuleRehash, I_OnSendWhoLine, I_OnChangeIdent, I_OnSetUserIP,
        I_END
 };
 
@@ -357,6 +357,11 @@ class CoreExport Module : public classbase, public usecountbase
         */
        DLLManager* ModuleDLLManager;
 
+       /** If true, this module will be unloaded soon, further unload attempts will fail
+        * Value is used by the ModuleManager internally, you should not modify it
+        */
+       bool dying;
+
        /** Default constructor.
         * Creates a module class. Don't do any type of hook registration or checks
         * for other modules here; do that in init().
@@ -1288,6 +1293,12 @@ class CoreExport Module : public classbase, public usecountbase
         * @param line The raw line to send; modifiable, if empty no line will be returned.
         */
        virtual void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line);
+
+       /** Called whenever a local user's IP is set for the first time, or when a local user's IP changes due to
+        * a module like m_cgiirc changing it.
+        * @param user The user whose IP is being set
+        */
+       virtual void OnSetUserIP(LocalUser* user);
 };
 
 
@@ -1690,7 +1701,7 @@ struct AllModuleList {
  * and functions needed to make a module loadable by the OS.
  * It defines the class factory and external init_module function.
  */
-#ifdef WINDOWS
+#ifdef _WIN32
 
 #define MODULE_INIT(y) \
        extern "C" DllExport Module * MODULE_INIT_SYM() \
@@ -1706,7 +1717,8 @@ struct AllModuleList {
                                break; \
                } \
                return TRUE; \
-       }
+       } \
+       extern "C" DllExport const char inspircd_src_version[] = VERSION " r" REVISION;
 
 #else