diff options
Diffstat (limited to 'src/glibext')
-rw-r--r-- | src/glibext/configuration.c | 2 | ||||
-rw-r--r-- | src/glibext/configuration.h | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/glibext/configuration.c b/src/glibext/configuration.c index 256513a..c19f7ef 100644 --- a/src/glibext/configuration.c +++ b/src/glibext/configuration.c @@ -1541,7 +1541,7 @@ GCfgParam *_g_generic_config_add_param(GGenConfig *config, GCfgParam *param, boo if (old != NULL) { g_clear_object(¶m); - goto exit; + goto exit; } config->params = g_list_append(config->params, param); diff --git a/src/glibext/configuration.h b/src/glibext/configuration.h index 13bc1da..49a289b 100644 --- a/src/glibext/configuration.h +++ b/src/glibext/configuration.h @@ -234,6 +234,19 @@ GCfgParam *_g_generic_config_add_param(GGenConfig *, GCfgParam *, bool); }) +#define g_generic_config_create_param_if_not_exist(c, p, t, d) \ + ({ \ + GCfgParam *__result; \ + __result = g_generic_config_search(c, p); \ + if (__result == NULL) \ + { \ + __result = g_config_param_new(p, t, d); \ + __result = g_generic_config_add_param(c, __result); \ + } \ + __result; \ + }) + + #define g_generic_config_create_or_udpdate_param(c, p, t, d, v) \ ({ \ GCfgParam *__param; \ |