X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fconfigreader.h;h=3120d3d59b69fb5267b9f3fc7eb5ef7a90b8ce50;hb=c84ad4cc16452b86bb444a22a55203afa4fa5454;hp=d8fa3b418075c7d2977167aa958a18074998e582;hpb=2dca25b85b6e25e28fe8f1bdc705fda77c6c28e4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/configreader.h b/include/configreader.h index d8fa3b418..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; @@ -658,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 */ @@ -675,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 */