Move Hook `operator<' to BotInterp.C (cleaner source...)
authorclinton <clinton@unknownlamer.org>
Sat, 15 Nov 2008 21:04:29 +0000 (21:04 +0000)
committerclinton <clinton@unknownlamer.org>
Sat, 15 Nov 2008 21:04:29 +0000 (21:04 +0000)
source/BotInterp.C
source/BotInterp.H

index 8b58d3e..2388cd4 100644 (file)
@@ -35,6 +35,36 @@ extern "C"
 #include <libguile/regex-posix.h>
 }
 
+bool
+Hook::operator< (const Hook & h) const
+{
+  if (priority < h.priority)
+    {
+      return true;
+    }
+  else if (priority > h.priority)
+    {
+      return false;
+    }
+  else if (fallthru && h.fallthru)
+    {
+      return false;
+    }
+  else if (fallthru && !h.fallthru)
+    {
+      return false;
+    }
+  else if (!fallthru && h.fallthru)
+    {
+      return true;
+    }
+  else
+    {
+      // NOTE: This should never be reached
+      return false;
+    }
+}
+
 BotInterp::BotInterp(Bot *b, String fn)
   : bot(b), counter(0), timer_mutex (true)
 {
index 4929058..f63a7b1 100644 (file)
@@ -53,34 +53,7 @@ struct Hook {
     : type(t), priority (p), fallthru (ft), regex_str(rs), 
       name (n), regex(r), function(f)  { }
 
-  bool operator< (const Hook &h) const
-  {
-    if (priority < h.priority)
-      {
-       return true;
-      }
-    else if (priority > h.priority)
-      {
-       return false;
-      }
-    else if (fallthru && h.fallthru)
-      {
-       return false;
-      }
-    else if (fallthru && !h.fallthru)
-      {
-       return false;
-      }
-    else if (!fallthru && h.fallthru)
-      {
-       return true;
-      }
-    else
-      {
-       // NOTE: This should never be reached
-       return false;
-      }
-  }
+  bool operator< (const Hook & h) const;
 
   enum {
     ACTION, NICKNAME, SIGNOFF, CTCP, CTCP_REPLY,