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 * ---------------------------------------------------
30 /** Flags for use with log()
38 /* I'm not entirely happy with this, the ## before 'args' is a g++ extension.
39 * The problem is that if you #define log(l, x, args...) and then call it
40 * with only two parameters, you get do_log(l, x, ), which is a syntax error...
41 * The ## tells g++ to remove the trailing comma...
42 * If this is ever an issue, we can just have an #ifndef GCC then #define log(a...) do_log(a)
44 #define STRINGIFY2(x) #x
45 #define STRINGIFY(x) STRINGIFY2(x)
46 #define log(l, x, args...) do_log(l, __FILE__ ":" STRINGIFY(__LINE__) ": " x, ##args)
48 void do_log(int level, const char *text, ...);
49 void readfile(file_cache &F, const char* fname);
51 void WriteCommon(userrec *u, char* text, ...);
52 void WriteCommonExcept(userrec *u, char* text, ...);
53 void WriteOpers(const char* text, ...);
55 void WriteCommon_NoFormat(userrec *u, const char* text);
56 void WriteCommonExcept_NoFormat(userrec *u, const char* text);
57 void WriteOpers_NoFormat(const char* text);
59 std::string GetServerDescription(const char* servername);
60 void WriteMode(const char* modes, int flags, const char* text, ...);
61 void NoticeAll(userrec *source, bool local_only, char* text, ...);
62 void ServerNoticeAll(char* text, ...);
63 void ServerPrivmsgAll(char* text, ...);
64 void WriteWallOps(userrec *source, bool local_only, char* text, ...);
65 void strlower(char *n);
66 userrec* Find(const std::string &nick);
67 userrec* Find(const char* nick);
68 chanrec* FindChan(const char* chan);
69 long GetMaxBans(char* name);
70 void purge_empty_chans(userrec* u);
71 char* chanmodes(chanrec *chan, bool showkey);
72 void userlist(userrec *user,chanrec *c);
73 int usercount_i(chanrec *c);
74 int usercount(chanrec *c);
75 ConnectClass GetClass(userrec *user);
76 void send_error(char *s);
77 void Error(int status);
79 int registered_usercount(void);
80 int usercount_invisible(void);
81 int usercount_opers(void);
82 int usercount_unknown(void);
85 void ShowMOTD(userrec *user);
86 void ShowRULES(userrec *user);
87 bool AllModulesReportReady(userrec* user);
88 bool DirValid(char* dirandfile);
89 bool FileExists(const char* file);
90 char* CleanFilename(char* name);
91 std::string GetFullProgDir(char** argv, int argc);
92 int InsertMode(std::string &output, const char* modes, unsigned short section);
93 bool IsValidChannelName(const char *);
95 int charlcat(char* x,char y,int z);
96 bool charremove(char* mp, char remove);