1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 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 * ---------------------------------------------------
30 #include <sys/param.h>
31 #include <sys/types.h>
33 #ifndef _LINUX_C_LIB_VERSION
34 #include <sys/socket.h>
36 #include <netinet/in.h>
39 #include <arpa/inet.h>
43 #include "inspircd_config.h"
44 #include "inspircd_io.h"
45 #include "inspircd_util.h"
58 // maximum lengths of items
65 // flags for use with log()
73 // flags for use with WriteMode
78 // flags for use with OnUserPreMessage and OnUserPreNotice
81 #define TYPE_CHANNEL 2
83 typedef std::deque<std::string> file_cache;
85 typedef void (handlerfunc) (char**, int, userrec*);
88 int InspIRCd(char** argv, int argc);
90 void ReadConfig(bool bail,userrec* user);
92 std::string getservername();
93 std::string getserverdesc();
94 std::string getnetworkname();
95 std::string getadminname();
96 std::string getadminemail();
97 std::string getadminnick();
98 void readfile(file_cache &F, const char* fname);
99 bool ModeDefined(char c, int i);
100 bool ModeDefinedOper(char c, int i);
101 int ModeDefinedOn(char c, int i);
102 int ModeDefinedOff(char c, int i);
103 void ModeMakeList(char modechar);
104 bool ModeIsListMode(char modechar, int type);
105 chanrec* add_channel(userrec *user, const char* cn, const char* key, bool override);
106 chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool local);
107 void force_nickchange(userrec* user,const char* newnick);
108 void kill_link(userrec *user,const char* r);
109 void kill_link_silent(userrec *user,const char* r);
110 void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user);
112 int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
113 void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason);
114 void AddWhoWas(userrec* u);
115 void update_stats_l(int fd,int data_out);
116 void ConnectUser(userrec *user);
117 void DoSplitEveryone();
118 userrec* ReHashNick(char* Old, char* New);
119 bool LoadModule(const char* filename);
120 bool UnloadModule(const char* filename);
122 void NoticeAll(userrec *source, bool local_only, char* text, ...);
123 void NoticeAllOpers(userrec *source, bool local_only, char* text, ...);
125 void NetSendMyRoutingTable();
126 void DoSplit(const char* params);
127 void RemoveServer(const char* name);
128 void DoSync(serverrec* serv, char* tcp_host);
130 // optimization tricks to save us walking the user hash
132 void AddOper(userrec* user);
133 void DeleteOper(userrec* user);
135 void handle_version(char **parameters, int pcnt, userrec *user);