* ---------------------------------------------------
*/
-using namespace std;
-
#include "inspircd_config.h"
#include "inspircd.h"
-#include "inspircd_io.h"
+#include "configreader.h"
#include <unistd.h>
#include <sys/errno.h>
#include <time.h>
#include <string>
-#ifdef GCC3
-#include <ext/hash_map>
-#else
-#include <hash_map>
-#endif
#include <map>
#include <sstream>
#include <vector>
extern ServerConfig *Config;
extern InspIRCd* ServerInstance;
extern int MODCOUNT;
-extern std::vector<Module*> modules;
-extern std::vector<ircd_module*> factory;
+extern ModuleList modules;
+extern FactoryList factory;
extern std::vector<InspSocket*> module_sockets;
extern std::vector<userrec*> local_users;
extern time_t TIME;
-class Server;
extern userrec* fd_ref_table[MAX_DESCRIPTORS];
-
extern user_hash clientlist;
extern chan_hash chanlist;
extern command_table cmdlist;
+
+class Server;
+
ExtModeList EMode;
+featurelist Features;
// returns true if an extended mode character is in use
bool ModeDefined(char modechar, int type)
char* Request::GetData()
{
- return this->data;
+ return (char*)this->data;
}
Module* Request::GetSource()
char* Event::GetData()
{
- return this->data;
+ return (char*)this->data;
}
Module* Event::GetSource()
return PRIORITY_DONTCARE;
}
+bool Server::PublishFeature(const std::string &FeatureName, Module* Mod)
+{
+ if (Features.find(FeatureName) == Features.end())
+ {
+ Features[FeatureName] = Mod;
+ return true;
+ }
+ return false;
+}
+
+bool Server::UnpublishFeature(const std::string &FeatureName)
+{
+ featurelist::iterator iter = Features.find(FeatureName);
+
+ if (iter == Features.end())
+ return false;
+
+ Features.erase(iter);
+ return true;
+}
+
+Module* Server::FindFeature(const std::string &FeatureName)
+{
+ featurelist::iterator iter = Features.find(FeatureName);
+
+ if (iter == Features.end())
+ return NULL;
+
+ return iter->second;
+}
+
void Server::RehashServer()
{
WriteOpers("*** Rehashing config file");
void Server::SendMode(char **parameters, int pcnt, userrec *user)
{
- ServerInstance->ModeGrok->ServerMode(parameters,pcnt,user);
+ //ServerInstance->ModeGrok->ServerMode(parameters,pcnt,user);
}
void Server::Send(int Socket, const std::string &s)
//~ if (this->cache)
//~ delete this->cache;
if (this->errorlog)
- delete this->errorlog;
+ DELETE(this->errorlog);
if(this->privatehash)
- delete this->data;
+ DELETE(this->data);
}