summaryrefslogtreecommitdiff
path: root/3rdparty/libconfig/libconfig.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-16 18:07:52 +0100
committerHaru <haru@dotalux.com>2016-02-17 10:40:44 +0100
commit03a5c603be2cf6d5feea9012029f8899c624557a (patch)
tree80c98e0f160700d7441c2642cd7489f7b8645177 /3rdparty/libconfig/libconfig.c
parent28588859a64fb03335ca5e4083fb6ad95d88db6e (diff)
downloadhercules-03a5c603be2cf6d5feea9012029f8899c624557a.tar.gz
hercules-03a5c603be2cf6d5feea9012029f8899c624557a.tar.bz2
hercules-03a5c603be2cf6d5feea9012029f8899c624557a.tar.xz
hercules-03a5c603be2cf6d5feea9012029f8899c624557a.zip
Removed unnecessary typedefs from libconfig
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to '3rdparty/libconfig/libconfig.c')
-rw-r--r--3rdparty/libconfig/libconfig.c242
1 files changed, 121 insertions, 121 deletions
diff --git a/3rdparty/libconfig/libconfig.c b/3rdparty/libconfig/libconfig.c
index 72520e7c5..0942241c2 100644
--- a/3rdparty/libconfig/libconfig.c
+++ b/3rdparty/libconfig/libconfig.c
@@ -70,9 +70,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
static const char *__io_error = "file I/O error";
-static void __config_list_destroy(config_list_t *list);
-static void __config_write_setting(const config_t *config,
- const config_setting_t *setting,
+static void __config_list_destroy(struct config_list_t *list);
+static void __config_write_setting(const struct config_t *config,
+ const struct config_setting_t *setting,
FILE *stream, int depth);
/* ------------------------------------------------------------------------- */
@@ -174,8 +174,8 @@ static void __config_indent(FILE *stream, int depth, unsigned short w)
/* ------------------------------------------------------------------------- */
-static void __config_write_value(const config_t *config,
- const config_value_t *value, int type,
+static void __config_write_value(const struct config_t *config,
+ const union config_value_t *value, int type,
int format, int depth, FILE *stream)
{
char fbuf[64];
@@ -302,14 +302,14 @@ static void __config_write_value(const config_t *config,
/* list */
case CONFIG_TYPE_LIST:
{
- config_list_t *list = value->list;
+ struct config_list_t *list = value->list;
fprintf(stream, "( ");
if(list)
{
int len = list->length;
- config_setting_t **s;
+ struct config_setting_t **s;
for(s = list->elements; len--; s++)
{
@@ -331,14 +331,14 @@ static void __config_write_value(const config_t *config,
/* array */
case CONFIG_TYPE_ARRAY:
{
- config_list_t *list = value->list;
+ struct config_list_t *list = value->list;
fprintf(stream, "[ ");
if(list)
{
int len = list->length;
- config_setting_t **s;
+ struct config_setting_t **s;
for(s = list->elements; len--; s++)
{
@@ -360,7 +360,7 @@ static void __config_write_value(const config_t *config,
/* group */
case CONFIG_TYPE_GROUP:
{
- config_list_t *list = value->list;
+ struct config_list_t *list = value->list;
if(depth > 0)
{
@@ -378,7 +378,7 @@ static void __config_write_value(const config_t *config,
if(list)
{
int len = list->length;
- config_setting_t **s;
+ struct config_setting_t **s;
for(s = list->elements; len--; s++)
__config_write_setting(config, *s, stream, depth + 1);
@@ -402,13 +402,13 @@ static void __config_write_value(const config_t *config,
/* ------------------------------------------------------------------------- */
-static void __config_list_add(config_list_t *list, config_setting_t *setting)
+static void __config_list_add(struct config_list_t *list, struct config_setting_t *setting)
{
if((list->length % CHUNK_SIZE) == 0)
{
- list->elements = (config_setting_t **)realloc(
+ list->elements = (struct config_setting_t **)realloc(
list->elements,
- (list->length + CHUNK_SIZE) * sizeof(config_setting_t *));
+ (list->length + CHUNK_SIZE) * sizeof(struct config_setting_t *));
}
list->elements[list->length] = setting;
@@ -417,11 +417,11 @@ static void __config_list_add(config_list_t *list, config_setting_t *setting)
/* ------------------------------------------------------------------------- */
-static config_setting_t *__config_list_search(config_list_t *list,
+static struct config_setting_t *__config_list_search(struct config_list_t *list,
const char *name,
unsigned int *idx)
{
- config_setting_t **found = NULL;
+ struct config_setting_t **found = NULL;
unsigned int i;
if(! list)
@@ -446,15 +446,15 @@ static config_setting_t *__config_list_search(config_list_t *list,
/* ------------------------------------------------------------------------- */
-static config_setting_t *__config_list_remove(config_list_t *list, int idx)
+static struct config_setting_t *__config_list_remove(struct config_list_t *list, int idx)
{
- config_setting_t *removed = *(list->elements + idx);
- int offset = (idx * sizeof(config_setting_t *));
+ struct config_setting_t *removed = *(list->elements + idx);
+ int offset = (idx * sizeof(struct config_setting_t *));
int len = list->length - 1 - idx;
char *base = (char *)list->elements + offset;
- memmove(base, base + sizeof(config_setting_t *),
- len * sizeof(config_setting_t *));
+ memmove(base, base + sizeof(struct config_setting_t *),
+ len * sizeof(struct config_setting_t *));
list->length--;
@@ -465,7 +465,7 @@ static config_setting_t *__config_list_remove(config_list_t *list, int idx)
/* ------------------------------------------------------------------------- */
-static void __config_setting_destroy(config_setting_t *setting)
+static void __config_setting_destroy(struct config_setting_t *setting)
{
if(setting)
{
@@ -492,9 +492,9 @@ static void __config_setting_destroy(config_setting_t *setting)
/* ------------------------------------------------------------------------- */
-static void __config_list_destroy(config_list_t *list)
+static void __config_list_destroy(struct config_list_t *list)
{
- config_setting_t **p;
+ struct config_setting_t **p;
unsigned int i;
if(! list)
@@ -513,7 +513,7 @@ static void __config_list_destroy(config_list_t *list)
/* ------------------------------------------------------------------------- */
-static int __config_vector_checktype(const config_setting_t *vector, int type)
+static int __config_vector_checktype(const struct config_setting_t *vector, int type)
{
/* if the array is empty, then it has no type yet */
@@ -557,7 +557,7 @@ static int __config_validate_name(const char *name)
/* ------------------------------------------------------------------------- */
-static int __config_read(config_t *config, FILE *stream, const char *filename,
+static int __config_read(struct config_t *config, FILE *stream, const char *filename,
const char *str)
{
yyscan_t scanner;
@@ -623,22 +623,22 @@ static int __config_read(config_t *config, FILE *stream, const char *filename,
/* ------------------------------------------------------------------------- */
-int config_read(config_t *config, FILE *stream)
+int config_read(struct config_t *config, FILE *stream)
{
return(__config_read(config, stream, NULL, NULL));
}
/* ------------------------------------------------------------------------- */
-int config_read_string(config_t *config, const char *str)
+int config_read_string(struct config_t *config, const char *str)
{
return(__config_read(config, NULL, NULL, str));
}
/* ------------------------------------------------------------------------- */
-static void __config_write_setting(const config_t *config,
- const config_setting_t *setting,
+static void __config_write_setting(const struct config_t *config,
+ const struct config_setting_t *setting,
FILE *stream, int depth)
{
char group_assign_char = __config_has_option(
@@ -673,7 +673,7 @@ static void __config_write_setting(const config_t *config,
/* ------------------------------------------------------------------------- */
-void config_write(const config_t *config, FILE *stream)
+void config_write(const struct config_t *config, FILE *stream)
{
__config_locale_override();
@@ -684,7 +684,7 @@ void config_write(const config_t *config, FILE *stream)
/* ------------------------------------------------------------------------- */
-int config_read_file(config_t *config, const char *filename)
+int config_read_file(struct config_t *config, const char *filename)
{
int ret, ok = 0;
@@ -721,7 +721,7 @@ int config_read_file(config_t *config, const char *filename)
/* ------------------------------------------------------------------------- */
-int config_write_file(config_t *config, const char *filename)
+int config_write_file(struct config_t *config, const char *filename)
{
FILE *stream = fopen(filename, "wt");
if(stream == NULL)
@@ -740,7 +740,7 @@ int config_write_file(config_t *config, const char *filename)
/* ------------------------------------------------------------------------- */
-void config_destroy(config_t *config)
+void config_destroy(struct config_t *config)
{
unsigned int count = config->num_filenames;
const char **f;
@@ -753,16 +753,16 @@ void config_destroy(config_t *config)
_delete(config->filenames);
_delete(config->include_dir);
- memset((void *)config, 0, sizeof(config_t));
+ memset((void *)config, 0, sizeof(struct config_t));
}
/* ------------------------------------------------------------------------- */
-void config_init(config_t *config)
+void config_init(struct config_t *config)
{
- memset((void *)config, 0, sizeof(config_t));
+ memset((void *)config, 0, sizeof(struct config_t));
- config->root = _new(config_setting_t);
+ config->root = _new(struct config_setting_t);
config->root->type = CONFIG_TYPE_GROUP;
config->root->config = config;
config->options = (CONFIG_OPTION_SEMICOLON_SEPARATORS
@@ -773,7 +773,7 @@ void config_init(config_t *config)
/* ------------------------------------------------------------------------- */
-void config_set_auto_convert(config_t *config, int flag)
+void config_set_auto_convert(struct config_t *config, int flag)
{
if(flag)
config->options |= CONFIG_OPTION_AUTOCONVERT;
@@ -783,39 +783,39 @@ void config_set_auto_convert(config_t *config, int flag)
/* ------------------------------------------------------------------------- */
-int config_get_auto_convert(const config_t *config)
+int config_get_auto_convert(const struct config_t *config)
{
return(__config_has_option(config, CONFIG_OPTION_AUTOCONVERT));
}
/* ------------------------------------------------------------------------- */
-void config_set_options(config_t *config, int options)
+void config_set_options(struct config_t *config, int options)
{
config->options = options;
}
/* ------------------------------------------------------------------------- */
-int config_get_options(const config_t *config)
+int config_get_options(const struct config_t *config)
{
return(config->options);
}
/* ------------------------------------------------------------------------- */
-static config_setting_t *config_setting_create(config_setting_t *parent,
+static struct config_setting_t *config_setting_create(struct config_setting_t *parent,
const char *name, int type)
{
- config_setting_t *setting;
- config_list_t *list;
+ struct config_setting_t *setting;
+ struct config_list_t *list;
if((parent->type != CONFIG_TYPE_GROUP)
&& (parent->type != CONFIG_TYPE_ARRAY)
&& (parent->type != CONFIG_TYPE_LIST))
return(NULL);
- setting = _new(config_setting_t);
+ setting = _new(struct config_setting_t);
setting->parent = parent;
setting->name = (name == NULL) ? NULL : strdup(name);
setting->type = type;
@@ -826,7 +826,7 @@ static config_setting_t *config_setting_create(config_setting_t *parent,
list = parent->value.list;
if(! list)
- list = parent->value.list = _new(config_list_t);
+ list = parent->value.list = _new(struct config_list_t);
__config_list_add(list, setting);
@@ -835,7 +835,7 @@ static config_setting_t *config_setting_create(config_setting_t *parent,
/* ------------------------------------------------------------------------- */
-static int __config_setting_get_int(const config_setting_t *setting,
+static int __config_setting_get_int(const struct config_setting_t *setting,
int *value)
{
switch(setting->type)
@@ -868,7 +868,7 @@ static int __config_setting_get_int(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-int config_setting_get_int(const config_setting_t *setting)
+int config_setting_get_int(const struct config_setting_t *setting)
{
int value = 0;
__config_setting_get_int(setting, &value);
@@ -877,7 +877,7 @@ int config_setting_get_int(const config_setting_t *setting)
/* ------------------------------------------------------------------------- */
-static int __config_setting_get_int64(const config_setting_t *setting,
+static int __config_setting_get_int64(const struct config_setting_t *setting,
long long *value)
{
switch(setting->type)
@@ -906,7 +906,7 @@ static int __config_setting_get_int64(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-long long config_setting_get_int64(const config_setting_t *setting)
+long long config_setting_get_int64(const struct config_setting_t *setting)
{
long long value = 0;
__config_setting_get_int64(setting, &value);
@@ -915,10 +915,10 @@ long long config_setting_get_int64(const config_setting_t *setting)
/* ------------------------------------------------------------------------- */
-int config_setting_lookup_int(const config_setting_t *setting,
+int config_setting_lookup_int(const struct config_setting_t *setting,
const char *name, int *value)
{
- config_setting_t *member = config_setting_get_member(setting, name);
+ struct config_setting_t *member = config_setting_get_member(setting, name);
if(! member)
return(CONFIG_FALSE);
@@ -927,10 +927,10 @@ int config_setting_lookup_int(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-int config_setting_lookup_int64(const config_setting_t *setting,
+int config_setting_lookup_int64(const struct config_setting_t *setting,
const char *name, long long *value)
{
- config_setting_t *member = config_setting_get_member(setting, name);
+ struct config_setting_t *member = config_setting_get_member(setting, name);
if(! member)
return(CONFIG_FALSE);
@@ -939,7 +939,7 @@ int config_setting_lookup_int64(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-static int __config_setting_get_float(const config_setting_t *setting,
+static int __config_setting_get_float(const struct config_setting_t *setting,
double *value)
{
switch(setting->type)
@@ -973,7 +973,7 @@ static int __config_setting_get_float(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-double config_setting_get_float(const config_setting_t *setting)
+double config_setting_get_float(const struct config_setting_t *setting)
{
double value = 0.0;
__config_setting_get_float(setting, &value);
@@ -982,10 +982,10 @@ double config_setting_get_float(const config_setting_t *setting)
/* ------------------------------------------------------------------------- */
-int config_setting_lookup_float(const config_setting_t *setting,
+int config_setting_lookup_float(const struct config_setting_t *setting,
const char *name, double *value)
{
- config_setting_t *member = config_setting_get_member(setting, name);
+ struct config_setting_t *member = config_setting_get_member(setting, name);
if(! member)
return(CONFIG_FALSE);
@@ -994,10 +994,10 @@ int config_setting_lookup_float(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-int config_setting_lookup_string(const config_setting_t *setting,
+int config_setting_lookup_string(const struct config_setting_t *setting,
const char *name, const char **value)
{
- config_setting_t *member = config_setting_get_member(setting, name);
+ struct config_setting_t *member = config_setting_get_member(setting, name);
if(! member)
return(CONFIG_FALSE);
@@ -1010,10 +1010,10 @@ int config_setting_lookup_string(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-int config_setting_lookup_bool(const config_setting_t *setting,
+int config_setting_lookup_bool(const struct config_setting_t *setting,
const char *name, int *value)
{
- config_setting_t *member = config_setting_get_member(setting, name);
+ struct config_setting_t *member = config_setting_get_member(setting, name);
if(! member)
return(CONFIG_FALSE);
@@ -1026,7 +1026,7 @@ int config_setting_lookup_bool(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-int config_setting_set_int(config_setting_t *setting, int value)
+int config_setting_set_int(struct config_setting_t *setting, int value)
{
switch(setting->type)
{
@@ -1054,7 +1054,7 @@ int config_setting_set_int(config_setting_t *setting, int value)
/* ------------------------------------------------------------------------- */
-int config_setting_set_int64(config_setting_t *setting, long long value)
+int config_setting_set_int64(struct config_setting_t *setting, long long value)
{
switch(setting->type)
{
@@ -1089,7 +1089,7 @@ int config_setting_set_int64(config_setting_t *setting, long long value)
/* ------------------------------------------------------------------------- */
-int config_setting_set_float(config_setting_t *setting, double value)
+int config_setting_set_float(struct config_setting_t *setting, double value)
{
switch(setting->type)
{
@@ -1126,14 +1126,14 @@ int config_setting_set_float(config_setting_t *setting, double value)
/* ------------------------------------------------------------------------- */
-int config_setting_get_bool(const config_setting_t *setting)
+int config_setting_get_bool(const struct config_setting_t *setting)
{
return((setting->type == CONFIG_TYPE_BOOL) ? setting->value.ival : 0);
}
/* ------------------------------------------------------------------------- */
-int config_setting_set_bool(config_setting_t *setting, int value)
+int config_setting_set_bool(struct config_setting_t *setting, int value)
{
if(setting->type == CONFIG_TYPE_NONE)
setting->type = CONFIG_TYPE_BOOL;
@@ -1146,14 +1146,14 @@ int config_setting_set_bool(config_setting_t *setting, int value)
/* ------------------------------------------------------------------------- */
-const char *config_setting_get_string(const config_setting_t *setting)
+const char *config_setting_get_string(const struct config_setting_t *setting)
{
return((setting->type == CONFIG_TYPE_STRING) ? setting->value.sval : NULL);
}
/* ------------------------------------------------------------------------- */
-int config_setting_set_string(config_setting_t *setting, const char *value)
+int config_setting_set_string(struct config_setting_t *setting, const char *value)
{
if(setting->type == CONFIG_TYPE_NONE)
setting->type = CONFIG_TYPE_STRING;
@@ -1169,7 +1169,7 @@ int config_setting_set_string(config_setting_t *setting, const char *value)
/* ------------------------------------------------------------------------- */
-int config_setting_set_format(config_setting_t *setting, short format)
+int config_setting_set_format(struct config_setting_t *setting, short format)
{
if(((setting->type != CONFIG_TYPE_INT)
&& (setting->type != CONFIG_TYPE_INT64))
@@ -1183,7 +1183,7 @@ int config_setting_set_format(config_setting_t *setting, short format)
/* ------------------------------------------------------------------------- */
-short config_setting_get_format(const config_setting_t *setting)
+short config_setting_get_format(const struct config_setting_t *setting)
{
return(setting->format != 0 ? setting->format
: setting->config->default_format);
@@ -1191,11 +1191,11 @@ short config_setting_get_format(const config_setting_t *setting)
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_lookup(config_setting_t *setting,
+struct config_setting_t *config_setting_lookup(struct config_setting_t *setting,
const char *path)
{
const char *p = path;
- config_setting_t *found;
+ struct config_setting_t *found;
for(;;)
{
@@ -1224,17 +1224,17 @@ config_setting_t *config_setting_lookup(config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-config_setting_t *config_lookup(const config_t *config, const char *path)
+struct config_setting_t *config_lookup(const struct config_t *config, const char *path)
{
return(config_setting_lookup(config->root, path));
}
/* ------------------------------------------------------------------------- */
-int config_lookup_string(const config_t *config, const char *path,
+int config_lookup_string(const struct config_t *config, const char *path,
const char **value)
{
- const config_setting_t *s = config_lookup(config, path);
+ const struct config_setting_t *s = config_lookup(config, path);
if(! s)
return(CONFIG_FALSE);
@@ -1248,10 +1248,10 @@ int config_lookup_string(const config_t *config, const char *path,
/* ------------------------------------------------------------------------- */
-int config_lookup_int(const config_t *config, const char *path,
+int config_lookup_int(const struct config_t *config, const char *path,
int *value)
{
- const config_setting_t *s = config_lookup(config, path);
+ const struct config_setting_t *s = config_lookup(config, path);
if(! s)
return(CONFIG_FALSE);
@@ -1260,10 +1260,10 @@ int config_lookup_int(const config_t *config, const char *path,
/* ------------------------------------------------------------------------- */
-int config_lookup_int64(const config_t *config, const char *path,
+int config_lookup_int64(const struct config_t *config, const char *path,
long long *value)
{
- const config_setting_t *s = config_lookup(config, path);
+ const struct config_setting_t *s = config_lookup(config, path);
if(! s)
return(CONFIG_FALSE);
@@ -1272,10 +1272,10 @@ int config_lookup_int64(const config_t *config, const char *path,
/* ------------------------------------------------------------------------- */
-int config_lookup_float(const config_t *config, const char *path,
+int config_lookup_float(const struct config_t *config, const char *path,
double *value)
{
- const config_setting_t *s = config_lookup(config, path);
+ const struct config_setting_t *s = config_lookup(config, path);
if(! s)
return(CONFIG_FALSE);
@@ -1284,9 +1284,9 @@ int config_lookup_float(const config_t *config, const char *path,
/* ------------------------------------------------------------------------- */
-int config_lookup_bool(const config_t *config, const char *path, int *value)
+int config_lookup_bool(const struct config_t *config, const char *path, int *value)
{
- const config_setting_t *s = config_lookup(config, path);
+ const struct config_setting_t *s = config_lookup(config, path);
if(! s)
return(CONFIG_FALSE);
@@ -1299,19 +1299,19 @@ int config_lookup_bool(const config_t *config, const char *path, int *value)
/* ------------------------------------------------------------------------- */
-int config_setting_get_int_elem(const config_setting_t *vector, int idx)
+int config_setting_get_int_elem(const struct config_setting_t *vector, int idx)
{
- const config_setting_t *element = config_setting_get_elem(vector, idx);
+ const struct config_setting_t *element = config_setting_get_elem(vector, idx);
return(element ? config_setting_get_int(element) : 0);
}
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_set_int_elem(config_setting_t *vector,
+struct config_setting_t *config_setting_set_int_elem(struct config_setting_t *vector,
int idx, int value)
{
- config_setting_t *element = NULL;
+ struct config_setting_t *element = NULL;
if((vector->type != CONFIG_TYPE_ARRAY) && (vector->type != CONFIG_TYPE_LIST))
return(NULL);
@@ -1339,20 +1339,20 @@ config_setting_t *config_setting_set_int_elem(config_setting_t *vector,
/* ------------------------------------------------------------------------- */
-long long config_setting_get_int64_elem(const config_setting_t *vector,
+long long config_setting_get_int64_elem(const struct config_setting_t *vector,
int idx)
{
- const config_setting_t *element = config_setting_get_elem(vector, idx);
+ const struct config_setting_t *element = config_setting_get_elem(vector, idx);
return(element ? config_setting_get_int64(element) : 0);
}
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_set_int64_elem(config_setting_t *vector,
+struct config_setting_t *config_setting_set_int64_elem(struct config_setting_t *vector,
int idx, long long value)
{
- config_setting_t *element = NULL;
+ struct config_setting_t *element = NULL;
if((vector->type != CONFIG_TYPE_ARRAY) && (vector->type != CONFIG_TYPE_LIST))
return(NULL);
@@ -1380,19 +1380,19 @@ config_setting_t *config_setting_set_int64_elem(config_setting_t *vector,
/* ------------------------------------------------------------------------- */
-double config_setting_get_float_elem(const config_setting_t *vector, int idx)
+double config_setting_get_float_elem(const struct config_setting_t *vector, int idx)
{
- config_setting_t *element = config_setting_get_elem(vector, idx);
+ struct config_setting_t *element = config_setting_get_elem(vector, idx);
return(element ? config_setting_get_float(element) : 0.0);
}
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_set_float_elem(config_setting_t *vector,
+struct config_setting_t *config_setting_set_float_elem(struct config_setting_t *vector,
int idx, double value)
{
- config_setting_t *element = NULL;
+ struct config_setting_t *element = NULL;
if((vector->type != CONFIG_TYPE_ARRAY) && (vector->type != CONFIG_TYPE_LIST))
return(NULL);
@@ -1418,9 +1418,9 @@ config_setting_t *config_setting_set_float_elem(config_setting_t *vector,
/* ------------------------------------------------------------------------- */
-int config_setting_get_bool_elem(const config_setting_t *vector, int idx)
+int config_setting_get_bool_elem(const struct config_setting_t *vector, int idx)
{
- config_setting_t *element = config_setting_get_elem(vector, idx);
+ struct config_setting_t *element = config_setting_get_elem(vector, idx);
if(! element)
return(CONFIG_FALSE);
@@ -1433,10 +1433,10 @@ int config_setting_get_bool_elem(const config_setting_t *vector, int idx)
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_set_bool_elem(config_setting_t *vector,
+struct config_setting_t *config_setting_set_bool_elem(struct config_setting_t *vector,
int idx, int value)
{
- config_setting_t *element = NULL;
+ struct config_setting_t *element = NULL;
if((vector->type != CONFIG_TYPE_ARRAY) && (vector->type != CONFIG_TYPE_LIST))
return(NULL);
@@ -1462,10 +1462,10 @@ config_setting_t *config_setting_set_bool_elem(config_setting_t *vector,
/* ------------------------------------------------------------------------- */
-const char *config_setting_get_string_elem(const config_setting_t *vector,
+const char *config_setting_get_string_elem(const struct config_setting_t *vector,
int idx)
{
- config_setting_t *element = config_setting_get_elem(vector, idx);
+ struct config_setting_t *element = config_setting_get_elem(vector, idx);
if(! element)
return(NULL);
@@ -1478,10 +1478,10 @@ const char *config_setting_get_string_elem(const config_setting_t *vector,
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_set_string_elem(config_setting_t *vector,
+struct config_setting_t *config_setting_set_string_elem(struct config_setting_t *vector,
int idx, const char *value)
{
- config_setting_t *element = NULL;
+ struct config_setting_t *element = NULL;
if((vector->type != CONFIG_TYPE_ARRAY) && (vector->type != CONFIG_TYPE_LIST))
return(NULL);
@@ -1507,10 +1507,10 @@ config_setting_t *config_setting_set_string_elem(config_setting_t *vector,
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_get_elem(const config_setting_t *vector,
+struct config_setting_t *config_setting_get_elem(const struct config_setting_t *vector,
unsigned int idx)
{
- config_list_t *list = vector->value.list;
+ struct config_list_t *list = vector->value.list;
if(((vector->type != CONFIG_TYPE_ARRAY)
&& (vector->type != CONFIG_TYPE_LIST)
@@ -1525,7 +1525,7 @@ config_setting_t *config_setting_get_elem(const config_setting_t *vector,
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_get_member(const config_setting_t *setting,
+struct config_setting_t *config_setting_get_member(const struct config_setting_t *setting,
const char *name)
{
if(setting->type != CONFIG_TYPE_GROUP)
@@ -1536,14 +1536,14 @@ config_setting_t *config_setting_get_member(const config_setting_t *setting,
/* ------------------------------------------------------------------------- */
-void config_set_destructor(config_t *config, void (*destructor)(void *))
+void config_set_destructor(struct config_t *config, void (*destructor)(void *))
{
config->destructor = destructor;
}
/* ------------------------------------------------------------------------- */
-void config_set_include_dir(config_t *config, const char *include_dir)
+void config_set_include_dir(struct config_t *config, const char *include_dir)
{
_delete(config->include_dir);
config->include_dir = strdup(include_dir);
@@ -1551,7 +1551,7 @@ void config_set_include_dir(config_t *config, const char *include_dir)
/* ------------------------------------------------------------------------- */
-int config_setting_length(const config_setting_t *setting)
+int config_setting_length(const struct config_setting_t *setting)
{
if((setting->type != CONFIG_TYPE_GROUP)
&& (setting->type != CONFIG_TYPE_ARRAY)
@@ -1566,14 +1566,14 @@ int config_setting_length(const config_setting_t *setting)
/* ------------------------------------------------------------------------- */
-void config_setting_set_hook(config_setting_t *setting, void *hook)
+void config_setting_set_hook(struct config_setting_t *setting, void *hook)
{
setting->hook = hook;
}
/* ------------------------------------------------------------------------- */
-config_setting_t *config_setting_add(config_setting_t *parent,
+struct config_setting_t *config_setting_add(struct config_setting_t *parent,
const char *name, int type)
{
if((type < CONFIG_TYPE_NONE) || (type > CONFIG_TYPE_LIST))
@@ -1608,10 +1608,10 @@ config_setting_t *config_setting_add(config_setting_t *parent,
/* ------------------------------------------------------------------------- */
-int config_setting_remove(config_setting_t *parent, const char *name)
+int config_setting_remove(struct config_setting_t *parent, const char *name)
{
unsigned int idx;
- config_setting_t *setting;
+ struct config_setting_t *setting;
if(! parent)
return(CONFIG_FALSE);
@@ -1630,10 +1630,10 @@ int config_setting_remove(config_setting_t *parent, const char *name)
/* ------------------------------------------------------------------------- */
-int config_setting_remove_elem(config_setting_t *parent, unsigned int idx)
+int config_setting_remove_elem(struct config_setting_t *parent, unsigned int idx)
{
- config_list_t *list;
- config_setting_t *removed = NULL;
+ struct config_list_t *list;
+ struct config_setting_t *removed = NULL;
if(! parent)
return(CONFIG_FALSE);
@@ -1656,10 +1656,10 @@ int config_setting_remove_elem(config_setting_t *parent, unsigned int idx)
/* ------------------------------------------------------------------------- */
-int config_setting_index(const config_setting_t *setting)
+int config_setting_index(const struct config_setting_t *setting)
{
- config_setting_t **found = NULL;
- config_list_t *list;
+ struct config_setting_t **found = NULL;
+ struct config_list_t *list;
int i;
if(! setting->parent)