- /** 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, FILE* &conf, 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 BufferedSocket class.
- * @parameter port Port number
- * @return Returns a pointer to the hooking module, or NULL
- */
- Module* GetIOHook(BufferedSocket* is);
-
- /** Hook a module to an BufferedSocket class, so that it can receive notifications
- * of low-level socket activity.
- * @param iomod The module to hook to the socket
- * @param is The BufferedSocket to attach to
- * @return True if the hook was successful.
- */
- bool AddIOHook(Module* iomod, BufferedSocket* is);
-
- /** Delete a module hook from an BufferedSocket.
- * @param is The BufferedSocket to detatch from.
- * @return True if the unhook was successful
- */
- bool DelIOHook(BufferedSocket* is);
-
- /** Returns the fully qualified path to the inspircd directory
- * @return The full program directory
- */
- std::string GetFullProgDir();
-
- /** Returns true if a directory is valid (within the modules directory).
- * @param dirandfile The directory and filename to check
- * @return True if the directory is valid
- */
- static bool DirValid(const char* dirandfile);