/*
- * Copyright (C) 2010 Tobias Brunner
+ * Copyright (C) 2010-2014 Tobias Brunner
* Copyright (C) 2008 Martin Willi
* Hochschule fuer Technik Rapperswil
*
{
return NULL;
}
- if (section->sections->find_first(section->sections,
- (linked_list_match_t)section_find,
- (void**)&found, buf) != SUCCESS)
+ if (!strlen(buf))
+ {
+ found = section;
+ }
+ else if (section->sections->find_first(section->sections,
+ (linked_list_match_t)section_find,
+ (void**)&found, buf) != SUCCESS)
{
if (ensure)
{
{
return NULL;
}
- if (section->sections->find_first(section->sections,
- (linked_list_match_t)section_find,
- (void**)&found, buf) != SUCCESS)
+ if (!strlen(buf))
+ {
+ found = section;
+ }
+ else if (section->sections->find_first(section->sections,
+ (linked_list_match_t)section_find,
+ (void**)&found, buf) != SUCCESS)
{
if (!ensure)
{
}
METHOD(settings_t, get_str, char*,
- private_settings_t *this, char *key, char *def, ...)
+ private_settings_t *this, char *key, char *def, ...)
{
char *value;
va_list args;
}
METHOD(settings_t, get_bool, bool,
- private_settings_t *this, char *key, bool def, ...)
+ private_settings_t *this, char *key, bool def, ...)
{
char *value;
va_list args;
}
METHOD(settings_t, get_int, int,
- private_settings_t *this, char *key, int def, ...)
+ private_settings_t *this, char *key, int def, ...)
{
char *value;
va_list args;
}
METHOD(settings_t, get_double, double,
- private_settings_t *this, char *key, double def, ...)
+ private_settings_t *this, char *key, double def, ...)
{
char *value;
va_list args;
}
METHOD(settings_t, get_time, u_int32_t,
- private_settings_t *this, char *key, u_int32_t def, ...)
+ private_settings_t *this, char *key, u_int32_t def, ...)
{
char *value;
va_list args;
}
METHOD(settings_t, set_str, void,
- private_settings_t *this, char *key, char *value, ...)
+ private_settings_t *this, char *key, char *value, ...)
{
va_list args;
va_start(args, value);
}
METHOD(settings_t, set_bool, void,
- private_settings_t *this, char *key, bool value, ...)
+ private_settings_t *this, char *key, bool value, ...)
{
va_list args;
va_start(args, value);
}
METHOD(settings_t, set_int, void,
- private_settings_t *this, char *key, int value, ...)
+ private_settings_t *this, char *key, int value, ...)
{
char val[16];
va_list args;
}
METHOD(settings_t, set_double, void,
- private_settings_t *this, char *key, double value, ...)
+ private_settings_t *this, char *key, double value, ...)
{
char val[64];
va_list args;
}
METHOD(settings_t, set_time, void,
- private_settings_t *this, char *key, u_int32_t value, ...)
+ private_settings_t *this, char *key, u_int32_t value, ...)
{
char val[16];
va_list args;
}
METHOD(settings_t, set_default_str, bool,
- private_settings_t *this, char *key, char *value, ...)
+ private_settings_t *this, char *key, char *value, ...)
{
char *old;
va_list args;
}
METHOD(settings_t, create_section_enumerator, enumerator_t*,
- private_settings_t *this, char *key, ...)
+ private_settings_t *this, char *key, ...)
{
section_t *section;
va_list args;
}
METHOD(settings_t, create_key_value_enumerator, enumerator_t*,
- private_settings_t *this, char *key, ...)
+ private_settings_t *this, char *key, ...)
{
section_t *section;
va_list args;
}
METHOD(settings_t, load_files, bool,
- private_settings_t *this, char *pattern, bool merge)
+ private_settings_t *this, char *pattern, bool merge)
{
return load_files_internal(this, this->top, pattern, merge);
}
METHOD(settings_t, load_files_section, bool,
- private_settings_t *this, char *pattern, bool merge, char *key, ...)
+ private_settings_t *this, char *pattern, bool merge, char *key, ...)
{
section_t *section;
va_list args;
}
METHOD(settings_t, destroy, void,
- private_settings_t *this)
+ private_settings_t *this)
{
section_destroy(this->top);
this->contents->destroy_function(this->contents, (void*)free);