diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-03-25 02:52:43 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-03-25 02:52:43 +0000 |
commit | 0340f1a432d684347d8dbc3aa85c8436c56d4039 (patch) | |
tree | 0da4a282f28b42d5447ff2ee6f645c7936cf4383 /include | |
parent | 0825e274f6e047c3e948334b8fdbc0189dba3e32 (diff) |
Added a lot of config error checking
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@898 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/inspircd.h | 2 | ||||
-rw-r--r-- | include/inspircd_io.h | 2 | ||||
-rw-r--r-- | include/modules.h | 8 |
3 files changed, 10 insertions, 2 deletions
diff --git a/include/inspircd.h b/include/inspircd.h index d55ccccf4..1a19584f6 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -89,7 +89,7 @@ int InspIRCd(void); int InitConfig(void); void Error(int status); void send_error(char *s); -void ReadConfig(void); +void ReadConfig(bool bail,userrec* user); void strlower(char *n); void WriteOpers(char* text, ...); diff --git a/include/inspircd_io.h b/include/inspircd_io.h index 28e55bd0b..2ff7568c0 100644 --- a/include/inspircd_io.h +++ b/include/inspircd_io.h @@ -23,7 +23,7 @@ bool FileExists (const char* file); int OpenTCPSocket (void); int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr); -bool LoadConf(const char* filename, std::stringstream *target); +bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream); int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config); int ReadConf(std::stringstream *config_f,const char* tag, const char* var, int index, char *result); int ConfValueEnum(char* tag,std::stringstream *config); diff --git a/include/modules.h b/include/modules.h index dc17b99c0..81d76d55d 100644 --- a/include/modules.h +++ b/include/modules.h @@ -647,6 +647,7 @@ class ConfigReader : public classbase * (such as comments) stripped from it. */ std::stringstream *cache; + std::stringstream *errorlog; /** Used to store errors */ bool readerror; @@ -703,6 +704,13 @@ class ConfigReader : public classbase * file does not exist or could not be opened. */ bool Verify(); + /** Dumps the list of errors in a config file to an output location. If bail is true, + * then the program will abort. If bail is false and user points to a valid user + * record, the error report will be spooled to the given user by means of NOTICE. + * if bool is false AND user is false, the error report will be spooled to all opers + * by means of a NOTICE to all opers. + */ + void DumpErrors(bool bail,userrec* user); /** Returns the number of items within a tag. * For example if the tag was <test tag="blah" data="foo"> then this |