libobs: Add config_has_(user|default)_value functions

Similar to obs_data_has_(user_value|default|autoselect), these allow
library users to distinguish between user config values and default
values
This commit is contained in:
Palana committed 2014-07-13 19:10:38 +02:00
1 parent 10a6ffdbf8
commit 850d92bac0
2 files changed
+18

No files matched your search

+13
View File
@@ -598,3 +598,16 @@ double config_get_default_double(config_t config, const char *section,
return 0.0;
}
bool config_has_user_value(config_t config, const char *section,
const char *name)
{
return config_find_item(&config->sections, section, name) != NULL;
}
bool config_has_default_value(config_t config, const char *section,
const char *name)
{
return config_find_item(&config->defaults, section, name) != NULL;
}
+5
View File
@@ -112,6 +112,11 @@ EXPORT bool config_get_default_bool(config_t config, const char *section,
EXPORT double config_get_default_double(config_t config, const char *section,
const char *name);
EXPORT bool config_has_user_value(config_t config, const char *section,
const char *name);
EXPORT bool config_has_default_value(config_t config, const char *section,
const char *name);
#ifdef __cplusplus
}
#endif