]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/inspircd_io.h
Align names that are output on startup using \t htabs
[user/henk/code/inspircd.git] / include / inspircd_io.h
index d1356954c7162fb9c023042338d6a49d7046293d..89b6300dea563b27b985cb7a52e899140496beb4 100644 (file)
 #define SPARSE 40
 #define NONE 50
 
+typedef bool (*Validator)(const char*, const char*, void*);
+
+enum ConfigDataType { DT_NOTHING, DT_INTEGER, DT_CHARPTR, DT_BOOLEAN };
+
+struct InitialConfig {
+       char* tag;
+       char* value;
+       void* val;
+       int datatype;
+       Validator validation_function;
+};
+
 /** This class holds the bulk of the runtime configuration for the ircd.
  * It allows for reading new config values, accessing configuration files,
  * and storage of the configuration data needed to run the ircd, such as
@@ -331,6 +343,7 @@ class ServerConfig : public classbase
 
        bool LoadConf(const char* filename, std::stringstream *target, std::stringstream* errorstream);
        int ConfValue(char* tag, char* var, int index, char *result, std::stringstream *config);
+       int ConfValueInteger(char* tag, char* var, int index, 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);