X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fconfigreader.h;h=3120d3d59b69fb5267b9f3fc7eb5ef7a90b8ce50;hb=c84ad4cc16452b86bb444a22a55203afa4fa5454;hp=e74895e8bd1315d555f68a3e7c2353c373f3e70a;hpb=bfaf7e3b27981a5144faba6d17c6e29fac735dbb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/configreader.h b/include/configreader.h index e74895e8b..3120d3d59 100644 --- a/include/configreader.h +++ b/include/configreader.h @@ -49,7 +49,8 @@ enum ConfigDataType DT_IPADDRESS = 6, /* IP address (v4, v6) */ DT_CHANNEL = 7, /* Channel name */ DT_ALLOW_WILD = 64, /* Allow wildcards/CIDR in DT_IPADDRESS */ - DT_ALLOW_NEWLINE = 128 /* New line characters allowed in DT_CHARPTR */ + DT_ALLOW_NEWLINE = 128, /* New line characters allowed in DT_CHARPTR */ + DT_BOOTONLY = 256 /* Can only be set on startup, not on rehash */ }; /** Holds a config value, either string, integer or boolean. @@ -172,7 +173,7 @@ struct InitialConfig /** Value containers */ ValueContainerBase* val; /** Data types */ - ConfigDataType datatype; + int datatype; /** Validation function */ Validator validation_function; }; @@ -230,11 +231,7 @@ class CoreExport ServerConfig : public Extensible * configutation, appending errors to errorstream * and setting error if an error has occured. */ - bool ParseLine(ConfigDataHash &target, std::string &line, long &linenumber, std::ostringstream &errorstream, int pass, std::istream* scan_for_includes_only); - - /** Process an include directive - */ - bool DoInclude(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream, int pass, std::istream* scan_for_includes_only); + bool ParseLine(ConfigDataHash &target, std::string &line, long &linenumber, std::ostringstream &errorstream); /** Check that there is only one of each configuration item */ @@ -242,6 +239,18 @@ class CoreExport ServerConfig : public Extensible public: + /** Process an include executable directive + */ + bool DoPipe(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream); + + /** Process an include file directive + */ + bool DoInclude(ConfigDataHash &target, const std::string &file, std::ostringstream &errorstream); + + User* RehashUser; + + std::string RehashParameter; + std::ostringstream errstr; ConfigDataHash newconfig; @@ -261,7 +270,7 @@ class CoreExport ServerConfig : public Extensible InspIRCd* GetInstance(); - void DoDownloads(); + int DoDownloads(); /** This holds all the information in the config file, * it's indexed by tag name to a vector of key/values. @@ -629,6 +638,11 @@ class CoreExport ServerConfig : public Extensible */ char sid[MAXBUF]; + /** True if we have been told to run the testsuite from the commandline, + * rather than entering the mainloop. + */ + bool TestSuite; + /** Construct a new ServerConfig */ ServerConfig(InspIRCd* Instance); @@ -653,7 +667,7 @@ class CoreExport ServerConfig : public Extensible * and initialize this class. All other methods * should be used only by the core. */ - void Read(bool bail, User* user, int pass); + void Read(bool bail, User* user); /** Read a file into a file_cache object */ @@ -670,12 +684,12 @@ class CoreExport ServerConfig : public Extensible /** Load 'filename' into 'target', with the new config parser everything is parsed into * tag/key/value at load-time rather than at read-value time. */ - bool LoadConf(ConfigDataHash &target, const char* filename, std::ostringstream &errorstream, int pass, std::istream* scan_for_includs_only); + bool LoadConf(ConfigDataHash &target, FILE* &conf, const char* filename, std::ostringstream &errorstream); /** Load 'filename' into 'target', with the new config parser everything is parsed into * tag/key/value at load-time rather than at read-value time. */ - bool LoadConf(ConfigDataHash &target, const std::string &filename, std::ostringstream &errorstream, int pass, std::istream* scan_for_includs_only = NULL); + bool LoadConf(ConfigDataHash &target, FILE* &conf, const std::string &filename, std::ostringstream &errorstream); /* Both these return true if the value existed or false otherwise */