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__
23 #include "inspircd_config.h"
28 #include "socketengine.h"
29 #include "command_parse.h"
31 /* Some misc defines */
36 #define ETIREDGERBILS EAGAIN
38 /* This define is used in place of strcmp when we
39 * want to check if a char* string contains only one
40 * letter. Pretty fast, its just two compares and an
43 #define IS_SINGLE(x,y) ( (*x == y) && (*(x+1) == 0) )
45 #define DELETE(x) { log(DEBUG,__FILE__" ("__LINE__"): delete()"); delete x; }
47 template<typename T> inline std::string ConvToStr(const T &in)
49 std::stringstream tmp;
50 if (!(tmp << in)) return std::string();
71 statsAccept = statsRefused = statsUnknown = 0;
72 statsCollisions = statsDns = statsDnsGood = 0;
73 statsDnsBad = statsConnects = statsSent = statsRecv = 0;
85 void erase_factory(int j);
86 void erase_module(int j);
88 void MoveTo(std::string modulename,int slot);
93 CommandParser* Parser;
98 std::string GetRevision();
99 std::string GetVersionString();
101 bool LoadModule(const char* filename);
102 bool UnloadModule(const char* filename);
103 void MoveToLast(std::string modulename);
104 void MoveToFirst(std::string modulename);
105 void MoveAfter(std::string modulename, std::string after);
106 void MoveBefore(std::string modulename, std::string before);
107 InspIRCd(int argc, char** argv);
108 void DoOneIteration(bool process_module_sockets);
113 /* Miscellaneous stuff here, moved from inspircd_io.h */
114 void Exit(int status);
118 void WritePID(const std::string &filename);
120 /* userrec optimization stuff */
121 void AddServerName(const std::string &servername);
122 const char* FindServerNamePtr(const std::string &servername);
123 bool FindServerName(const std::string &servername);