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>
46 #include "socketengine.h"
47 #include "command_parse.h"
54 #define ETIREDGERBILS EAGAIN
56 // This define is used in place of strcmp when we
57 // want to check if a char* string contains only one
58 // letter. Pretty fast, its just two compares and an
60 #define IS_SINGLE(x,y) ( (*x == y) && (*(x+1) == 0) )
62 template<typename T> inline std::string ConvToStr(const T &in)
64 std::stringstream tmp;
65 if (!(tmp << in)) return std::string();
87 statsAccept = statsRefused = statsUnknown = 0;
88 statsCollisions = statsDns = statsDnsGood = 0;
89 statsDnsBad = statsConnects = statsSent = statsRecv = 0;
100 void erase_factory(int j);
101 void erase_module(int j);
102 void BuildISupport();
103 void MoveTo(std::string modulename,int slot);
108 ModeParser* ModeGrok;
109 CommandParser* Parser;
114 std::string GetRevision();
115 std::string GetVersionString();
117 bool LoadModule(const char* filename);
118 bool UnloadModule(const char* filename);
119 void MoveToLast(std::string modulename);
120 void MoveToFirst(std::string modulename);
121 void MoveAfter(std::string modulename, std::string after);
122 void MoveBefore(std::string modulename, std::string before);
123 InspIRCd(int argc, char** argv);
124 void DoOneIteration(bool process_module_sockets);
129 /* Miscellaneous stuff here, moved from inspircd_io.h */
130 void Exit(int status);
134 void WritePID(const std::string &filename);
136 /* userrec optimization stuff */
137 void AddServerName(std::string servername);
138 const char* FindServerNamePtr(std::string servername);
139 bool FindServerName(std::string servername);