]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/modules.h
Replace std::deque with std::vector in spanningtree and related modules
[user/henk/code/inspircd.git] / include / modules.h
index 31ed6ec8c5633a495f975175090b8c828e6ba8e9..21e4760897f234045690980735f169f3c88b6287 100644 (file)
@@ -76,18 +76,8 @@ enum MessageType {
        MSG_NOTICE = 1
 };
 
-/** If you change the module API, change this value.
- * If you have enabled ipv6, the sizes of structs is
- * different, and modules will be incompatible with
- * ipv4 servers, so this value will be ten times as
- * high on ipv6 servers.
- */
-#define NATIVE_API_VERSION 12000
-#ifdef IPV6
-#define API_VERSION (NATIVE_API_VERSION * 10)
-#else
-#define API_VERSION (NATIVE_API_VERSION * 1)
-#endif
+/** If you change the module API, change this value. */
+#define API_VERSION 13000
 
 class ServerConfig;
 
@@ -786,7 +776,7 @@ class CoreExport Module : public Extensible
         * @param text The actual modes and their parameters if any
         * @param translate The translation types of the mode parameters
         */
-       virtual void OnMode(User* user, void* dest, int target_type, const std::deque<std::string> &text, const std::deque<TranslateType> &translate);
+       virtual void OnMode(User* user, void* dest, int target_type, const std::vector<std::string> &text, const std::vector<TranslateType> &translate);
 
        /** Allows modules to alter or create server descriptions
         * Whenever a module requires a server description, for example for display in
@@ -895,7 +885,7 @@ class CoreExport Module : public Extensible
         * @param modeline The modes and parameters to be sent
         * @param translate The translation types of the mode parameters
         */
-       virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::deque<std::string> &modeline, const std::deque<TranslateType> &translate);
+       virtual void ProtoSendMode(void* opaque, TargetTypeFlags target_type, void* target, const std::vector<std::string> &modeline, const std::vector<TranslateType> &translate);
 
        /** Implemented by modules which provide the ability to link servers.
         * These modules will implement this method, which allows metadata (extra data added to
@@ -1301,7 +1291,7 @@ class CoreExport Module : public Extensible
         */
        virtual int OnDelBan(User* source, Channel* channel,const std::string &banmask);
 
-       virtual void OnHookUserIO(User* user, const std::string &targetip);
+       virtual void OnHookUserIO(User* user);
 
        /** Called immediately after any  connection is accepted. This is intended for raw socket
         * processing (e.g. modules which wrap the tcp connection within another library) and provides
@@ -1309,10 +1299,11 @@ class CoreExport Module : public Extensible
         * There are no return values from this call as all modules get an opportunity if required to
         * process the connection.
         * @param fd The file descriptor returned from accept()
-        * @param ip The IP address of the connecting user
+        * @param client The client IP address and port
+        * @param server The server IP address and port
         * @param localport The local port number the user connected to
         */
-       virtual void OnRawSocketAccept(int fd, const std::string &ip, int localport);
+       virtual void OnRawSocketAccept(int fd, irc::sockets::sockaddrs* client, irc::sockets::sockaddrs* server);
 
        /** Called immediately before any write() operation on a user's socket in the core. Because
         * this event is a low level event no user information is associated with it. It is intended
@@ -1447,21 +1438,6 @@ class CoreExport ConfigReader : public classbase
 {
   protected:
        InspIRCd* ServerInstance;
-       /** The contents of the configuration file
-        * This protected member should never be accessed by a module (and cannot be accessed unless the
-        * core is changed). It will contain a pointer to the configuration file data with unneeded data
-        * (such as comments) stripped from it.
-        */
-       ConfigDataHash* data;
-       /** Used to store errors
-        */
-       std::ostringstream* errorlog;
-       /** If we're using our own config data hash or not
-        */
-       bool privatehash;
-       /** True if an error occured reading the config file
-        */
-       bool readerror;
        /** Error code
         */
        long error;
@@ -1472,10 +1448,6 @@ class CoreExport ConfigReader : public classbase
         * as specified when running ./configure.
         */
        ConfigReader(InspIRCd* Instance);
-       /** Overloaded constructor.
-        * This constructor initialises the ConfigReader class to read a user-specified config file
-        */
-       ConfigReader(InspIRCd* Instance, const std::string &filename);
        /** Default destructor.
         * This method destroys the ConfigReader class.
         */
@@ -1539,18 +1511,6 @@ class CoreExport ConfigReader : public classbase
         * multiple instance tag.
         */
        int Enumerate(const std::string &tag);
-       /** Returns true if a config file is valid.
-        * This method is partially implemented and will only return false if the config
-        * file does not exist or could not be opened.
-        */
-       bool Verify();
-       /** Dumps the list of errors in a config file to an output location. If bail is true,
-        * then the program will abort. If bail is false and user points to a valid user
-        * record, the error report will be spooled to the given user by means of NOTICE.
-        * if bool is false AND user is false, the error report will be spooled to all opers
-        * by means of a NOTICE to all opers.
-        */
-       void DumpErrors(bool bail,User* user);
 
        /** Returns the number of items within a tag.
         * For example if the tag was &lt;test tag="blah" data="foo"&gt; then this
@@ -1682,6 +1642,11 @@ class CoreExport ModuleManager : public classbase
         */
        std::map<std::string, std::pair<ircd_module*, Module*> > Modules;
 
+       enum {
+               PRIO_STATE_FIRST,
+               PRIO_STATE_AGAIN,
+               PRIO_STATE_LAST
+       } prioritizationState;
  public:
 
        /** Event handler hooks.
@@ -1707,14 +1672,14 @@ class CoreExport ModuleManager : public classbase
         * @param i The event to change the priority of
         * @param s The state you wish to use for this event. Use one of
         * PRIO_FIRST to set the event to be first called, PRIO_LAST to
-        * set it to be the last called, or PRIO_BEFORE and PRIO_AFTER
+        * set it to be the last called, or PRIO_BEFORE and PRIORITY_AFTER
         * to set it to be before or after one or more other modules.
-        * @param modules If PRIO_BEFORE or PRIO_AFTER is set in parameter 's',
+        * @param modules If PRIO_BEFORE or PRIORITY_AFTER is set in parameter 's',
         * then this contains a list of one or more modules your module must be
         * placed before or after. Your module will be placed before the highest
         * priority module in this list for PRIO_BEFORE, or after the lowest
-        * priority module in this list for PRIO_AFTER.
-        * @param sz The number of modules being passed for PRIO_BEFORE and PRIO_AFTER.
+        * priority module in this list for PRIORITY_AFTER.
+        * @param sz The number of modules being passed for PRIO_BEFORE and PRIORITY_AFTER.
         * Defaults to 1, as most of the time you will only want to prioritize your module
         * to be before or after one other module.
         */
@@ -1724,7 +1689,7 @@ class CoreExport ModuleManager : public classbase
         * @param mod The module to set the priority of
         * @param s The priority of all events in the module.
         * Note that with this method, it is not possible to effectively use
-        * PRIO_BEFORE or PRIO_AFTER, you should use the more fine tuned
+        * PRIO_BEFORE or PRIORITY_AFTER, you should use the more fine tuned
         * SetPriority method for this, where you may specify other modules to
         * be prioritized against.
         */