summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/man/man3/irc_InAddr_HashComp.336
-rw-r--r--docs/man/man3/irc_StrHashComp.336
-rw-r--r--docs/module-doc/structirc_1_1InAddr__HashComp-members.html15
-rw-r--r--docs/module-doc/structirc_1_1InAddr__HashComp.html75
-rw-r--r--docs/module-doc/structirc_1_1StrHashComp-members.html15
-rw-r--r--docs/module-doc/structirc_1_1StrHashComp.html75
-rw-r--r--include/hashcomp.h14
-rw-r--r--src/hashcomp.cpp2
8 files changed, 262 insertions, 6 deletions
diff --git a/docs/man/man3/irc_InAddr_HashComp.3 b/docs/man/man3/irc_InAddr_HashComp.3
new file mode 100644
index 000000000..5127b013b
--- /dev/null
+++ b/docs/man/man3/irc_InAddr_HashComp.3
@@ -0,0 +1,36 @@
+.TH "irc::InAddr_HashComp" 3 "15 May 2005" "InspIRCd" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+irc::InAddr_HashComp \- This class returns true if two in_addr structs match.
+
+.PP
+.SH SYNOPSIS
+.br
+.PP
+\fC#include <hashcomp.h>\fP
+.PP
+.SS "Public Member Functions"
+
+.in +1c
+.ti -1c
+.RI "bool \fBoperator()\fP (const in_addr &s1, const in_addr &s2) const"
+.br
+.RI "\fIThe operator () does the actual comparison in hash_map. \fP"
+.in -1c
+.SH "Detailed Description"
+.PP
+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.
+.PP
+Definition at line 77 of file hashcomp.h.
+.SH "Member Function Documentation"
+.PP
+.SS "bool irc::InAddr_HashComp::operator() (const in_addr & s1, const in_addr & s2) const"
+.PP
+The operator () does the actual comparison in hash_map.
+
+.SH "Author"
+.PP
+Generated automatically by Doxygen for InspIRCd from the source code.
diff --git a/docs/man/man3/irc_StrHashComp.3 b/docs/man/man3/irc_StrHashComp.3
new file mode 100644
index 000000000..a6b8036e1
--- /dev/null
+++ b/docs/man/man3/irc_StrHashComp.3
@@ -0,0 +1,36 @@
+.TH "irc::StrHashComp" 3 "15 May 2005" "InspIRCd" \" -*- nroff -*-
+.ad l
+.nh
+.SH NAME
+irc::StrHashComp \- This class returns true if two strings match.
+
+.PP
+.SH SYNOPSIS
+.br
+.PP
+\fC#include <hashcomp.h>\fP
+.PP
+.SS "Public Member Functions"
+
+.in +1c
+.ti -1c
+.RI "bool \fBoperator()\fP (const std::string &s1, const std::string &s2) const"
+.br
+.RI "\fIThe operator () does the actual comparison in hash_map. \fP"
+.in -1c
+.SH "Detailed Description"
+.PP
+This class returns true if two strings match.
+
+Case sensitivity is ignored, and the RFC 'character set' is adhered to
+.PP
+Definition at line 65 of file hashcomp.h.
+.SH "Member Function Documentation"
+.PP
+.SS "bool irc::StrHashComp::operator() (const std::string & s1, const std::string & s2) const"
+.PP
+The operator () does the actual comparison in hash_map.
+
+.SH "Author"
+.PP
+Generated automatically by Doxygen for InspIRCd from the source code.
diff --git a/docs/module-doc/structirc_1_1InAddr__HashComp-members.html b/docs/module-doc/structirc_1_1InAddr__HashComp-members.html
new file mode 100644
index 000000000..717d6f23a
--- /dev/null
+++ b/docs/module-doc/structirc_1_1InAddr__HashComp-members.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>InspIRCd: Member List</title>
+<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.3 -->
+<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
+<h1>irc::InAddr_HashComp Member List</h1>This is the complete list of members for <a class="el" href="structirc_1_1InAddr__HashComp.html">irc::InAddr_HashComp</a>, including all inherited members.<table>
+ <tr class="memlist"><td><a class="el" href="structirc_1_1InAddr__HashComp.html#a0">operator()</a>(const in_addr &amp;s1, const in_addr &amp;s2) const</td><td><a class="el" href="structirc_1_1InAddr__HashComp.html">irc::InAddr_HashComp</a></td><td></td></tr>
+</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 15 18:39:25 2005 for InspIRCd by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.3 </small></address>
+</body>
+</html>
diff --git a/docs/module-doc/structirc_1_1InAddr__HashComp.html b/docs/module-doc/structirc_1_1InAddr__HashComp.html
new file mode 100644
index 000000000..059344406
--- /dev/null
+++ b/docs/module-doc/structirc_1_1InAddr__HashComp.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>InspIRCd: irc::InAddr_HashComp struct Reference</title>
+<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.3 -->
+<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
+<h1>irc::InAddr_HashComp Struct Reference</h1>This class returns true if two in_addr structs match.
+<a href="#_details">More...</a>
+<p>
+<code>#include &lt;<a class="el" href="hashcomp_8h-source.html">hashcomp.h</a>&gt;</code>
+<p>
+<a href="structirc_1_1InAddr__HashComp-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structirc_1_1InAddr__HashComp.html#a0">operator()</a> (const in_addr &amp;s1, const in_addr &amp;s2) const</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The operator () does the actual comparison in hash_map. </em> <a href="#a0"></a><em><br><br></td></tr>
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+This class returns true if two in_addr structs match.
+<p>
+Checking is done by copying both into a size_t then doing a numeric comparison of the two.
+<p>
+
+<p>
+Definition at line <a class="el" href="hashcomp_8h-source.html#l00077">77</a> of file <a class="el" href="hashcomp_8h-source.html">hashcomp.h</a>.<hr><h2>Member Function Documentation</h2>
+<a name="a0" doxytag="irc::InAddr_HashComp::operator()"></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> bool irc::InAddr_HashComp::operator() </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const in_addr &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>s1</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>const in_addr &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>s2</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"> const</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+The operator () does the actual comparison in hash_map.
+<p>
+ </td>
+ </tr>
+</table>
+<hr>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="hashcomp_8h-source.html">hashcomp.h</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Sun May 15 18:39:25 2005 for InspIRCd by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.3 </small></address>
+</body>
+</html>
diff --git a/docs/module-doc/structirc_1_1StrHashComp-members.html b/docs/module-doc/structirc_1_1StrHashComp-members.html
new file mode 100644
index 000000000..e0fa151ba
--- /dev/null
+++ b/docs/module-doc/structirc_1_1StrHashComp-members.html
@@ -0,0 +1,15 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>InspIRCd: Member List</title>
+<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.3 -->
+<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
+<h1>irc::StrHashComp Member List</h1>This is the complete list of members for <a class="el" href="structirc_1_1StrHashComp.html">irc::StrHashComp</a>, including all inherited members.<table>
+ <tr class="memlist"><td><a class="el" href="structirc_1_1StrHashComp.html#a0">operator()</a>(const std::string &amp;s1, const std::string &amp;s2) const</td><td><a class="el" href="structirc_1_1StrHashComp.html">irc::StrHashComp</a></td><td></td></tr>
+</table><hr size="1"><address style="align: right;"><small>Generated on Sun May 15 18:39:26 2005 for InspIRCd by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.3 </small></address>
+</body>
+</html>
diff --git a/docs/module-doc/structirc_1_1StrHashComp.html b/docs/module-doc/structirc_1_1StrHashComp.html
new file mode 100644
index 000000000..c9b651972
--- /dev/null
+++ b/docs/module-doc/structirc_1_1StrHashComp.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>InspIRCd: irc::StrHashComp struct Reference</title>
+<link href="inspircd.doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.3 -->
+<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
+<h1>irc::StrHashComp Struct Reference</h1>This class returns true if two strings match.
+<a href="#_details">More...</a>
+<p>
+<code>#include &lt;<a class="el" href="hashcomp_8h-source.html">hashcomp.h</a>&gt;</code>
+<p>
+<a href="structirc_1_1StrHashComp-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="structirc_1_1StrHashComp.html#a0">operator()</a> (const std::string &amp;s1, const std::string &amp;s2) const</td></tr>
+
+<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The operator () does the actual comparison in hash_map. </em> <a href="#a0"></a><em><br><br></td></tr>
+</table>
+<hr><a name="_details"></a><h2>Detailed Description</h2>
+This class returns true if two strings match.
+<p>
+Case sensitivity is ignored, and the RFC 'character set' is adhered to
+<p>
+
+<p>
+Definition at line <a class="el" href="hashcomp_8h-source.html#l00065">65</a> of file <a class="el" href="hashcomp_8h-source.html">hashcomp.h</a>.<hr><h2>Member Function Documentation</h2>
+<a name="a0" doxytag="irc::StrHashComp::operator()"></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> bool irc::StrHashComp::operator() </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>s1</em>, </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ <td class="md" nowrap>const std::string &amp;&nbsp;</td>
+ <td class="mdname" nowrap> <em>s2</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"> const</td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+The operator () does the actual comparison in hash_map.
+<p>
+ </td>
+ </tr>
+</table>
+<hr>The documentation for this struct was generated from the following file:<ul>
+<li><a class="el" href="hashcomp_8h-source.html">hashcomp.h</a></ul>
+<hr size="1"><address style="align: right;"><small>Generated on Sun May 15 18:39:26 2005 for InspIRCd by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.3 </small></address>
+</body>
+</html>
diff --git a/include/hashcomp.h b/include/hashcomp.h
index 32d155e30..a9bf15ab9 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -19,16 +19,20 @@
#include "inspircd_config.h"
-/**
+/*******************************************************
* This file contains classes and templates that deal
* with the comparison and hashing of 'irc strings'.
* An 'irc string' is a string which compares in a
* case insensitive manner, and as per RFC 1459 will
* treat [ identical to {, ] identical to }, and \
- * as identical to |. Our hashing functions are designed
- * to accept std::string and compare/hash them in an irc
- * type way, irc::string is a seperate class type currently.
- */
+ * as identical to |.
+ *
+ * Our hashing functions are designed to accept
+ * std::string and compare/hash them as type irc::string
+ * by converting them internally. This makes them
+ * backwards compatible with other code which is not
+ * aware of irc::string.
+ *******************************************************/
#ifdef GCC3
#include <ext/hash_map>
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 96811715d..70c592b1d 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -31,7 +31,7 @@
#endif
// from helperfuncs.cpp
-extern char lowermap[255];
+extern const char lowermap[255];
/******************************************************
*