summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-14 14:32:04 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-14 14:32:04 +0000
commite0e8b0df5a8fe0070d198c46991bfd371548f00c (patch)
tree0cae269fc2f8af2894a0fca36c282d1170adc843
parent70141d07c0e815b2c3794917738b3b740ccd42ea (diff)
More config tidyups
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2413 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/inspircd_io.h3
-rw-r--r--src/inspircd_io.cpp2
-rw-r--r--src/userprocess.cpp4
-rw-r--r--src/xline.cpp24
4 files changed, 17 insertions, 16 deletions
diff --git a/include/inspircd_io.h b/include/inspircd_io.h
index eea14d6c0..70d381b9f 100644
--- a/include/inspircd_io.h
+++ b/include/inspircd_io.h
@@ -35,7 +35,8 @@ class ServerConfig
{
private:
std::vector<std::string> include_stack;
- fgets_safe(char* buffer, size_t maxsize, FILE* &file);
+ int fgets_safe(char* buffer, size_t maxsize, FILE* &file);
+ std::string ConfProcess(char* buffer, long linenumber, std::stringstream* errorstream, bool &error, std::string filename);
public:
char ServerName[MAXBUF];
diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp
index 8b4697b1f..c435de383 100644
--- a/src/inspircd_io.cpp
+++ b/src/inspircd_io.cpp
@@ -670,7 +670,7 @@ bool ServerConfig::LoadConf(const char* filename, std::stringstream *target, std
else
{
bool error = false;
- std::string data = ConfProcess(buffer,linenumber++,errorstream,error,filename);
+ std::string data = this->ConfProcess(buffer,linenumber++,errorstream,error,filename);
if (error)
{
return false;
diff --git a/src/userprocess.cpp b/src/userprocess.cpp
index 338d7a1fd..30a601a7a 100644
--- a/src/userprocess.cpp
+++ b/src/userprocess.cpp
@@ -375,9 +375,9 @@ void LoadAllModules()
/* We must load the modules AFTER initializing the socket engine, now */
MODCOUNT = -1;
char configToken[MAXBUF];
- for (int count = 0; count < ConfValueEnum("module",&Config->config_f); count++)
+ for (int count = 0; count < Config->ConfValueEnum("module",&Config->config_f); count++)
{
- ConfValue("module","name",count,configToken,&Config->config_f);
+ Config->ConfValue("module","name",count,configToken,&Config->config_f);
printf("Loading module... \033[1;32m%s\033[0m\n",configToken);
if (!LoadModule(configToken))
{
diff --git a/src/xline.cpp b/src/xline.cpp
index d08383f8c..415ed9ed2 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -113,33 +113,33 @@ void read_xline_defaults()
char host[MAXBUF];
char reason[MAXBUF];
- for (int i = 0; i < ConfValueEnum("badip",&Config->config_f); i++)
+ for (int i = 0; i < Config->ConfValueEnum("badip",&Config->config_f); i++)
{
- ConfValue("badip","ipmask",i,ipmask,&Config->config_f);
- ConfValue("badip","reason",i,reason,&Config->config_f);
+ Config->ConfValue("badip","ipmask",i,ipmask,&Config->config_f);
+ Config->ConfValue("badip","reason",i,reason,&Config->config_f);
add_zline(0,"<Config>",reason,ipmask);
log(DEBUG,"Read Z line (badip tag): ipmask=%s reason=%s",ipmask,reason);
}
- for (int i = 0; i < ConfValueEnum("badnick",&Config->config_f); i++)
+ for (int i = 0; i < Config->ConfValueEnum("badnick",&Config->config_f); i++)
{
- ConfValue("badnick","nick",i,nick,&Config->config_f);
- ConfValue("badnick","reason",i,reason,&Config->config_f);
+ Config->ConfValue("badnick","nick",i,nick,&Config->config_f);
+ Config->ConfValue("badnick","reason",i,reason,&Config->config_f);
add_qline(0,"<Config>",reason,nick);
log(DEBUG,"Read Q line (badnick tag): nick=%s reason=%s",nick,reason);
}
- for (int i = 0; i < ConfValueEnum("badhost",&Config->config_f); i++)
+ for (int i = 0; i < Config->ConfValueEnum("badhost",&Config->config_f); i++)
{
- ConfValue("badhost","host",i,host,&Config->config_f);
- ConfValue("badhost","reason",i,reason,&Config->config_f);
+ Config->ConfValue("badhost","host",i,host,&Config->config_f);
+ Config->ConfValue("badhost","reason",i,reason,&Config->config_f);
add_kline(0,"<Config>",reason,host);
log(DEBUG,"Read K line (badhost tag): host=%s reason=%s",host,reason);
}
- for (int i = 0; i < ConfValueEnum("exception",&Config->config_f); i++)
+ for (int i = 0; i < Config->ConfValueEnum("exception",&Config->config_f); i++)
{
- ConfValue("exception","host",i,host,&Config->config_f);
- ConfValue("exception","reason",i,reason,&Config->config_f);
+ Config->ConfValue("exception","host",i,host,&Config->config_f);
+ Config->ConfValue("exception","reason",i,reason,&Config->config_f);
add_eline(0,"<Config>",reason,host);
log(DEBUG,"Read E line (exception tag): host=%s reason=%s",host,reason);
}