1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
17 #ifndef __INSPIRCD_H__
18 #define __INSPIRCD_H__
20 #include "inspircd_config.h"
29 #include <sys/types.h>
31 #ifndef _LINUX_C_LIB_VERSION
32 #include <sys/socket.h>
34 #include <netinet/in.h>
37 #include <arpa/inet.h>
42 #include "inspircd_io.h"
47 #include "socketengine.h"
48 #include "command_parse.h"
55 #define ETIREDGERBILS EAGAIN
57 // This define is used in place of strcmp when we
58 // want to check if a char* string contains only one
59 // letter. Pretty fast, its just two compares and an
61 #define IS_SINGLE(x,y) ( (*x == y) && (*(x+1) == 0) )
63 template<typename T> inline std::string ConvToStr(const T &in)
65 std::stringstream tmp;
66 if (!(tmp << in)) return std::string();
88 statsAccept = statsRefused = statsUnknown = 0;
89 statsCollisions = statsDns = statsDnsGood = 0;
90 statsDnsBad = statsConnects = statsSent = statsRecv = 0;
101 void erase_factory(int j);
102 void erase_module(int j);
103 void BuildISupport();
104 void MoveTo(std::string modulename,int slot);
109 ModeParser* ModeGrok;
110 CommandParser* Parser;
115 std::string GetRevision();
116 std::string GetVersionString();
118 bool LoadModule(const char* filename);
119 bool UnloadModule(const char* filename);
120 void MoveToLast(std::string modulename);
121 void MoveToFirst(std::string modulename);
122 void MoveAfter(std::string modulename, std::string after);
123 void MoveBefore(std::string modulename, std::string before);
124 InspIRCd(int argc, char** argv);
125 void DoOneIteration(bool process_module_sockets);
130 /* userrec optimization stuff */
131 void AddServerName(std::string servername);
132 const char* FindServerNamePtr(std::string servername);
133 bool FindServerName(std::string servername);