mirror of https://github.com/nirenjan/libx52.git
Cleanup config dump routine
parent
7f59984357
commit
b2f292bf58
|
@ -140,16 +140,12 @@ exit_dump:
|
||||||
|
|
||||||
const char *x52d_config_get_param(struct x52d_config *cfg, const char *section, const char *key)
|
const char *x52d_config_get_param(struct x52d_config *cfg, const char *section, const char *key)
|
||||||
{
|
{
|
||||||
const char *value = NULL;
|
|
||||||
|
|
||||||
#define CFG(section_c, key_c, name, type, def) do { \
|
#define CFG(section_c, key_c, name, type, def) do { \
|
||||||
if (strcasecmp(section, #section_c) == 0 && strcasecmp(key, #key_c) == 0) { \
|
if (strcasecmp(section, #section_c) == 0 && strcasecmp(key, #key_c) == 0) { \
|
||||||
value = type ## _dumper(section, key, cfg, offsetof(struct x52d_config, name)); \
|
return type ## _dumper(section, key, cfg, offsetof(struct x52d_config, name)); \
|
||||||
goto return_value; \
|
|
||||||
} \
|
} \
|
||||||
} while (0);
|
} while (0);
|
||||||
#include "x52d_config.def"
|
#include "x52d_config.def"
|
||||||
|
|
||||||
return_value:
|
return NULL;
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue