]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Moved StrHashComp and InAddr_HashComp into the irc:: namespace
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 15 May 2005 18:35:39 +0000 (18:35 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 15 May 2005 18:35:39 +0000 (18:35 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1398 e03df62e-2008-0410-955e-edbf42e46eb7

include/hashcomp.h
src/commands.cpp
src/dnsqueue.cpp
src/hashcomp.cpp
src/helperfuncs.cpp
src/inspircd.cpp
src/modules.cpp
src/xline.cpp

index c9debd6988f5c57ce59c7d72be6800ab06bc104d..b4652642bca350462c2a64caee1de3a25e6ce0fe 100644 (file)
@@ -53,32 +53,35 @@ namespace nspace
         };
 }
 
-/** This class returns true if two strings match.
- * Case sensitivity is ignored, and the RFC 'character set'
- * is adhered to
+/** The irc namespace contains a number of helper classes.
  */
-struct StrHashComp
+namespace irc
 {
-       /** The operator () does the actual comparison in hash_map
+
+       /** This class returns true if two strings match.
+        * Case sensitivity is ignored, and the RFC 'character set'
+        * is adhered to
         */
-        bool operator()(const string& s1, const string& s2) const;
-};
+       struct StrHashComp
+       {
+               /** The operator () does the actual comparison in hash_map
+                */
+               bool operator()(const std::string& s1, const std::string& s2) const;
+       };
 
-/** This class returns true if two in_addr structs match.
- * Checking is done by copying both into a size_t then doing a
- * numeric comparison of the two.
- */
-struct InAddr_HashComp
-{
-       /** The operator () does the actual comparison in hash_map
+
+       /** This class returns true if two in_addr structs match.
+        * Checking is done by copying both into a size_t then doing a
+        * numeric comparison of the two.
         */
-        bool operator()(const in_addr &s1, const in_addr &s2) const;
-};
+       struct InAddr_HashComp
+       {
+               /** The operator () does the actual comparison in hash_map
+                */
+               bool operator()(const in_addr &s1, const in_addr &s2) const;
+       };
+
 
-/** The irc namespace contains a number of helper classes.
- */
-namespace irc
-{
        /** The irc_char_traits class is used for RFC-style comparison of strings.
         * This class is used to implement irc::string, a case-insensitive, RFC-
         * comparing string class.
index 3dfa44d9fc0651d067530adc57ff50284c7d4305..23d285eee8281f2a5ccf9d2e7dd3d5043f7315e1 100644 (file)
@@ -124,10 +124,10 @@ const long duration_d = duration_h * 24;
 const long duration_w = duration_d * 7;
 const long duration_y = duration_w * 52;
 
-typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, StrHashComp> user_hash;
-typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, StrHashComp> chan_hash;
-typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, InAddr_HashComp> address_cache;
-typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, StrHashComp> whowas_hash;
+typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
+typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
+typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
+typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
 typedef std::deque<command_t> command_table;
 
 
index 9d77543e90213f85433815ddd11e4aad80b77743..1a5113618dc136084f558e2729b53a90f0bba843 100644 (file)
@@ -72,10 +72,10 @@ extern std::vector<int> fd_reap;
 
 extern int MODCOUNT;
 
-typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, StrHashComp> user_hash;
-typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, StrHashComp> chan_hash;
-typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, InAddr_HashComp> address_cache;
-typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, StrHashComp> whowas_hash;
+typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
+typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
+typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
+typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
 typedef std::deque<command_t> command_table;
 
 extern user_hash clientlist;
index a076dc46b36c51a3ad40924e34489bf06fb477a0..ca7394baa7172fe16642f15159ebae87b5dc8eea 100644 (file)
@@ -80,7 +80,7 @@ size_t nspace::hash<string>::operator()(const string &s) const
         return strhash(a);
 }
 
-bool StrHashComp::operator()(const string& s1, const string& s2) const
+bool irc::StrHashComp::operator()(const std::string& s1, const std::string& s2) const
 {
         char a[MAXBUF],b[MAXBUF];
         strlcpy(a,s1.c_str(),MAXBUF);
@@ -90,7 +90,7 @@ bool StrHashComp::operator()(const string& s1, const string& s2) const
         return (strcasecmp(a,b) == 0);
 }
 
-bool InAddr_HashComp::operator()(const in_addr &s1, const in_addr &s2) const
+bool irc::InAddr_HashComp::operator()(const in_addr &s1, const in_addr &s2) const
 {
         size_t q;
         size_t p;
index 20b924013eeaa0a14f8a5b7e01e3c80265b54bac..5649b6ca1badd98e4d61c95af54f98e60ca9a7a9 100644 (file)
@@ -78,8 +78,8 @@ extern std::vector<userrec*> all_opers;
 
 extern ClassVector Classes;
 
-typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, StrHashComp> user_hash;
-typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, StrHashComp> chan_hash;
+typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
+typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
 typedef std::deque<command_t> command_table;
 
 extern user_hash clientlist;
index 56d476c48c60091e2180f051fde580273a9120d3..4464be7559dbab30c4a8bd7b1891baceb3f39f51 100644 (file)
@@ -107,10 +107,10 @@ time_t TIME = time(NULL), OLDTIME = time(NULL);
 int kq, lkq, skq;
 #endif
 
-typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, StrHashComp> user_hash;
-typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, StrHashComp> chan_hash;
-typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, InAddr_HashComp> address_cache;
-typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, StrHashComp> whowas_hash;
+typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
+typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
+typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
+typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
 typedef std::deque<command_t> command_table;
 
 // This table references users by file descriptor.
index fba0db10a2c01a0d24ceacb2aa63e4469f12dca7..c0dcc3ca7e60fc867f67d92b0ba7168ae2d51b2c 100644 (file)
@@ -106,10 +106,10 @@ extern FILE *log_file;
 
 extern userrec* fd_ref_table[65536];
 
-typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, StrHashComp> user_hash;
-typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, StrHashComp> chan_hash;
-typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, InAddr_HashComp> address_cache;
-typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, StrHashComp> whowas_hash;
+typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
+typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
+typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
+typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
 typedef std::deque<command_t> command_table;
 
 
index 1d0bcf7754eeeb8b28407ec5ff7f373d6aa15ebb..fa400d5c5799ac1574f0001fc8b856e4cd28b415 100644 (file)
@@ -92,10 +92,10 @@ extern serverrec* me[32];
 
 extern FILE *log_file;
 
-typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, StrHashComp> user_hash;
-typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, StrHashComp> chan_hash;
-typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, InAddr_HashComp> address_cache;
-typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, StrHashComp> whowas_hash;
+typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHashComp> user_hash;
+typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
+typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
+typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
 typedef std::deque<command_t> command_table;