1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2005 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
20 #include "helperfuncs.h"
22 #include <ext/hash_map>
28 #define nspace __gnu_cxx
35 size_t nspace::hash<in_addr>::operator()(const struct in_addr &a) const
38 memcpy(&q,&a,sizeof(size_t));
42 size_t nspace::hash<string>::operator()(const string &s) const
45 static struct hash<const char *> strhash;
46 strlcpy(a,s.c_str(),MAXBUF);
51 bool StrHashComp::operator()(const string& s1, const string& s2) const
53 char a[MAXBUF],b[MAXBUF];
54 strlcpy(a,s1.c_str(),MAXBUF);
55 strlcpy(b,s2.c_str(),MAXBUF);
58 return (strcasecmp(a,b) == 0);
61 bool InAddr_HashComp::operator()(const in_addr &s1, const in_addr &s2) const
66 memcpy(&q,&s1,sizeof(size_t));
67 memcpy(&p,&s2,sizeof(size_t));