summaryrefslogtreecommitdiff
path: root/src/common/conf.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-09-06 18:01:28 +0200
committerHaru <haru@dotalux.com>2016-02-17 10:40:42 +0100
commit842964ee2114cd2c54bbbdf51b2c294390fd03ba (patch)
tree53dbf02c5c7df78e054227973a6b8e168dc6046b /src/common/conf.h
parent0b491e07714f7c9d81a5618756c7b663c8cfcf5d (diff)
downloadhercules-842964ee2114cd2c54bbbdf51b2c294390fd03ba.tar.gz
hercules-842964ee2114cd2c54bbbdf51b2c294390fd03ba.tar.bz2
hercules-842964ee2114cd2c54bbbdf51b2c294390fd03ba.tar.xz
hercules-842964ee2114cd2c54bbbdf51b2c294390fd03ba.zip
Added new set of functions to libconfig in order to handle other data types
- New data types supported: - uint16 - int16 - uint32 - bool - mutable string - Documented conf_read_file Ported to modern Hercules and cleaned up from Panikon's commits fa09661f1bdbe41060fa97f5e63810523feadcc0, cbb3e3b6ad987eeeaac0c75236feabfd2206cf07, cd79c70101638cff476c40d31e2b7cd031915284, 126f9b2dc1ab5af223ef37be6000346fe18a0a96, b9bf380edc30dab038abef41568081037a75ffb5. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/common/conf.h')
-rw-r--r--src/common/conf.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/conf.h b/src/common/conf.h
index 19aa73c2d..8bec2704f 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -105,6 +105,18 @@ struct libconfig_interface {
void (*setting_copy_elem) (config_setting_t *parent, const config_setting_t *src);
void (*setting_copy_aggregate) (config_setting_t *parent, const config_setting_t *src);
int (*setting_copy) (config_setting_t *parent, const config_setting_t *src);
+ /* Functions to get other types */
+ bool (*setting_get_bool_real) (const config_setting_t *setting);
+ uint32 (*setting_get_uint32) (const config_setting_t *setting);
+ uint16 (*setting_get_uint16) (const config_setting_t *setting);
+ int16 (*setting_get_int16) (const config_setting_t *setting);
+
+ int (*setting_lookup_bool_real) (const config_setting_t *setting, const char *name, bool *value);
+ int (*setting_lookup_uint32) (const config_setting_t *setting, const char *name, uint32 *value);
+ int (*setting_lookup_uint16) (const config_setting_t *setting, const char *name, uint16 *value);
+ int (*setting_lookup_int16) (const config_setting_t *setting, const char *name, int16 *value);
+ int (*setting_lookup_mutable_string) (const config_setting_t *setting, const char *name, char *out, size_t out_size);
+ int (*lookup_mutable_string) (const config_t *config, const char *name, char *out, size_t out_size);
};
#ifdef HERCULES_CORE