/**
* Module descriptor
*/
+/* FIXME: scheduled for privatization */
struct module_t
{
VLC_COMMON_MEMBERS
/** Shortcuts to the module */
const char *pp_shortcuts[ MODULE_SHORTCUT_MAX ];
- const char *psz_capability; /**< Capability */
+ char *psz_capability; /**< Capability */
int i_score; /**< Score for the capability */
uint32_t i_cpu; /**< Required CPU capabilities */
VLC_EXPORT( module_t *, vlc_submodule_create, ( module_t * ) );
VLC_EXPORT( int, vlc_module_set, (module_t *module, int propid, void *value) );
-enum
+enum vlc_module_properties
{
/* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
* Append new items at the end ONLY. */
VLC_MODULE_NAME
};
+VLC_EXPORT( vlc_bool_t, module_IsCapable, ( const module_t *, const char *cap ) );
#endif
}
+/*****************************************************************************
+ * module_IsCapable: checks whether a module implements a capability.
+ *****************************************************************************/
+vlc_bool_t module_IsCapable( const module_t *m, const char *cap )
+{
+ return !strcmp( m->psz_capability, cap );
+}
+
/*****************************************************************************
* module_Need: return the best module function, given a capability list.
*****************************************************************************
p_module = (module_t *)p_all->p_values[i_which_module].p_object;
/* Test that this module can do what we need */
- if( strcmp( p_module->psz_capability, psz_capability ) )
+ if( !module_IsCapable( p_module, psz_capability ) )
{
/* Don't recurse through the sub-modules because vlc_list_find()
* will list them anyway. */
}
free( (void*)p_module->psz_object_name );
- free( (void*)p_module->psz_capability );
+ free( p_module->psz_capability );
free( (void*)p_module->psz_shortname );
free( (void*)p_module->psz_longname );
free( (void*)p_module->psz_help );