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 *value = NULL;
|
||||
|
||||
#define CFG(section_c, key_c, name, type, def) do { \
|
||||
if (strcasecmp(section, #section_c) == 0 && strcasecmp(key, #key_c) == 0) { \
|
||||
value = type ## _dumper(section, key, cfg, offsetof(struct x52d_config, name)); \
|
||||
goto return_value; \
|
||||
return type ## _dumper(section, key, cfg, offsetof(struct x52d_config, name)); \
|
||||
} \
|
||||
} while (0);
|
||||
#include "x52d_config.def"
|
||||
|
||||
return_value:
|
||||
return value;
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue