summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/account.h44
-rw-r--r--include/bots.h24
-rw-r--r--include/channels.h28
-rw-r--r--include/commands.h18
-rw-r--r--include/config.h1465
-rw-r--r--include/extensible.h27
-rw-r--r--include/extern.h137
-rw-r--r--include/hashcomp.h86
-rw-r--r--include/mail.h6
-rw-r--r--include/modes.h123
-rw-r--r--include/module.h3
-rw-r--r--include/modules.h120
-rw-r--r--include/operserv.h19
-rw-r--r--include/opertype.h60
-rw-r--r--include/regchannel.h37
-rw-r--r--include/servers.h18
-rw-r--r--include/services.h570
-rw-r--r--include/sockets.h19
-rw-r--r--include/threadengine.h12
-rw-r--r--include/timers.h168
-rw-r--r--include/users.h38
-rw-r--r--include/version.sh.c70
-rw-r--r--src/actions.cpp6
-rw-r--r--src/base64.cpp37
-rw-r--r--src/bots.cpp23
-rw-r--r--src/botserv.cpp252
-rw-r--r--src/channels.cpp324
-rw-r--r--src/chanserv.cpp406
-rw-r--r--src/command.cpp9
-rw-r--r--src/commands.cpp50
-rw-r--r--src/compat.cpp26
-rw-r--r--src/config.cpp566
-rw-r--r--src/configreader.cpp12
-rw-r--r--src/core/cs_set_bantype.cpp2
-rw-r--r--src/core/cs_set_description.cpp4
-rw-r--r--src/core/cs_set_email.cpp2
-rw-r--r--src/core/cs_set_entrymsg.cpp2
-rw-r--r--src/core/cs_set_founder.cpp4
-rw-r--r--src/core/cs_set_keeptopic.cpp2
-rw-r--r--src/core/cs_set_mlock.cpp2
-rw-r--r--src/core/cs_set_opnotice.cpp4
-rw-r--r--src/core/cs_set_peace.cpp2
-rw-r--r--src/core/cs_set_persist.cpp6
-rw-r--r--src/core/cs_set_private.cpp2
-rw-r--r--src/core/cs_set_restricted.cpp2
-rw-r--r--src/core/cs_set_secure.cpp2
-rw-r--r--src/core/cs_set_securefounder.cpp2
-rw-r--r--src/core/cs_set_secureops.cpp4
-rw-r--r--src/core/cs_set_signkick.cpp2
-rw-r--r--src/core/cs_set_successor.cpp2
-rw-r--r--src/core/cs_set_topiclock.cpp2
-rw-r--r--src/core/cs_set_url.cpp2
-rw-r--r--src/core/cs_set_xop.cpp4
-rw-r--r--src/core/enc_md5.cpp4
-rw-r--r--src/core/enc_none.cpp6
-rw-r--r--src/core/enc_old.cpp4
-rw-r--r--src/core/enc_sha1.cpp4
-rw-r--r--src/core/enc_sha256.cpp12
-rw-r--r--src/core/ns_group.cpp8
-rw-r--r--src/core/ns_register.cpp6
-rw-r--r--src/core/os_staff.cpp4
-rw-r--r--src/encrypt.cpp20
-rw-r--r--src/hashcomp.cpp9
-rw-r--r--src/hostserv.cpp24
-rw-r--r--src/init.cpp87
-rw-r--r--src/ircd.cpp7
-rw-r--r--src/language.cpp151
-rw-r--r--src/log.cpp51
-rw-r--r--src/mail.cpp31
-rw-r--r--src/main.cpp86
-rw-r--r--src/memory.cpp26
-rw-r--r--src/memoserv.cpp276
-rw-r--r--src/messages.cpp102
-rw-r--r--src/misc.cpp874
-rw-r--r--src/modes.cpp70
-rw-r--r--src/module.cpp29
-rw-r--r--src/modulemanager.cpp143
-rw-r--r--src/modules.cpp158
-rw-r--r--src/modules/hs_request.cpp4
-rw-r--r--src/nickalias.cpp21
-rw-r--r--src/nickcore.cpp18
-rw-r--r--src/nickserv.cpp68
-rw-r--r--src/operserv.cpp73
-rw-r--r--src/opertype.cpp28
-rw-r--r--src/process.cpp148
-rw-r--r--src/regchannel.cpp73
-rw-r--r--src/send.cpp38
-rw-r--r--src/servers.cpp61
-rw-r--r--src/sessions.cpp97
-rw-r--r--src/sockets.cpp37
-rw-r--r--src/threadengine.cpp1
-rw-r--r--src/threadengine_pthread.cpp5
-rw-r--r--src/threadengine_win32.cpp3
-rw-r--r--src/timers.cpp10
-rw-r--r--src/users.cpp153
-rw-r--r--src/wildcard.cpp18
-rw-r--r--src/win32_memory.cpp7
-rw-r--r--src/windows.cpp23
98 files changed, 3835 insertions, 4100 deletions
diff --git a/include/account.h b/include/account.h
index e44880c29..0b7c95b44 100644
--- a/include/account.h
+++ b/include/account.h
@@ -1,3 +1,6 @@
+#ifndef ACCOUNT_H
+#define ACCOUNT_H
+
class NickAlias;
class NickCore;
class NickRequest;
@@ -92,7 +95,7 @@ class CoreExport NickRequest : public Extensible
std::string password;
char *email;
time_t requested;
- time_t lastmail; /* Unsaved */
+ time_t lastmail; /* Unsaved */
};
class NickCore;
@@ -111,12 +114,12 @@ class CoreExport NickAlias : public Extensible, public Flags<NickNameFlag>
~NickAlias();
char *nick; /* Nickname */
- char *last_quit; /* Last quit message */
- char *last_realname; /* Last realname */
- char *last_usermask; /* Last usermask */
- time_t time_registered; /* When the nick was registered */
- time_t last_seen; /* When it was seen online for the last time */
- NickCore *nc; /* I'm an alias of this */
+ char *last_quit; /* Last quit message */
+ char *last_realname; /* Last realname */
+ char *last_usermask; /* Last usermask */
+ time_t time_registered; /* When the nick was registered */
+ time_t last_seen; /* When it was seen online for the last time */
+ NickCore *nc; /* I'm an alias of this */
HostInfo hostinfo;
/** Release a nick
@@ -146,28 +149,28 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag>
std::list<User *> Users;
- char *display; /* How the nick is displayed */
- std::string pass; /* Password of the nicks */
- char *email; /* E-mail associated to the nick */
- char *greet; /* Greet associated to the nick */
- uint32 icq; /* ICQ # associated to the nick */
- char *url; /* URL associated to the nick */
- uint16 language; /* Language selected by nickname owner (LANG_*) */
- std::vector<std::string> access; /* Access list, vector of strings */
+ char *display; /* How the nick is displayed */
+ std::string pass; /* Password of the nicks */
+ char *email; /* E-mail associated to the nick */
+ char *greet; /* Greet associated to the nick */
+ uint32 icq; /* ICQ # associated to the nick */
+ char *url; /* URL associated to the nick */
+ uint16 language; /* Language selected by nickname owner (LANG_*) */
+ std::vector<std::string> access; /* Access list, vector of strings */
MemoInfo memos;
- uint16 channelcount; /* Number of channels currently registered */
+ uint16 channelcount; /* Number of channels currently registered */
OperType *ot;
/* Unsaved data */
- time_t lastmail; /* Last time this nick record got a mail */
- std::list<NickAlias *> aliases; /* List of aliases */
+ time_t lastmail; /* Last time this nick record got a mail */
+ std::list<NickAlias *> aliases; /* List of aliases */
/** Check whether this opertype has access to run the given command string.
* @param cmdstr The string to check, e.g. botserv/set/private.
* @return True if this opertype may run the specified command, false otherwise.
*/
- virtual bool HasCommand(const std::string &cmdstr) const;
+ virtual bool HasCommand(const ci::string &cmdstr) const;
/** Checks whether this account is a services oper or not.
* @return True if this account is a services oper, false otherwise.
@@ -178,7 +181,7 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag>
* @param privstr The priv to check for, e.g. users/auspex.
* @return True if this opertype has the specified priv, false otherwise.
*/
- virtual bool HasPriv(const std::string &privstr) const;
+ virtual bool HasPriv(const ci::string &privstr) const;
/** Add an entry to the nick's access list
*
@@ -221,3 +224,4 @@ class CoreExport NickCore : public Extensible, public Flags<NickCoreFlag>
void ClearAccess();
};
+#endif // ACCOUNT_H
diff --git a/include/bots.h b/include/bots.h
index 8952005e7..9227f5c68 100644
--- a/include/bots.h
+++ b/include/bots.h
@@ -3,11 +3,11 @@
* Copyright (C) 2008-2010 Anope Team <team@anope.org>
*
* Please read COPYING and README for further details.
- *
- *
- *
*/
+#ifndef BOTS_H
+#define BOTS_H
+
#include "commands.h"
class BotInfo;
@@ -32,15 +32,15 @@ enum BotFlag
class CoreExport BotInfo : public Extensible, public Flags<BotFlag>
{
public:
- std::string uid; /* required for UID supporting servers, as opposed to the shitty struct Uid. */
- std::string nick; /* Nickname of the bot */
- std::string user; /* Its user name */
- std::string host; /* Its hostname */
- std::string real; /* Its real name */
- time_t created; /* Birth date ;) */
- int16 chancount; /* Number of channels that use the bot. */
+ std::string uid; /* required for UID supporting servers, as opposed to the shitty struct Uid. */
+ std::string nick; /* Nickname of the bot */
+ std::string user; /* Its user name */
+ std::string host; /* Its hostname */
+ std::string real; /* Its real name */
+ time_t created; /* Birth date ;) */
+ int16 chancount; /* Number of channels that use the bot. */
/* Dynamic data */
- time_t lastmsg; /* Last time we said something */
+ time_t lastmsg; /* Last time we said something */
CommandMap Commands;
/** Create a new bot.
@@ -77,3 +77,5 @@ class CoreExport BotInfo : public Extensible, public Flags<BotFlag>
*/
void UnAssign(User *u, ChannelInfo *ci);
};
+
+#endif // BOTS_H
diff --git a/include/channels.h b/include/channels.h
index 7814a377a..75f5dad3d 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -4,10 +4,11 @@
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
- *
- *
*/
+#ifndef CHANNELS_H
+#define CHANNELS_H
+
typedef unordered_map_namespace::unordered_map<ci::string, Channel *, hash_compare_ci_string> channel_map;
extern CoreExport channel_map ChannelList;
@@ -75,12 +76,12 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
*/
~Channel();
- std::string name; /* Channel name */
- ChannelInfo *ci; /* Corresponding ChannelInfo */
- time_t creation_time; /* When channel was created */
+ std::string name; /* Channel name */
+ ChannelInfo *ci; /* Corresponding ChannelInfo */
+ time_t creation_time; /* When channel was created */
char *topic;
std::string topic_setter;
- time_t topic_time; /* When topic was set */
+ time_t topic_time; /* When topic was set */
EList *bans;
EList *excepts;
@@ -90,13 +91,13 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
CUserList users;
BanData *bd;
-
- time_t server_modetime; /* Time of last server MODE */
- time_t chanserv_modetime; /* Time of last check_modes() */
- int16 server_modecount; /* Number of server MODEs this second */
- int16 chanserv_modecount; /* Number of check_mode()'s this sec */
- int16 bouncy_modes; /* Did we fail to set modes here? */
- int16 topic_sync; /* Is the topic in sync? */
+
+ time_t server_modetime; /* Time of last server MODE */
+ time_t chanserv_modetime; /* Time of last check_modes() */
+ int16 server_modecount; /* Number of server MODEs this second */
+ int16 chanserv_modecount; /* Number of check_mode()'s this sec */
+ int16 bouncy_modes; /* Did we fail to set modes here? */
+ int16 topic_sync; /* Is the topic in sync? */
/** Restore the channel topic, set mlock (key), set stickied bans, etc
*/
@@ -263,3 +264,4 @@ class CoreExport Channel : public Extensible, public Flags<ChannelFlags>
bool Kick(BotInfo *bi, User *u, const char *reason = NULL, ...);
};
+#endif // CHANNELS_H
diff --git a/include/commands.h b/include/commands.h
index 327d65736..cfe2eddab 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -7,12 +7,10 @@
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
- *
- *
*/
-#ifndef COMMAND_H_
-#define COMMAND_H_
+#ifndef COMMAND_H
+#define COMMAND_H
#include "services.h"
@@ -57,7 +55,7 @@ class CoreExport Command : public Flags<CommandFlag>
/* Command name */
ci::string name;
/* Permission needed to use this comand */
- std::string permission;
+ ci::string permission;
/* Module which owns us */
Module *module;
@@ -70,7 +68,7 @@ class CoreExport Command : public Flags<CommandFlag>
* @param max_params The maximum number of parameters the parser will create, after max_params, all will be combined into the last argument.
* NOTE: If max_params is not set (default), there is no limit to the max number of params.
*/
- Command(const ci::string &sname, size_t min_params, size_t max_params = 0, const std::string &spermission = "");
+ Command(const ci::string &sname, size_t min_params, size_t max_params = 0, const ci::string &spermission = "");
virtual ~Command();
@@ -86,8 +84,7 @@ class CoreExport Command : public Flags<CommandFlag>
/** Requested when the user is requesting help on this command. Help on this command should be sent to the user.
* @param u The user requesting help
- * @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of
-"FOO BAR LOL")
+ * @param subcommand The subcommand the user is requesting help on, or an empty string. (e.g. /ns help set foo bar lol gives a subcommand of "FOO BAR LOL")
* @return true if help was provided to the user, false otherwise.
*/
virtual bool OnHelp(User *u, const ci::string &subcommand);
@@ -101,7 +98,7 @@ class CoreExport Command : public Flags<CommandFlag>
/** Set which command permission (e.g. chanserv/forbid) is required for this command.
* @param reststr The permission required to successfully execute this command
*/
- void SetPermission(const std::string &reststr);
+ void SetPermission(const ci::string &reststr);
/** Add a subcommand to this command
* @param c The command
@@ -114,5 +111,4 @@ class CoreExport Command : public Flags<CommandFlag>
virtual bool DelSubcommand(const ci::string &cname);
};
-#endif
-
+#endif // COMMANDS_H
diff --git a/include/config.h b/include/config.h
index dacf3db06..dc1dde3f8 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1,5 +1,5 @@
-#ifndef _CONFIGREADER_H_
-#define _CONFIGREADER_H_
+#ifndef CONFIG_H
+#define CONFIG_H
#include <string>
#include <fstream>
@@ -10,7 +10,7 @@
/** A configuration key and value pair
*/
-typedef std::pair<std::string, std::string> KeyVal;
+typedef std::pair<ci::string, ci::string> KeyVal;
/** A list of related configuration keys and values
*/
@@ -18,20 +18,22 @@ typedef std::vector<KeyVal> KeyValList;
/** An entire config file, built up of KeyValLists
*/
-typedef std::multimap<std::string, KeyValList> ConfigDataHash;
+typedef std::multimap<ci::string, KeyValList> ConfigDataHash;
// Required forward definitions
class ServerConfig;
/** Types of data in the core config
*/
-enum ConfigDataType {
+enum ConfigDataType
+{
DT_NOTHING, // No data
DT_INTEGER, // Integer
DT_UINTEGER, // Unsigned Integer
DT_LUINTEGER, // Long Unsigned Integer
DT_CHARPTR, // Char pointer
DT_STRING, // std::string
+ DT_CISTRING, // ci::string
DT_BOOLEAN, // Boolean
DT_HOSTNAME, // Hostname syntax
DT_NOSPACES, // No spaces
@@ -50,35 +52,42 @@ enum ConfigDataType {
*/
class ValueItem
{
- /** Actual data */
- std::string v;
- public:
- /** Initialize with an int */
- ValueItem(int);
- /** Initialize with a bool */
- ValueItem(bool);
- /** Initialize with a char pointer */
- ValueItem(const char *);
- /** Initialize with an std::string */
- ValueItem(const std::string &);
- /** Initialize with a long */
- ValueItem(long);
- /** Change value to a char pointer */
- //void Set(char *);
- /** Change value to a const char pointer */
- void Set(const char *);
- /** Change value to an std::string */
- void Set(const std::string &);
- /** Change value to an int */
- void Set(int);
- /** Get value as an int */
- int GetInteger();
- /** Get value as a string */
- const char *GetString() const;
- /** Get value as a string */
- inline const std::string &GetValue() const { return v; }
- /** Get value as a bool */
- bool GetBool();
+ private:
+ /** Actual