#define vlc_module_end( ) \
} \
- res = config_Duplicate( p_module, p_config, ++i_config ); \
- free( p_config ); \
- if (res) \
- return res; \
- return VLC_SUCCESS; \
+ return config_Duplicate( p_module, p_config, ++i_config ); \
\
error: \
- free( p_config ); \
+ /* FIXME: config_Free( p_config ); */ \
/* FIXME: cleanup submodules objects ??? */ \
return VLC_EGENERIC; \
} \
const module_config_t *p_item, *p_end = p_orig + n;
/* Calculate the structure length */
- p_module->i_config_items = 0;
- p_module->i_bool_items = 0;
-
for( p_item = p_orig; p_item < p_end; p_item++ )
{
if( p_item->i_type & CONFIG_ITEM )
}
}
- /* Allocate memory */
- p_module->p_config = (module_config_t *)calloc( n, sizeof(*p_orig) );
- if( p_module->p_config == NULL )
- {
- msg_Err( p_module, "config error: can't duplicate p_config" );
- return VLC_ENOMEM;
- }
+ p_module->p_config = p_orig;
p_module->confsize = n;
/* Do the duplication job */
for( size_t i = 0; i < n ; i++ )
{
- p_module->p_config[i] = p_orig[i];
p_module->p_config[i].p_lock = &p_module->object_lock;
}
return VLC_SUCCESS;
module->psz_object_name = module->psz_longname = default_name;
module->psz_capability = "";
module->i_score = 1;
+ module->i_config_items = module->i_bool_items = 0;
+
return module;
}
tab[confsize].i_type = type;
tab[confsize].p_lock = &module->object_lock;
+ if (type & CONFIG_ITEM)
+ {
+ module->i_config_items++;
+ if (type == CONFIG_ITEM_BOOL)
+ module->i_bool_items++;
+ }
+
return tab + confsize;
}