]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/bancache.h
Fix m_banredirect: (hint: sizeof(f) != sizeof(*f) ;p)
[user/henk/code/inspircd.git] / include / bancache.h
index a96b194f9ce7066f84fdbc722e5a90908e41f575..cabd8536500b8cfee470605587b9ad3110ea01e3 100644 (file)
@@ -35,7 +35,11 @@ class CoreExport BanCacheHit : public classbase
 };
 
 // must be defined after class BanCacheHit.
+#ifndef WIN32
 typedef nspace::hash_map<std::string, BanCacheHit *, nspace::hash<std::string> > BanCacheHash;
+#else
+typedef nspace::hash_map<std::string, BanCacheHit*, nspace::hash_compare<string, less<string> > > BanCacheHash;
+#endif
 
 class CoreExport BanCacheManager : public classbase
 {
@@ -53,11 +57,19 @@ class CoreExport BanCacheManager : public classbase
        BanCacheHit *GetHit(const std::string &ip);
        bool RemoveHit(BanCacheHit *b);
 
+       /** Removes all entries of a given type, either positive or negative. Returns the number of hits removed.
+        * @param type The type of bancache entries to remove (e.g. 'G')
+        * @param positive Remove either positive (true) or negative (false) hits.
+        */
+       int RemoveEntries(const std::string &type, bool positive);
+
        BanCacheManager(InspIRCd *Instance)
        {
                this->ServerInstance = Instance;
                this->BanHash = new BanCacheHash();
        }
+
+       void RehashCache();
 };
 
 #endif