Changeset 6c11c08a800fa57846e69fb86a42164f2570dfe4

Show
Ignore:
Timestamp:
04/08/07 19:28:18 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1186248498 +0000
git-parent:

[4c4c4ce26e381d5e03b016d384e84d8a94721685]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1186248498 +0000
Message:

Partially abstract module_t: add module_IsCapable()

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_modules.h

    rcba87f6 r6c11c08  
    4747 * Module descriptor 
    4848 */ 
     49/* FIXME: scheduled for privatization */ 
    4950struct module_t 
    5051{ 
     
    6667    const char *pp_shortcuts[ MODULE_SHORTCUT_MAX ]; 
    6768 
    68     const char    *psz_capability;                           /**< Capability */ 
     69    char    *psz_capability;                                 /**< Capability */ 
    6970    int      i_score;                          /**< Score for the capability */ 
    7071    uint32_t i_cpu;                           /**< Required CPU capabilities */ 
     
    111112VLC_EXPORT( int, vlc_module_set, (module_t *module, int propid, void *value) ); 
    112113 
    113 enum 
     114enum vlc_module_properties 
    114115{ 
    115116    /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI! 
     
    129130}; 
    130131 
     132VLC_EXPORT( vlc_bool_t, module_IsCapable, ( const module_t *, const char *cap ) ); 
  • src/libvlc.sym

    r51681a2 r6c11c08  
    178178__module_Need 
    179179__module_Unneed 
     180module_IsCapable 
    180181__msg_Dbg 
    181182__msg_Err 
  • src/modules/modules.c

    r8952d64 r6c11c08  
    385385 
    386386/***************************************************************************** 
     387 * module_IsCapable: checks whether a module implements a capability. 
     388 *****************************************************************************/ 
     389vlc_bool_t module_IsCapable( const module_t *m, const char *cap ) 
     390{ 
     391    return !strcmp( m->psz_capability, cap ); 
     392} 
     393 
     394/***************************************************************************** 
    387395 * module_Need: return the best module function, given a capability list. 
    388396 ***************************************************************************** 
     
    480488 
    481489        /* Test that this module can do what we need */ 
    482         if( strcmp( p_module->psz_capability, psz_capability ) ) 
     490        if( !module_IsCapable( p_module, psz_capability ) ) 
    483491        { 
    484492            /* Don't recurse through the sub-modules because vlc_list_find() 
     
    12001208 
    12011209    free( (void*)p_module->psz_object_name ); 
    1202     free( (void*)p_module->psz_capability ); 
     1210    free( p_module->psz_capability ); 
    12031211    free( (void*)p_module->psz_shortname ); 
    12041212    free( (void*)p_module->psz_longname );