36#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
37#if defined(LIBCONFIG_STATIC)
39#elif defined(LIBCONFIG_EXPORTS)
40#define LIBCONFIG_API __declspec(dllexport)
42#define LIBCONFIG_API __declspec(dllimport)
48#define LIBCONFIG_VER_MAJOR 1
49#define LIBCONFIG_VER_MINOR 7
50#define LIBCONFIG_VER_REVISION 0
52#ifndef PARSE_C_HEADER_TO_META
56#define CONFIG_TYPE_NONE 0
57#define CONFIG_TYPE_GROUP 1
58#define CONFIG_TYPE_INT 2
59#define CONFIG_TYPE_INT64 3
60#define CONFIG_TYPE_FLOAT 4
61#define CONFIG_TYPE_STRING 5
62#define CONFIG_TYPE_BOOL 6
63#define CONFIG_TYPE_ARRAY 7
64#define CONFIG_TYPE_LIST 8
66#define CONFIG_FORMAT_DEFAULT 0
67#define CONFIG_FORMAT_HEX 1
69#define CONFIG_OPTION_AUTOCONVERT 0x01
70#define CONFIG_OPTION_SEMICOLON_SEPARATORS 0x02
71#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_GROUPS 0x04
72#define CONFIG_OPTION_COLON_ASSIGNMENT_FOR_NON_GROUPS 0x08
73#define CONFIG_OPTION_OPEN_BRACE_ON_SEPARATE_LINE 0x10
74#define CONFIG_OPTION_ALLOW_SCIENTIFIC_NOTATION 0x20
75#define CONFIG_OPTION_FSYNC 0x40
76#define CONFIG_OPTION_ALLOW_OVERRIDES 0x80
78#define CONFIG_TRUE (1)
79#define CONFIG_FALSE (0)
116typedef const char ** (*config_include_fn_t)(
struct config_t *,
155 const char *filename);
157 const char *filename);
160 void (*destructor)(
void *));
162 const char *include_dir);
167 unsigned short digits);
172 unsigned short width);
178#define config_get_hook(C) ((C)->hook)
245 config_t *config,
const char *include_dir,
const char *path,
254#ifndef PARSE_C_HEADER_TO_META
256#define config_get_include_dir( C) \
259#define config_set_auto_convert( C, F) \
260 config_set_option((C), CONFIG_OPTION_AUTOCONVERT, (F))
261#define config_get_auto_convert( C) \
262 config_get_option((C), CONFIG_OPTION_AUTOCONVERT)
264#define config_setting_type( S) \
267#define config_setting_is_group( S) \
268 ((S)->type == CONFIG_TYPE_GROUP)
269#define config_setting_is_array( S) \
270 ((S)->type == CONFIG_TYPE_ARRAY)
271#define config_setting_is_list( S) \
272 ((S)->type == CONFIG_TYPE_LIST)
274#define config_setting_is_number( S) \
275 (((S)->type == CONFIG_TYPE_INT) \
276 || ((S)->type == CONFIG_TYPE_INT64) \
277 || ((S)->type == CONFIG_TYPE_FLOAT))
279#define config_setting_name( \
283#define config_setting_parent( \
287#define config_setting_is_root( \
289 ((S)->parent ? CONFIG_FALSE : CONFIG_TRUE)
311#ifndef PARSE_C_HEADER_TO_META
312# define config_setting_get_hook(S) ((S)->hook)
321 const char *path,
int *value);
326 const char *path,
double *value);
328 const char *path,
int *value);
333#ifndef PARSE_C_HEADER_TO_META
335#define config_root_setting( \
339#define config_set_default_format( C, \
341 (C)->default_format = (F)
343#define config_get_default_format( C) \
344 ((C)->default_format)
346#define config_setting_source_line( \
350#define config_setting_source_file( \
354#define config_error_text( C) \
357#define config_error_file( C) \
360#define config_error_line( C) \
363#define config_error_type( C) \
LIBCONFIG_API int config_setting_get_bool(const config_setting_t *setting)
LIBCONFIG_API int config_read_file(config_t *config, const char *filename)
LIBCONFIG_API void config_set_float_precision(config_t *config, unsigned short digits)
LIBCONFIG_API config_setting_t * config_lookup(const config_t *config, const char *path)
LIBCONFIG_API int config_setting_set_int(config_setting_t *setting, int value)
LIBCONFIG_API config_setting_t * config_setting_set_string_elem(config_setting_t *setting, int idx, const char *value)
LIBCONFIG_API void config_set_include_dir(config_t *config, const char *include_dir)
LIBCONFIG_API int config_setting_lookup_int64(const config_setting_t *setting, const char *name, long long *value)
LIBCONFIG_API int config_setting_remove_elem(config_setting_t *parent, unsigned int idx)
LIBCONFIG_API unsigned short config_get_tab_width(const config_t *config)
LIBCONFIG_API config_setting_t * config_setting_set_float_elem(config_setting_t *setting, int idx, double value)
LIBCONFIG_API const char * config_setting_get_string_elem(const config_setting_t *setting, int idx)
LIBCONFIG_API config_setting_t * config_setting_get_member(const config_setting_t *setting, const char *name)
LIBCONFIG_API int config_setting_lookup_int(const config_setting_t *setting, const char *name, int *value)
LIBCONFIG_API config_setting_t * config_setting_add(config_setting_t *parent, const char *name, int __type)
LIBCONFIG_API const char * config_setting_get_string(const config_setting_t *setting)
LIBCONFIG_API const char ** config_default_include_func(config_t *config, const char *include_dir, const char *path, const char **error)
LIBCONFIG_API int config_setting_index(const config_setting_t *setting)
LIBCONFIG_API config_setting_t * config_setting_lookup(config_setting_t *setting, const char *path)
LIBCONFIG_API int config_setting_set_float(config_setting_t *setting, double value)
LIBCONFIG_API int config_setting_set_int64(config_setting_t *setting, long long value)
LIBCONFIG_API void config_set_include_func(config_t *config, config_include_fn_t func)
union config_value_t config_value_t
LIBCONFIG_API double config_setting_get_float(const config_setting_t *setting)
LIBCONFIG_API void config_set_tab_width(config_t *config, unsigned short width)
LIBCONFIG_API int config_setting_set_string(config_setting_t *setting, const char *value)
LIBCONFIG_API config_setting_t * config_setting_get_elem(const config_setting_t *setting, unsigned int idx)
LIBCONFIG_API int config_setting_set_format(config_setting_t *setting, short format)
LIBCONFIG_API void config_set_options(config_t *config, int options)
LIBCONFIG_API void config_setting_set_hook(config_setting_t *setting, void *hook)
LIBCONFIG_API int config_setting_lookup_string(const config_setting_t *setting, const char *name, const char **value)
LIBCONFIG_API int config_lookup_string(const config_t *config, const char *path, const char **value)
struct config_setting_t config_setting_t
const char **(* config_include_fn_t)(struct config_t *, const char *, const char *, const char **)
LIBCONFIG_API int config_setting_lookup_float(const config_setting_t *setting, const char *name, double *value)
LIBCONFIG_API void config_destroy(config_t *config)
#define config_set_default_format(C, F)
LIBCONFIG_API unsigned short config_get_float_precision(const config_t *config)
LIBCONFIG_API int config_lookup_bool(const config_t *config, const char *path, int *value)
LIBCONFIG_API int config_lookup_float(const config_t *config, const char *path, double *value)
LIBCONFIG_API short config_setting_get_format(const config_setting_t *setting)
LIBCONFIG_API int config_lookup_int(const config_t *config, const char *path, int *value)
LIBCONFIG_API void config_init(config_t *config)
struct config_list_t config_list_t
LIBCONFIG_API int config_setting_remove(config_setting_t *parent, const char *name)
LIBCONFIG_API int config_setting_get_bool_elem(const config_setting_t *setting, int idx)
LIBCONFIG_API int config_get_options(const config_t *config)
LIBCONFIG_API void config_set_hook(config_t *config, void *hook)
LIBCONFIG_API int config_setting_get_int(const config_setting_t *setting)
LIBCONFIG_API int config_setting_length(const config_setting_t *setting)
LIBCONFIG_API int config_setting_set_bool(config_setting_t *setting, int value)
LIBCONFIG_API int config_setting_lookup_bool(const config_setting_t *setting, const char *name, int *value)
LIBCONFIG_API void config_set_option(config_t *config, int option, int flag)
LIBCONFIG_API config_setting_t * config_setting_set_int_elem(config_setting_t *setting, int idx, int value)
LIBCONFIG_API int config_write_file(config_t *config, const char *filename)
LIBCONFIG_API int config_get_option(const config_t *config, int option)
LIBCONFIG_API int config_setting_is_scalar(const config_setting_t *setting)
LIBCONFIG_API double config_setting_get_float_elem(const config_setting_t *setting, int idx)
LIBCONFIG_API int config_lookup_int64(const config_t *config, const char *path, long long *value)
LIBCONFIG_API config_setting_t * config_setting_set_bool_elem(config_setting_t *setting, int idx, int value)
LIBCONFIG_API int config_setting_get_int_elem(const config_setting_t *setting, int idx)
LIBCONFIG_API void config_clear(config_t *config)
LIBCONFIG_API int config_read(config_t *config, FILE *stream)
LIBCONFIG_API long long config_setting_get_int64_elem(const config_setting_t *setting, int idx)
LIBCONFIG_API void config_write(const config_t *config, FILE *stream)
LIBCONFIG_API config_setting_t * config_setting_set_int64_elem(config_setting_t *setting, int idx, long long value)
LIBCONFIG_API void config_set_destructor(config_t *config, void(*destructor)(void *))
LIBCONFIG_API int config_setting_is_aggregate(const config_setting_t *setting)
LIBCONFIG_API int config_read_string(config_t *config, const char *str)
LIBCONFIG_API long long config_setting_get_int64(const config_setting_t *setting)
config_setting_t ** elements
struct config_setting_t * parent
config_include_fn_t include_fn
config_error_t error_type
unsigned short float_precision
void(* destructor)(void *)
unsigned short default_format
struct config_list_t * list