X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Finspircd.h;h=dbbd8ba0171496cdce9a5712d29fac568d4774ed;hb=97ef4d2d75c8a6df9f4a0383365c55ae4ea9cb22;hp=1b88ca0b72cce49b264cea77bfb483b4ace723f2;hpb=dd737891345a7ff80f601ab0c0ba712de5e10943;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/inspircd.h b/include/inspircd.h index 1b88ca0b7..dbbd8ba01 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -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" @@ -32,8 +32,12 @@ #endif // Required system headers. -#include -#include +#include +#include +#include +#include +#include +#include #include "inspircd_config.h" #include "uid.h" @@ -58,6 +62,11 @@ #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 > 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 IsChannel; + caller2 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 IsNick; + caller2 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& 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& 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.