Commit eb2e4add authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Some more vlc_config_* code

parent a24e0766
......@@ -247,6 +247,7 @@ typedef enum vlc_config_properties
} vlc_config_t;
VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int type) );
VLC_EXPORT( int, vlc_config_set, (module_config_t *, vlc_config_t, ...) );
/*****************************************************************************
......@@ -367,7 +368,7 @@ VLC_EXPORT( int, vlc_config_set, (module_config_t *, vlc_config_t, ...) );
#define add_bool( name, v, p_callback, text, longtext, advc ) \
add_typename_inner( CONFIG_ITEM_BOOL, name, text, longtext, advc, p_callback ); \
p_config[i_config].value.i = v
if (v) vlc_config_set (p_config + i_config, VLC_CONFIG_VALUE, (int)VLC_TRUE)
/* For renamed option */
#define add_deprecated_alias( name ) \
......
......@@ -142,6 +142,25 @@ int vlc_module_set (module_t *module, int propid, void *value)
return 0;
}
module_config_t *vlc_config_create (module_t *module, int type)
{
unsigned confsize = module->confsize;
module_config_t *tab = module->p_config;
if ((confsize & 0xf) == 0)
{
tab = realloc (tab, (confsize + 17) * sizeof (*tab));
if (tab == NULL)
return NULL;
module->p_config = tab;
}
module->confsize++;
memset (tab + confsize, 0, sizeof (tab[confsize]));
return tab + confsize;
}
int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...)
{
int ret = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment