#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 "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.
*/
};
/** 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;
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&);
* 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
{
/** LogManager handles logging.
*/
LogManager *Logs;
-
+
/** ModuleManager contains everything related to loading/unloading
* modules.
*/
* @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
*/
void SignalHandler(int signal);
- /** Sets the signal recieved
+ /** Sets the signal recieved
* @param signal the signal recieved
*/
static void SetSignal(int signal);
* @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
* @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.
*/
void BufferedSocketCull();
+ /** Adds an extban char to the 005 token.
+ */
+ void AddExtBanChar(char c);
+
char* GetReadBuffer()
{
return this->ReadBuffer;