]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - include/helperfuncs.h
Move strlower into nspace namespace where hash<std::string> lives
[user/henk/code/inspircd.git] / include / helperfuncs.h
1 /*       +------------------------------------+
2  *       | Inspire Internet Relay Chat Daemon |
3  *       +------------------------------------+
4  *
5  *  InspIRCd is copyright (C) 2002-2006 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 _HELPER_H_
18 #define _HELPER_H_
19
20 #include "dynamic.h"
21 #include "base.h"
22 #include "ctables.h"
23 #include "users.h"
24 #include "channels.h"
25 #include "typedefs.h"
26 #include <string>
27 #include <deque>
28 #include <sstream>
29
30 /** Debug levels for use with InspIRCd::Log()
31  */
32 enum DebugLevel
33 {
34         DEBUG = 10,
35         VERBOSE = 20,
36         DEFAULT = 30,
37         SPARSE = 40,
38         NONE = 50,
39 };
40
41 /* I'm not entirely happy with this, the ## before 'args' is a g++ extension.
42  * The problem is that if you #define log(l, x, args...) and then call it
43  * with only two parameters, you get do_log(l, x, ), which is a syntax error...
44  * The ## tells g++ to remove the trailing comma...
45  * If this is ever an issue, we can just have an #ifndef GCC then #define log(a...) do_log(a)
46  */
47 #define STRINGIFY2(x) #x
48 #define STRINGIFY(x) STRINGIFY2(x) 
49 #define log(l, x, args...) InspIRCd::Log(l, __FILE__ ":" STRINGIFY(__LINE__) ": " x, ##args)
50
51 void Error(int status);
52 void ShowMOTD(userrec *user);
53 void ShowRULES(userrec *user);
54 bool AllModulesReportReady(userrec* user);
55 bool IsValidChannelName(const char *);
56
57 #endif