]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd.h
Remove a slightly odd comment
[user/henk/code/inspircd.git] / include / inspircd.h
index 1b88ca0b72cce49b264cea77bfb483b4ace723f2..dbbd8ba0171496cdce9a5712d29fac568d4774ed 100644 (file)
@@ -15,8 +15,8 @@
 #define __INSPIRCD_H__
 
 #ifndef WIN32
-#define DllExport 
-#define CoreExport 
+#define DllExport
+#define CoreExport
 #define printf_c printf
 #else
 #include "inspircd_win32wrapper.h"
 #endif
 
 // Required system headers.
-#include <time.h>
-#include <stdarg.h>
+#include <ctime>
+#include <cstdarg>
+#include <algorithm>
+#include <cmath>
+#include <cstring>
+#include <climits>
 
 #include "inspircd_config.h"
 #include "uid.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.
  */
@@ -230,11 +239,11 @@ typedef std::vector<std::pair<std::string, long> > FailedPortList;
 class InspIRCd;
 
 DEFINE_HANDLER1(ProcessUserHandler, void, User*);
-DEFINE_HANDLER1(IsNickHandler, bool, const char*);
+DEFINE_HANDLER2(IsNickHandler, bool, const char*, size_t);
 DEFINE_HANDLER1(IsIdentHandler, bool, const char*);
 DEFINE_HANDLER1(FindDescriptorHandler, User*, int);
 DEFINE_HANDLER1(FloodQuitUserHandler, void, User*);
-DEFINE_HANDLER1(IsChannelHandler, bool, const char*);
+DEFINE_HANDLER2(IsChannelHandler, bool, const char*, size_t);
 DEFINE_HANDLER1(IsSIDHandler, bool, const std::string&);
 DEFINE_HANDLER1(RehashHandler, void, const std::string&);
 
@@ -265,12 +274,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
 {
@@ -422,7 +426,7 @@ class CoreExport InspIRCd : public classbase
        /** LogManager handles logging.
         */
        LogManager *Logs;
-       
+
        /** ModuleManager contains everything related to loading/unloading
         * modules.
         */
@@ -585,7 +589,7 @@ class CoreExport InspIRCd : public classbase
         * @param chname A channel name to verify
         * @return True if the name is valid
         */
-       caller1<bool, const char*> IsChannel;
+       caller2<bool, const char*, size_t> IsChannel;
 
        /** Return true if str looks like a server ID
         * @param string to check against
@@ -601,7 +605,7 @@ class CoreExport InspIRCd : public classbase
         */
        void SignalHandler(int signal);
 
-       /** Sets the signal recieved    
+       /** Sets the signal recieved
         * @param signal the signal recieved
         */
        static void SetSignal(int signal);
@@ -633,7 +637,7 @@ class CoreExport InspIRCd : public classbase
         * @param n A nickname to verify
         * @return True if the nick is valid
         */
-       caller1<bool, const char*> IsNick;
+       caller2<bool, const char*, size_t> IsNick;
 
        /** Return true if an ident is valid
         * @param An ident to verify
@@ -679,7 +683,7 @@ class CoreExport InspIRCd : public classbase
         * @param pcnt The number of items you have given in the first parameter
         * @param user The user to send error messages to
         */
-       void SendMode(const char* const* parameters, int pcnt, User *user);
+       void SendMode(const std::vector<std::string>& parameters, User *user);
 
        /** Match two strings using pattern matching.
         * This operates identically to the global function match(),
@@ -697,7 +701,7 @@ class CoreExport InspIRCd : public classbase
         * @param user The user to execute the command as
         * @return True if the command handler was called successfully
         */
-       CmdResult CallCommandHandler(const std::string &commandname, const char* const* parameters, int pcnt, User* user);
+       CmdResult CallCommandHandler(const std::string &commandname, const std::vector<std::string>& parameters, User* user);
 
        /** Return true if the command is a module-implemented command and the given parameters are valid for it
         * @param parameters The mode parameters
@@ -767,7 +771,7 @@ class CoreExport InspIRCd : public classbase
         * @param hashtype The hash from the config file
         * @return 0 if the strings match, 1 or -1 if they do not
         */
-       int PassCompare(Extensible* ex, const char* data,const char* input, const char* hashtype);
+       int PassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype);
 
        /** Check if a given server is a uline.
         * An empty string returns true, this is by design.