omegalib  13.1
libconfig.h File Reference
#include <stdio.h>

Classes

union  config_value_t
 
struct  config_setting_t
 
struct  config_list_t
 
struct  config_t
 

Macros

#define LIBCONFIG_API
 
#define LIBCONFIG_VER_MAJOR   1
 
#define LIBCONFIG_VER_MINOR   4
 
#define LIBCONFIG_VER_REVISION   3
 
#define CONFIG_TYPE_NONE   0
 
#define CONFIG_TYPE_GROUP   1
 
#define CONFIG_TYPE_INT   2
 
#define CONFIG_TYPE_INT64   3
 
#define CONFIG_TYPE_FLOAT   4
 
#define CONFIG_TYPE_STRING   5
 
#define CONFIG_TYPE_BOOL   6
 
#define CONFIG_TYPE_ARRAY   7
 
#define CONFIG_TYPE_LIST   8
 
#define CONFIG_FORMAT_DEFAULT   0
 
#define CONFIG_FORMAT_HEX   1
 
#define CONFIG_OPTION_AUTOCONVERT   0x01
 
#define CONFIG_TRUE   (1)
 
#define CONFIG_FALSE   (0)
 
#define config_setting_type(S)   ((S)->type)
 
#define config_setting_is_group(S)   ((S)->type == CONFIG_TYPE_GROUP)
 
#define config_setting_is_array(S)   ((S)->type == CONFIG_TYPE_ARRAY)
 
#define config_setting_is_list(S)   ((S)->type == CONFIG_TYPE_LIST)
 
#define config_setting_is_aggregate(S)
 
#define config_setting_is_number(S)
 
#define config_setting_is_scalar(S)
 
#define config_setting_name(S)   ((S)->name)
 
#define config_setting_parent(S)   ((S)->parent)
 
#define config_setting_is_root(S)   ((S)->parent ? CONFIG_FALSE : CONFIG_TRUE)
 
#define config_setting_get_hook(S)   ((S)->hook)
 
#define config_root_setting(C)   ((C)->root)
 
#define config_set_tab_width(C, W)   (C)->tab_width = ((W) & 0x0F)
 
#define config_get_tab_width(C)   ((C)->tab_width)
 
#define config_setting_source_line(S)   ((S)->line)
 
#define config_setting_source_file(S)   ((S)->file)
 
#define config_error_text(C)   ((C)->error_text)
 
#define config_error_file(C)   ((C)->error_file)
 
#define config_error_line(C)   ((C)->error_line)
 
#define config_error_type(C)   ((C)->error_type)
 

Enumerations

enum  config_error_t { CONFIG_ERR_NONE = 0, CONFIG_ERR_FILE_IO = 1, CONFIG_ERR_PARSE = 2 }
 

Functions

LIBCONFIG_API int config_read (config_t *config, FILE *stream)
 
LIBCONFIG_API void config_write (const config_t *config, FILE *stream)
 
LIBCONFIG_API void config_set_auto_convert (config_t *config, int flag)
 
LIBCONFIG_API int config_get_auto_convert (const config_t *config)
 
LIBCONFIG_API int config_read_string (config_t *config, const char *str)
 
LIBCONFIG_API int config_read_file (config_t *config, const char *filename)
 
LIBCONFIG_API int config_write_file (config_t *config, const char *filename)
 
LIBCONFIG_API void config_set_destructor (config_t *config, void(*destructor)(void *))
 
LIBCONFIG_API void config_init (config_t *config)
 
LIBCONFIG_API void config_destroy (config_t *config)
 
LIBCONFIG_API int config_setting_get_int (const config_setting_t *setting)
 
LIBCONFIG_API long long config_setting_get_int64 (const config_setting_t *setting)
 
LIBCONFIG_API double config_setting_get_float (const config_setting_t *setting)
 
LIBCONFIG_API int config_setting_get_bool (const config_setting_t *setting)
 
LIBCONFIG_API const char * config_setting_get_string (const config_setting_t *setting)
 
LIBCONFIG_API int config_setting_lookup_int (const config_setting_t *setting, const char *name, int *value)
 
LIBCONFIG_API int config_setting_lookup_int64 (const config_setting_t *setting, const char *name, long long *value)
 
LIBCONFIG_API int config_setting_lookup_float (const config_setting_t *setting, const char *name, double *value)
 
LIBCONFIG_API int config_setting_lookup_bool (const config_setting_t *setting, const char *name, int *value)
 
LIBCONFIG_API int config_setting_lookup_string (const config_setting_t *setting, const char *name, const char **value)
 
LIBCONFIG_API int config_setting_set_int (config_setting_t *setting, int value)
 
LIBCONFIG_API int config_setting_set_int64 (config_setting_t *setting, long long value)
 
LIBCONFIG_API int config_setting_set_float (config_setting_t *setting, double value)
 
LIBCONFIG_API int config_setting_set_bool (config_setting_t *setting, int value)
 
LIBCONFIG_API int config_setting_set_string (config_setting_t *setting, const char *value)
 
LIBCONFIG_API int config_setting_set_format (config_setting_t *setting, short format)
 
LIBCONFIG_API short config_setting_get_format (config_setting_t *setting)
 
LIBCONFIG_API int config_setting_get_int_elem (const config_setting_t *setting, int idx)
 
LIBCONFIG_API long long config_setting_get_int64_elem (const config_setting_t *setting, int idx)
 
LIBCONFIG_API double config_setting_get_float_elem (const config_setting_t *setting, int idx)
 
LIBCONFIG_API int config_setting_get_bool_elem (const config_setting_t *setting, int idx)
 
LIBCONFIG_API const char * config_setting_get_string_elem (const config_setting_t *setting, int idx)
 
LIBCONFIG_API config_setting_tconfig_setting_set_int_elem (config_setting_t *setting, int idx, int value)
 
LIBCONFIG_API config_setting_tconfig_setting_set_int64_elem (config_setting_t *setting, int idx, long long value)
 
LIBCONFIG_API config_setting_tconfig_setting_set_float_elem (config_setting_t *setting, int idx, double value)
 
LIBCONFIG_API config_setting_tconfig_setting_set_bool_elem (config_setting_t *setting, int idx, int value)
 
LIBCONFIG_API config_setting_tconfig_setting_set_string_elem (config_setting_t *setting, int idx, const char *value)
 
LIBCONFIG_API int config_setting_index (const config_setting_t *setting)
 
LIBCONFIG_API int config_setting_length (const config_setting_t *setting)
 
LIBCONFIG_API config_setting_tconfig_setting_get_elem (const config_setting_t *setting, unsigned int idx)
 
LIBCONFIG_API config_setting_tconfig_setting_get_member (const config_setting_t *setting, const char *name)
 
LIBCONFIG_API config_setting_tconfig_setting_add (config_setting_t *parent, const char *name, int type)
 
LIBCONFIG_API int config_setting_remove (config_setting_t *parent, const char *name)
 
LIBCONFIG_API int config_setting_remove_elem (config_setting_t *parent, unsigned int idx)
 
LIBCONFIG_API void config_setting_set_hook (config_setting_t *setting, void *hook)
 
LIBCONFIG_API config_setting_tconfig_lookup (const config_t *config, const char *path)
 
LIBCONFIG_API config_setting_tconfig_lookup_from (config_setting_t *setting, const char *path)
 
LIBCONFIG_API int config_lookup_int (const config_t *config, const char *path, int *value)
 
LIBCONFIG_API int config_lookup_int64 (const config_t *config, const char *path, long long *value)
 
LIBCONFIG_API int config_lookup_float (const config_t *config, const char *path, double *value)
 
LIBCONFIG_API int config_lookup_bool (const config_t *config, const char *path, int *value)
 
LIBCONFIG_API int config_lookup_string (const config_t *config, const char *path, const char **value)
 

Macro Definition Documentation

#define config_error_file (   C)    ((C)->error_file)
#define config_error_line (   C)    ((C)->error_line)
#define config_error_text (   C)    ((C)->error_text)
#define config_error_type (   C)    ((C)->error_type)
#define CONFIG_FALSE   (0)
#define CONFIG_FORMAT_DEFAULT   0
#define CONFIG_FORMAT_HEX   1
#define config_get_tab_width (   C)    ((C)->tab_width)
#define CONFIG_OPTION_AUTOCONVERT   0x01
#define config_root_setting (   C)    ((C)->root)
#define config_set_tab_width (   C,
 
)    (C)->tab_width = ((W) & 0x0F)
#define config_setting_get_hook (   S)    ((S)->hook)
#define config_setting_is_aggregate (   S)
Value:
(((S)->type == CONFIG_TYPE_GROUP) || ((S)->type == CONFIG_TYPE_LIST) \
|| ((S)->type == CONFIG_TYPE_ARRAY))
#define CONFIG_TYPE_ARRAY
Definition: libconfig.h:55
#define CONFIG_TYPE_LIST
Definition: libconfig.h:56
#define CONFIG_TYPE_GROUP
Definition: libconfig.h:49
#define config_setting_is_array (   S)    ((S)->type == CONFIG_TYPE_ARRAY)
#define config_setting_is_group (   S)    ((S)->type == CONFIG_TYPE_GROUP)
#define config_setting_is_list (   S)    ((S)->type == CONFIG_TYPE_LIST)
#define config_setting_is_number (   S)
Value:
(((S)->type == CONFIG_TYPE_INT) \
|| ((S)->type == CONFIG_TYPE_INT64) \
|| ((S)->type == CONFIG_TYPE_FLOAT))
#define CONFIG_TYPE_FLOAT
Definition: libconfig.h:52
#define CONFIG_TYPE_INT64
Definition: libconfig.h:51
#define CONFIG_TYPE_INT
Definition: libconfig.h:50
#define config_setting_is_root (   S)    ((S)->parent ? CONFIG_FALSE : CONFIG_TRUE)
#define config_setting_is_scalar (   S)
Value:
(((S)->type == CONFIG_TYPE_BOOL) || ((S)->type == CONFIG_TYPE_STRING) \
#define config_setting_is_number(S)
Definition: libconfig.h:208
#define CONFIG_TYPE_STRING
Definition: libconfig.h:53
#define CONFIG_TYPE_BOOL
Definition: libconfig.h:54
#define config_setting_name (   S)    ((S)->name)
#define config_setting_parent (   S)    ((S)->parent)
#define config_setting_source_file (   S)    ((S)->file)
#define config_setting_source_line (   S)    ((S)->line)
#define config_setting_type (   S)    ((S)->type)
#define CONFIG_TRUE   (1)
#define CONFIG_TYPE_ARRAY   7
#define CONFIG_TYPE_BOOL   6
#define CONFIG_TYPE_FLOAT   4
#define CONFIG_TYPE_GROUP   1
#define CONFIG_TYPE_INT   2
#define CONFIG_TYPE_INT64   3
#define CONFIG_TYPE_LIST   8
#define CONFIG_TYPE_NONE   0
#define CONFIG_TYPE_STRING   5
#define LIBCONFIG_API
#define LIBCONFIG_VER_MAJOR   1
#define LIBCONFIG_VER_MINOR   4
#define LIBCONFIG_VER_REVISION   3

Enumeration Type Documentation

Enumerator
CONFIG_ERR_NONE 
CONFIG_ERR_FILE_IO 
CONFIG_ERR_PARSE 

Function Documentation

LIBCONFIG_API void config_destroy ( config_t config)
LIBCONFIG_API int config_get_auto_convert ( const config_t config)
LIBCONFIG_API void config_init ( config_t config)
LIBCONFIG_API config_setting_t* config_lookup ( const config_t config,
const char *  path 
)
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 config_setting_t* config_lookup_from ( config_setting_t setting,
const char *  path 
)
LIBCONFIG_API int config_lookup_int ( const config_t config,
const char *  path,
int *  value 
)
LIBCONFIG_API int config_lookup_int64 ( const config_t config,
const char *  path,
long long *  value 
)
LIBCONFIG_API int config_lookup_string ( const config_t config,
const char *  path,
const char **  value 
)
LIBCONFIG_API int config_read ( config_t config,
FILE *  stream 
)
LIBCONFIG_API int config_read_file ( config_t config,
const char *  filename 
)
LIBCONFIG_API int config_read_string ( config_t config,
const char *  str 
)
LIBCONFIG_API void config_set_auto_convert ( config_t config,
int  flag 
)
LIBCONFIG_API void config_set_destructor ( config_t config,
void(*)(void *)  destructor 
)
LIBCONFIG_API config_setting_t* config_setting_add ( config_setting_t parent,
const char *  name,
int  type 
)
LIBCONFIG_API int config_setting_get_bool ( const config_setting_t setting)
LIBCONFIG_API int config_setting_get_bool_elem ( const config_setting_t setting,
int  idx 
)
LIBCONFIG_API config_setting_t* config_setting_get_elem ( const config_setting_t setting,
unsigned int  idx 
)
LIBCONFIG_API double config_setting_get_float ( const config_setting_t setting)
LIBCONFIG_API double config_setting_get_float_elem ( const config_setting_t setting,
int  idx 
)
LIBCONFIG_API short config_setting_get_format ( config_setting_t setting)
LIBCONFIG_API int config_setting_get_int ( const config_setting_t setting)
LIBCONFIG_API long long config_setting_get_int64 ( const config_setting_t setting)
LIBCONFIG_API long long config_setting_get_int64_elem ( const config_setting_t setting,
int  idx 
)
LIBCONFIG_API int config_setting_get_int_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 const char* config_setting_get_string ( const config_setting_t setting)
LIBCONFIG_API const char* config_setting_get_string_elem ( const config_setting_t setting,
int  idx 
)
LIBCONFIG_API int config_setting_index ( const config_setting_t setting)
LIBCONFIG_API int config_setting_length ( const config_setting_t setting)
LIBCONFIG_API int config_setting_lookup_bool ( const config_setting_t setting,
const char *  name,
int *  value 
)
LIBCONFIG_API int config_setting_lookup_float ( const config_setting_t setting,
const char *  name,
double *  value 
)
LIBCONFIG_API int config_setting_lookup_int ( const config_setting_t setting,
const char *  name,
int *  value 
)
LIBCONFIG_API int config_setting_lookup_int64 ( const config_setting_t setting,
const char *  name,
long long *  value 
)
LIBCONFIG_API int config_setting_lookup_string ( const config_setting_t setting,
const char *  name,
const char **  value 
)
LIBCONFIG_API int config_setting_remove ( config_setting_t parent,
const char *  name 
)
LIBCONFIG_API int config_setting_remove_elem ( config_setting_t parent,
unsigned int  idx 
)
LIBCONFIG_API int config_setting_set_bool ( config_setting_t setting,
int  value 
)
LIBCONFIG_API config_setting_t* config_setting_set_bool_elem ( config_setting_t setting,
int  idx,
int  value 
)
LIBCONFIG_API int config_setting_set_float ( config_setting_t setting,
double  value 
)
LIBCONFIG_API config_setting_t* config_setting_set_float_elem ( config_setting_t setting,
int  idx,
double  value 
)
LIBCONFIG_API int config_setting_set_format ( config_setting_t setting,
short  format 
)
LIBCONFIG_API void config_setting_set_hook ( config_setting_t setting,
void *  hook 
)
LIBCONFIG_API int config_setting_set_int ( config_setting_t setting,
int  value 
)
LIBCONFIG_API int config_setting_set_int64 ( config_setting_t setting,
long long  value 
)
LIBCONFIG_API config_setting_t* config_setting_set_int64_elem ( config_setting_t setting,
int  idx,
long long  value 
)
LIBCONFIG_API config_setting_t* config_setting_set_int_elem ( config_setting_t setting,
int  idx,
int  value 
)
LIBCONFIG_API int config_setting_set_string ( config_setting_t setting,
const char *  value 
)
LIBCONFIG_API config_setting_t* config_setting_set_string_elem ( config_setting_t setting,
int  idx,
const char *  value 
)
LIBCONFIG_API void config_write ( const config_t config,
FILE *  stream 
)
LIBCONFIG_API int config_write_file ( config_t config,
const char *  filename 
)