]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
ListModeBase: Minor changes to original u_listmode code
[user/henk/code/inspircd.git] / include / inspircd.h
index 456a78d400f3f18d35ff74d6d6ecfdd2da678405..fa00902a49a3dab07904f08ab72243345b147ede 100644 (file)
 #include <unistd.h>
 #endif
 
+#ifdef _WIN32
+# include <unordered_map>
+#else
+# include <tr1/unordered_map>
+#endif
 #include <sstream>
 #include <string>
 #include <vector>
@@ -76,8 +81,7 @@
 #include <bitset>
 #include <set>
 #include <time.h>
-#include "inspircd_config.h"
-#include "inspircd_version.h"
+#include "config.h"
 #include "typedefs.h"
 #include "consolecolors.h"
 
@@ -263,10 +267,10 @@ class serverstats
        }
 };
 
-DEFINE_HANDLER2(IsNickHandler, bool, const char*, size_t);
+DEFINE_HANDLER2(IsNickHandler, bool, const std::string&, size_t);
 DEFINE_HANDLER2(GenRandomHandler, void, char*, size_t);
-DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
-DEFINE_HANDLER2(IsChannelHandler, bool, const char*, size_t);
+DEFINE_HANDLER1(IsIdentHandler, bool, const std::string&);
+DEFINE_HANDLER2(IsChannelHandler, bool, const std::string&, size_t);
 DEFINE_HANDLER1(RehashHandler, void, const std::string&);
 DEFINE_HANDLER3(OnCheckExemptionHandler, ModResult, User*, Channel*, const std::string&);
 
@@ -566,7 +570,7 @@ class CoreExport InspIRCd
         * @param chname A channel name to verify
         * @return True if the name is valid
         */
-       caller2<bool, const char*, size_t> IsChannel;
+       caller2<bool, const std::string&, size_t> IsChannel;
 
        /** Return true if str looks like a server ID
         * @param string to check against
@@ -614,13 +618,13 @@ class CoreExport InspIRCd
         * @param n A nickname to verify
         * @return True if the nick is valid
         */
-       caller2<bool, const char*, size_t> IsNick;
+       caller2<bool, const std::string&, size_t> IsNick;
 
        /** Return true if an ident is valid
         * @param An ident to verify
         * @return True if the ident is valid
         */
-       caller1<bool, const char*> IsIdent;
+       caller1<bool, const std::string&> IsIdent;
 
        /** Add a dns Resolver class to this server's active set
         * @param r The resolver to add
@@ -730,7 +734,7 @@ class CoreExport InspIRCd
         * (one year, two weeks, three days, four hours, six minutes and five seconds)
         * @return The total number of seconds
         */
-       long Duration(const std::string &str);
+       static unsigned long Duration(const std::string& str);
 
        /** Attempt to compare a password to a string from the config file.
         * This will be passed to handling modules which will compare the data
@@ -817,17 +821,6 @@ class CoreExport InspIRCd
         */
        void Cleanup();
 
-       /** This copies the user and channel hash_maps into new hash maps.
-        * This frees memory used by the hash_map allocator (which it neglects
-        * to free, most of the time, using tons of ram)
-        */
-       void RehashUsersAndChans();
-
-       /** Resets the cached max bans value on all channels.
-        * Called by rehash.
-        */
-       void ResetMaxBans();
-
        /** Return a time_t as a human-readable string.
         */
        std::string TimeString(time_t curtime);
@@ -874,3 +867,4 @@ class CommandModule : public Module
 };
 
 #endif
+