# now print the command file details.
foreach my $cmd (@cmdlist) {
print FH <<ITEM;
-cmd_$cmd.so: cmd_$cmd.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/globals.h ../../include/inspircd_config.h ../../include/commands/cmd_$cmd.h
+cmd_$cmd.so: cmd_$cmd.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/commands/cmd_$cmd.h
\@../../make/run-cc.pl \$(CC) -pipe -I../../include \$(FLAGS) -export-dynamic $SHARED -o cmd_$cmd.so cmd_$cmd.cpp
ITEM
std::string name; /* CHANMAX */
/** Modes for the channel.
- * This is not a null terminated string! It is a hash where
+ * This is not a null terminated string! It is a bitset where
* each item in it represents if a mode is set. For example
* for mode +A, index 0. Use modechar-65 to calculate which
* field to check.
*/
- unsigned char modes[64];
+ std::bitset<64> modes;
/** User lists.
* There are four user lists, one for
#include <vector>
#include <map>
#include "inspircd.h"
-#include "globals.h"
#include "modules.h"
#include "socketengine.h"
#include "socket.h"
+++ /dev/null
-/* +------------------------------------+
- * | Inspire Internet Relay Chat Daemon |
- * +------------------------------------+
- *
- * InspIRCd: (C) 2002-2008 InspIRCd Development Team
- * See: http://www.inspircd.org/wiki/index.php/Credits
- *
- * This program is free but copyrighted software; see
- * the file COPYING for details.
- *
- * ---------------------------------------------------
- */
-
-#ifndef __WORLD_H
-#define __WORLD_H
-
-#include <vector>
-#include <deque>
-#include <map>
-
-/** A cached text file stored with its contents as lines
- */
-typedef std::deque< std::string > file_cache;
-
-/** A configuration key and value pair
- */
-typedef std::pair< std::string, std::string > KeyVal;
-
-/** A list of related configuration keys and values
- */
-typedef std::vector< KeyVal > KeyValList;
-
-/** An entire config file, built up of KeyValLists
- */
-typedef std::multimap< std::string, KeyValList > ConfigDataHash;
-
-#endif
#include <cmath>
#include <cstring>
#include <climits>
+#include <vector>
+#include <deque>
+#include <map>
+#include <bitset>
+
+
+/** A list of failed port bindings, used for informational purposes on startup */
+typedef std::vector<std::pair<std::string, std::string> > FailedPortList;
+
+/** A cached text file stored with its contents as lines
+ */
+typedef std::deque< std::string > file_cache;
+
+/** A configuration key and value pair
+ */
+typedef std::pair< std::string, std::string > KeyVal;
+
+/** A list of related configuration keys and values
+ */
+typedef std::vector< KeyVal > KeyValList;
+
+/** An entire config file, built up of KeyValLists
+ */
+typedef std::multimap< std::string, KeyValList > ConfigDataHash;
+
#include "inspircd_config.h"
#include "numerics.h"
}
};
-/** A list of failed port bindings, used for informational purposes on startup */
-typedef std::vector<std::pair<std::string, std::string> > FailedPortList;
-
class InspIRCd;
DEFINE_HANDLER1(ProcessUserHandler, void, User*);
#ifndef __MODULES_H
#define __MODULES_H
-#include "globals.h"
#include "dynamic.h"
#include "base.h"
#include "ctables.h"
#include <string>
#include <map>
#include "inspircd_config.h"
-#include "globals.h"
#include "inspircd.h"
#include "socketengine.h"
#include <sys/epoll.h>
#include "inspircd_config.h"
#include "inspircd_win32wrapper.h"
-#include "globals.h"
#include "inspircd.h"
#include "socketengine.h"
#include <string>
#include <map>
#include "inspircd_config.h"
-#include "globals.h"
#include "inspircd.h"
#include <sys/types.h>
#include <sys/event.h>
#include <string>
#include <map>
#include "inspircd_config.h"
-#include "globals.h"
#include "inspircd.h"
#include "socketengine.h"
#include <port.h>
#include <sys/select.h>
#endif // WINDOWS
#include "inspircd_config.h"
-#include "globals.h"
#include "inspircd.h"
#include "socketengine.h"
#include "socket.h"
#include "connection.h"
#include "dns.h"
-
#include "mode.h"
/** Channel status for a user
std::string fullname;
/** The user's mode list.
- * This is NOT a null terminated string! In the 1.1 version of InspIRCd
- * this is an array of values in a similar way to channel modes.
- * A value of 1 in field (modeletter-65) indicates that the mode is
+ * NOT a null terminated string.
+ * Also NOT an array.
+ * Much love to the STL for giving us an easy to use bitset, saving us RAM.
+ * if (modes[modeletter-65]) is set, then the mode is
* set, for example, to work out if mode +s is set, we check the field
* User::modes['s'-65] != 0.
* The following RFC characters o, w, s, i have constants defined via an
* enum, such as UM_SERVERNOTICE and UM_OPETATOR.
*/
- unsigned char modes[64];
+ std::bitset<64> modes;
/** What snomasks are set on this user.
* This functions the same as the above modes.
*/
- unsigned char snomasks[64];
+ std::bitset<64> snomasks;
/** Channels this user is on, and the permissions they have there
*/
{
/* Fix for bug #310 reported by Smartys */
if (!dest->modes[UM_SNOMASK])
- memset(dest->snomasks, 0, sizeof(dest->snomasks));
+ dest->snomasks.reset();
parameter = dest->ProcessNoticeMasks(parameter.c_str());
dest->modes[UM_SNOMASK] = true;
AllowedOperCommands = NULL;
chans.clear();
invites.clear();
- memset(modes,0,sizeof(modes));
- memset(snomasks,0,sizeof(snomasks));
if (uid.empty())
uuid.assign(Instance->GetUID(), 0, UUID_LENGTH - 1);