]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/inspircd.h
Moved a ton of defined to modules.h that belong there
[user/henk/code/inspircd.git] / include / inspircd.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
6  *                       E-mail:
7  *                <brain@chatspike.net>
8  *                <Craig@chatspike.net>
9  *     
10  * Written by Craig Edwards, Craig McLure, and others.
11  * This program is free but copyrighted software; see
12  *            the file COPYING for details.
13  *
14  * ---------------------------------------------------
15  */
16
17 #ifndef __INSPIRCD_H__
18 #define __INSPIRCD_H__
19
20 #include "inspircd_config.h"
21 #include <string>
22 #include <stdio.h>
23 #include <unistd.h>
24 #include <signal.h>
25 #include <time.h>
26 #include <netdb.h>
27 #include <string.h>
28 #include <errno.h>
29 #include <sys/types.h>
30
31 #ifndef _LINUX_C_LIB_VERSION
32 #include <sys/socket.h>
33 #include <sys/stat.h>
34 #include <netinet/in.h>
35 #endif
36
37 #include <arpa/inet.h>
38 #include <string>
39 #include <deque>
40
41 #include "inspircd_io.h"
42 #include "users.h"
43 #include "channels.h"
44 #include "socket.h"
45 #include "mode.h"
46 #include "command_parse.h"
47
48 // some misc defines
49
50 #define ERROR -1
51 #define TRUE 1
52 #define FALSE 0
53 #define MAXSOCKS 64
54 #define MAXCOMMAND 32
55
56 /*
57 flags for use with WriteMode
58
59 #define WM_AND 1
60 #define WM_OR 2
61
62 flags for use with OnUserPreMessage and OnUserPreNotice
63
64 #define TYPE_USER 1
65 #define TYPE_CHANNEL 2
66 #define TYPE_SERVER 3
67
68 #define IS_LOCAL(x) (x->fd > -1)
69 #define IS_REMOTE(x) (x->fd < 0)
70 #define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER)
71 */
72
73 class serverstats
74 {
75   public:
76         int statsAccept;
77         int statsRefused;
78         int statsUnknown;
79         int statsCollisions;
80         int statsDns;
81         int statsDnsGood;
82         int statsDnsBad;
83         int statsConnects;
84         int statsSent;
85         int statsRecv;
86         int BoundPortCount;
87
88         serverstats()
89         {
90                 statsAccept = statsRefused = statsUnknown = 0;
91                 statsCollisions = statsDns = statsDnsGood = 0;
92                 statsDnsBad = statsConnects = statsSent = statsRecv = 0;
93                 BoundPortCount = 0;
94         }
95 };
96
97
98 class InspIRCd
99 {
100
101  private:
102         char MODERR[MAXBUF];
103         void erase_factory(int j);
104         void erase_module(int j);       
105
106  public:
107         time_t startup_time;
108         ModeParser* ModeGrok;
109         CommandParser* Parser;
110
111         std::string GetRevision();
112         std::string GetVersionString();
113         char* ModuleError();
114         bool LoadModule(const char* filename);
115         bool UnloadModule(const char* filename);
116         InspIRCd(int argc, char** argv);
117         int Run();
118
119 };
120
121 /* userrec optimization stuff */
122 void AddServerName(std::string servername);
123 const char* FindServerNamePtr(std::string servername);
124
125 #endif