diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-07 13:22:17 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-07 13:22:17 +0000 |
commit | 6ec52cab73c5e77337ddd364617d8c4ad4065d80 (patch) | |
tree | 91ada68c6f7780a202133a4402b7e013af33e679 /include | |
parent | 3717c045aabf40d8280d1f8a7a0f33383ecafae4 (diff) |
Fixed config reader to cache its files instead of re-reading them for each access
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@413 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/inspircd_io.h | 11 | ||||
-rw-r--r-- | include/modules.h | 2 |
2 files changed, 9 insertions, 4 deletions
diff --git a/include/inspircd_io.h b/include/inspircd_io.h index 748aa53ba..09d5e5674 100644 --- a/include/inspircd_io.h +++ b/include/inspircd_io.h @@ -14,6 +14,8 @@ * --------------------------------------------------- */ +#include <sstream> + void Exit (int); void Start (void); int DaemonSeed (void); @@ -21,8 +23,9 @@ int FileExists (char* file); int OpenTCPSocket (void); int BindSocket (int sockfd, struct sockaddr_in client, struct sockaddr_in server, int port, char* addr); -int ConfValue(char* tag, char* var, int index, char *result); -int ReadConf(const char* filename,const char* tag, const char* var, int index, char *result); -int ConfValueEnum(char* tag); -int EnumConf(const char* filename,const char* tag); +void LoadConf(const char* filename, std::stringstream *target); +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); +int EnumConf(std::stringstream *config_f,const char* tag); diff --git a/include/modules.h b/include/modules.h index ed947b30a..3e2b8c5bb 100644 --- a/include/modules.h +++ b/include/modules.h @@ -23,6 +23,7 @@ #include "ctables.h" #include <string> #include <deque> +#include <sstream> /** Low level definition of a FileReader classes file cache area */ @@ -451,6 +452,7 @@ class ConfigReader : public classbase /** The filename of the configuration file, as set by the constructor. */ std::string fname; + std::stringstream *cache; public: /** Default constructor. * This constructor initialises the ConfigReader class to read the inspircd.conf file |