]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Combine IP+port in a failed port list, show (the more helpful) error string so the...
[user/henk/code/inspircd.git] / include / inspircd.h
index 18bb1c28f2e78f64ac1aa903c6371395ccedfd2a..9ef5dbcfb932f80587852d6481db4fa43b093c1a 100644 (file)
 #include <algorithm>
 #include <cmath>
 #include <cstring>
+#include <climits>
 
 #include "inspircd_config.h"
+#include "numerics.h"
 #include "uid.h"
 #include "users.h"
 #include "channels.h"
 #include "inspstring.h"
 #include "protocol.h"
 
+#ifndef PATH_MAX
+#warning Potentially broken system, PATH_MAX undefined
+#define PATH_MAX 4096
+#endif
+
 /**
  * Used to define the maximum number of parameters a command may have.
  */
@@ -149,18 +156,6 @@ template<typename T> inline long ConvToInt(const T &in)
        return atoi(tmp.str().c_str());
 }
 
-template<typename CharT, typename TraitsT, std::size_t N>
-static inline bool operator == (std::basic_string<CharT, TraitsT> const &lhs, char const (&rhs)[N])
-{
-       return lhs.length() == N - 1 && !std::memcmp(lhs.data(), rhs, N - 1);
-}
-
-template<typename CharT, typename TraitsT, std::size_t N>
-static inline bool operator != (std::basic_string<CharT, TraitsT> const &lhs, char const (&rhs)[N])
-{
-       return !(lhs == rhs);
-}
-
 /** Template function to convert integer to char, storing result in *res and
  * also returning the pointer to res. Based on Stuart Lowe's C/C++ Pages.
  * @param T input value
@@ -240,7 +235,7 @@ class serverstats : public classbase
 };
 
 /** A list of failed port bindings, used for informational purposes on startup */
-typedef std::vector<std::pair<std::string, long> > FailedPortList;
+typedef std::vector<std::pair<std::string, std::string> > FailedPortList;
 
 class InspIRCd;
 
@@ -280,12 +275,7 @@ class CoreExport ConfigReaderThread : public Thread
  * classbase. Amongst other things, it contains a ModeParser,
  * a DNS object, a CommandParser object, and a list of active
  * Module objects, and facilities for Module objects to
- * interact with the core system it implements. You should
- * NEVER attempt to instantiate a class of type InspIRCd
- * yourself. If you do, this is equivalent to spawning a second
- * IRC server, and could have catastrophic consequences for the
- * program in terms of ram usage (basically, you could create
- * an obese forkbomb built from recursively spawning irc servers!)
+ * interact with the core system it implements.
  */
 class CoreExport InspIRCd : public classbase
 {
@@ -885,6 +875,10 @@ class CoreExport InspIRCd : public classbase
         */
        void BufferedSocketCull();
 
+       /** Adds an extban char to the 005 token.
+        */
+       void AddExtBanChar(char c);
+
        char* GetReadBuffer()
        {
                return this->ReadBuffer;