} 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, ...) );
/*****************************************************************************
#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 ) \
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;