summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ctables.h11
-rw-r--r--include/helperfuncs.h1
-rw-r--r--include/inspircd.h2
-rw-r--r--include/modules.h5
-rw-r--r--include/typedefs.h1
-rw-r--r--src/command_parse.cpp2
-rw-r--r--src/commands.cpp10
-rw-r--r--src/mode.cpp1
8 files changed, 20 insertions, 13 deletions
diff --git a/include/ctables.h b/include/ctables.h
index 5926f3a2a..2dadca42d 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -18,12 +18,15 @@
#define __CTABLES_H__
#include "inspircd_config.h"
-#include "inspircd.h"
-#include "base.h"
+#include <deque>
+
+class userrec;
+
+typedef void (handlerfunc) (char**, int, userrec*);
/** A structure that defines a command
*/
-class command_t : public Extensible
+class command_t
{
public:
/** Command name
@@ -49,5 +52,7 @@ class command_t : public Extensible
char source[MAXBUF];
};
+typedef std::deque<command_t> command_table;
+
#endif
diff --git a/include/helperfuncs.h b/include/helperfuncs.h
index 6b804c8c7..269cd70b9 100644
--- a/include/helperfuncs.h
+++ b/include/helperfuncs.h
@@ -22,6 +22,7 @@
#include "ctables.h"
#include "users.h"
#include "channels.h"
+#include "typedefs.h"
#include <string>
#include <deque>
#include <sstream>
diff --git a/include/inspircd.h b/include/inspircd.h
index 4e7710714..75446aa36 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -68,7 +68,7 @@
#define IS_REMOTE(x) (x->fd < 0)
#define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER)
-typedef void (handlerfunc) (char**, int, userrec*);
+/*typedef void (handlerfunc) (char**, int, userrec*);*/
class serverstats
{
diff --git a/include/modules.h b/include/modules.h
index 77f986f0d..b86576296 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -63,6 +63,7 @@
#include <sstream>
class Server;
+class ServerConfig;
/** Low level definition of a FileReader classes file cache area
*/
@@ -100,8 +101,8 @@ typedef std::deque<userrec*> chanuserlist;
#define FD_MAGIC_NUMBER -42
-extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source);
-extern void server_mode(char **parameters, int pcnt, userrec *user);
+/*extern void createcommand(char* cmd, handlerfunc f, char flags, int minparams, char* source);
+extern void server_mode(char **parameters, int pcnt, userrec *user);*/
// class Version holds the version information of a Module, returned
// by Module::GetVersion (thanks RD)
diff --git a/include/typedefs.h b/include/typedefs.h
index 0a625b1d2..2fe74c8af 100644
--- a/include/typedefs.h
+++ b/include/typedefs.h
@@ -21,7 +21,6 @@ typedef nspace::hash_map<std::string, userrec*, nspace::hash<string>, irc::StrHa
typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHashComp> chan_hash;
typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
-typedef std::deque<command_t> command_table;
typedef std::vector<std::string> servernamelist;
typedef std::vector<ExtMode> ExtModeList;
typedef ExtModeList::iterator ExtModeListIter;
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 34124e74f..4f5add0d6 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -40,7 +40,6 @@ using namespace std;
#include <pthread.h>
#endif
#include "users.h"
-#include "ctables.h"
#include "globals.h"
#include "modules.h"
#include "dynamic.h"
@@ -59,6 +58,7 @@ using namespace std;
#include "dns.h"
#include "typedefs.h"
#include "command_parse.h"
+#include "ctables.h"
extern InspIRCd* ServerInstance;
diff --git a/src/commands.cpp b/src/commands.cpp
index 6fb096d5c..51b9ae3a3 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -103,7 +103,7 @@ void handle_join(char **parameters, int pcnt, userrec *user)
{
chanrec* Ptr;
- if (Parser->LoopCall(handle_join,parameters,pcnt,user,0,0,1))
+ if (ServerInstance->Parser->LoopCall(handle_join,parameters,pcnt,user,0,0,1))
return;
if (parameters[0][0] == '#')
{
@@ -116,13 +116,13 @@ void handle_part(char **parameters, int pcnt, userrec *user)
{
if (pcnt > 1)
{
- if (Parser->LoopCall(handle_part,parameters,pcnt,user,0,pcnt-2,0))
+ if (ServerInstance->Parser->LoopCall(handle_part,parameters,pcnt,user,0,pcnt-2,0))
return;
del_channel(user,parameters[0],parameters[1],false);
}
else
{
- if (Parser->LoopCall(handle_part,parameters,pcnt,user,0,pcnt-1,0))
+ if (ServerInstance->Parser->LoopCall(handle_part,parameters,pcnt,user,0,pcnt-1,0))
return;
del_channel(user,parameters[0],NULL,false);
}
@@ -130,9 +130,9 @@ void handle_part(char **parameters, int pcnt, userrec *user)
void handle_commands(char **parameters, int pcnt, userrec *user)
{
- for (unsigned int i = 0; i < Parser->cmdlist.size(); i++)
+ for (unsigned int i = 0; i < ServerInstance->Parser->cmdlist.size(); i++)
{
- WriteServ(user->fd,"902 %s :%s %s %d",user->nick,Parser->cmdlist[i].command,Parser->cmdlist[i].source,Parser->cmdlist[i].min_params);
+ WriteServ(user->fd,"902 %s :%s %s %d",user->nick,ServerInstance->Parser->cmdlist[i].command,ServerInstance->Parser->cmdlist[i].source,ServerInstance->Parser->cmdlist[i].min_params);
}
WriteServ(user->fd,"903 %s :End of COMMANDS list",user->nick);
}
diff --git a/src/mode.cpp b/src/mode.cpp
index 570ac5ad7..d1fc5b93a 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -49,6 +49,7 @@ using namespace std;
extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
+extern InspIRCd* ServerInstance;
extern ServerConfig* Config;
extern time_t TIME;