- void Read(bool bail, User* user);
-
- /** Read a file into a file_cache object
- */
- bool ReadFile(file_cache &F, const char* fname);
-
- /** Report a configuration error given in errormessage.
- * @param bail If this is set to true, the error is sent to the console, and the program exits
- * @param user If this is set to a non-null value, and bail is false, the errors are spooled to
- * this user as SNOTICEs.
- * If the parameter is NULL, the messages are spooled to all opers.
- */
- void ReportConfigError(const std::string &errormessage, bool bail, User* user);
-
- /** 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);
-
- /** 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);
-
- /* Both these return true if the value existed or false otherwise */
-
- /** Writes 'length' chars into 'result' as a string
- */
- bool ConfValue(ConfigDataHash &target, const char* tag, const char* var, int index, char* result, int length, bool allow_linefeeds = false);
- /** Writes 'length' chars into 'result' as a string
- */
- bool ConfValue(ConfigDataHash &target, const char* tag, const char* var, const char* default_value, int index, char* result, int length, bool allow_linefeeds = false);
-
- /** Writes 'length' chars into 'result' as a string
- */
- bool ConfValue(ConfigDataHash &target, const std::string &tag, const std::string &var, int index, std::string &result, bool allow_linefeeds = false);
- /** Writes 'length' chars into 'result' as a string
- */
- bool ConfValue(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index, std::string &result, bool allow_linefeeds = false);
-
- /** Tries to convert the value to an integer and write it to 'result'
- */
- bool ConfValueInteger(ConfigDataHash &target, const char* tag, const char* var, int index, int &result);
- /** Tries to convert the value to an integer and write it to 'result'
- */
- bool ConfValueInteger(ConfigDataHash &target, const char* tag, const char* var, const char* default_value, int index, int &result);
- /** Tries to convert the value to an integer and write it to 'result'
- */
- bool ConfValueInteger(ConfigDataHash &target, const std::string &tag, const std::string &var, int index, int &result);
- /** Tries to convert the value to an integer and write it to 'result'
- */
- bool ConfValueInteger(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index, int &result);
-
- /** Returns true if the value exists and has a true value, false otherwise
- */
- bool ConfValueBool(ConfigDataHash &target, const char* tag, const char* var, int index);
- /** Returns true if the value exists and has a true value, false otherwise
- */
- bool ConfValueBool(ConfigDataHash &target, const char* tag, const char* var, const char* default_value, int index);
- /** Returns true if the value exists and has a true value, false otherwise
- */
- bool ConfValueBool(ConfigDataHash &target, const std::string &tag, const std::string &var, int index);
- /** Returns true if the value exists and has a true value, false otherwise
- */
- bool ConfValueBool(ConfigDataHash &target, const std::string &tag, const std::string &var, const std::string &default_value, int index);
-
- /** Returns the number of occurences of tag in the config file
- */
- int ConfValueEnum(ConfigDataHash &target, const char* tag);
- /** Returns the number of occurences of tag in the config file
- */
- int ConfValueEnum(ConfigDataHash &target, const std::string &tag);
-
- /** Returns the numbers of vars inside the index'th 'tag in the config file
- */
- int ConfVarEnum(ConfigDataHash &target, const char* tag, int index);
- /** Returns the numbers of vars inside the index'th 'tag in the config file
- */
- int ConfVarEnum(ConfigDataHash &target, const std::string &tag, int index);
-
- void ValidateHostname(const char* p, const std::string &tag, const std::string &val);
-
- void ValidateIP(const char* p, const std::string &tag, const std::string &val, bool wild);
-
- void ValidateNoSpaces(const char* p, const std::string &tag, const std::string &val);
-
- /** Get a pointer to the module which has hooked the given port.
- * @parameter port Port number
- * @return Returns a pointer to the hooking module, or NULL
- */
- Module* GetIOHook(int port);