]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/inspircd.h
Re-added required parts of connection.h
[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 #include "inspircd_config.h"
18 #include <string>
19 #include <stdio.h>
20 #include <unistd.h>
21 #include <signal.h>
22 #include <time.h>
23 #include <netdb.h>
24 #include <string.h>
25 #include <errno.h>
26 #include <sys/types.h>
27
28 #ifndef _LINUX_C_LIB_VERSION
29 #include <sys/socket.h>
30 #include <sys/stat.h>
31 #include <netinet/in.h>
32 #endif
33
34 #include <arpa/inet.h>
35 #include <string>
36 #include <deque>
37
38 #include "inspircd_io.h"
39 #include "inspircd_util.h"
40 #include "users.h"
41 #include "channels.h"
42
43 // some misc defines
44
45 #define ERROR -1
46 #define TRUE 1
47 #define FALSE 0
48 #define MAXSOCKS 64
49 #define MAXCOMMAND 32
50
51 // flags for use with log()
52
53 #define DEBUG 10
54 #define VERBOSE 20
55 #define DEFAULT 30
56 #define SPARSE 40
57 #define NONE 50
58
59 // flags for use with WriteMode
60
61 #define WM_AND 1
62 #define WM_OR 2
63
64 // flags for use with OnUserPreMessage and OnUserPreNotice
65
66 #define TYPE_USER 1
67 #define TYPE_CHANNEL 2
68
69 typedef std::deque<std::string> file_cache;
70
71 typedef void (handlerfunc) (char**, int, userrec*);
72
73 /* prototypes */
74 int InspIRCd(char** argv, int argc);
75 int InitConfig(void);
76 void ReadConfig(bool bail,userrec* user);
77
78 std::string getservername();
79 std::string getserverdesc();
80 std::string getnetworkname();
81 std::string getadminname();
82 std::string getadminemail();
83 std::string getadminnick();
84 void readfile(file_cache &F, const char* fname);
85 bool ModeDefined(char c, int i);
86 bool ModeDefinedOper(char c, int i);
87 int ModeDefinedOn(char c, int i);
88 int ModeDefinedOff(char c, int i);
89 void ModeMakeList(char modechar);
90 bool ModeIsListMode(char modechar, int type);
91 chanrec* add_channel(userrec *user, const char* cn, const char* key, bool override);
92 chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool local);
93 void force_nickchange(userrec* user,const char* newnick);
94 void kill_link(userrec *user,const char* r);
95 void kill_link_silent(userrec *user,const char* r);
96 void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user);
97 std::string GetRevision();
98 int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
99 void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason);
100 void AddWhoWas(userrec* u);
101 void update_stats_l(int fd,int data_out);
102 void ConnectUser(userrec *user);
103 void DoSplitEveryone();
104 userrec* ReHashNick(char* Old, char* New);
105 bool LoadModule(const char* filename);
106 bool UnloadModule(const char* filename);
107 char* ModuleError();
108 void NoticeAll(userrec *source, bool local_only, char* text, ...);
109 void NoticeAllOpers(userrec *source, bool local_only, char* text, ...);
110
111 // optimization tricks to save us walking the user hash
112
113 void AddOper(userrec* user);
114 void DeleteOper(userrec* user);
115
116 void handle_version(char **parameters, int pcnt, userrec *user);
117
118 // userrec optimization stuff
119
120 void AddServerName(std::string servername);
121 const char* FindServerNamePtr(std::string servername);
122
123 std::string GetVersionString();
124