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 * ---------------------------------------------------
17 #include "inspircd_config.h"
26 #include <sys/types.h>
28 #ifndef _LINUX_C_LIB_VERSION
29 #include <sys/socket.h>
31 #include <netinet/in.h>
34 #include <arpa/inet.h>
38 #include "inspircd_io.h"
39 #include "inspircd_util.h"
52 // flags for use with log()
60 // flags for use with WriteMode
65 // flags for use with OnUserPreMessage and OnUserPreNotice
68 #define TYPE_CHANNEL 2
70 typedef std::deque<std::string> file_cache;
72 typedef void (handlerfunc) (char**, int, userrec*);
75 int InspIRCd(char** argv, int argc);
77 void ReadConfig(bool bail,userrec* user);
79 std::string getservername();
80 std::string getserverdesc();
81 std::string getnetworkname();
82 std::string getadminname();
83 std::string getadminemail();
84 std::string getadminnick();
85 void readfile(file_cache &F, const char* fname);
86 bool ModeDefined(char c, int i);
87 bool ModeDefinedOper(char c, int i);
88 int ModeDefinedOn(char c, int i);
89 int ModeDefinedOff(char c, int i);
90 void ModeMakeList(char modechar);
91 bool ModeIsListMode(char modechar, int type);
92 chanrec* add_channel(userrec *user, const char* cn, const char* key, bool override);
93 chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool local);
94 void force_nickchange(userrec* user,const char* newnick);
95 void kill_link(userrec *user,const char* r);
96 void kill_link_silent(userrec *user,const char* r);
97 void call_handler(const char* commandname,char **parameters, int pcnt, userrec *user);
98 std::string GetRevision();
99 int loop_call(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
100 void kick_channel(userrec *src,userrec *user, chanrec *Ptr, char* reason);
101 void AddWhoWas(userrec* u);
102 void update_stats_l(int fd,int data_out);
103 void ConnectUser(userrec *user);
104 void DoSplitEveryone();
105 userrec* ReHashNick(char* Old, char* New);
106 bool LoadModule(const char* filename);
107 bool UnloadModule(const char* filename);
109 void NoticeAll(userrec *source, bool local_only, char* text, ...);
110 void NoticeAllOpers(userrec *source, bool local_only, char* text, ...);
112 void NetSendMyRoutingTable();
113 void DoSplit(const char* params);
114 void RemoveServer(const char* name);
115 void DoSync(serverrec* serv, char* tcp_host);
117 // optimization tricks to save us walking the user hash
119 void AddOper(userrec* user);
120 void DeleteOper(userrec* user);
122 void handle_version(char **parameters, int pcnt, userrec *user);