Add argument to module_GetModulesNamesForCapability (and services_discovery_GetServic...
authorAntoine Cellerier <dionoea@videolan.org>
Sun, 11 Nov 2007 20:32:43 +0000 (20:32 +0000)
committerAntoine Cellerier <dionoea@videolan.org>
Sun, 11 Nov 2007 20:32:43 +0000 (20:32 +0000)
include/vlc_modules.h
include/vlc_services_discovery.h
src/modules/modules.c
src/playlist/services_discovery.c

index ccecc3f..70d0373 100644 (file)
@@ -116,10 +116,11 @@ VLC_EXPORT( module_t *, __module_FindName, ( vlc_object_t *, const char * ) );
 /* Return a NULL terminated array with the names of the modules that have a
  * certain capability.
  * Free after uses both the string and the table. */
- #define module_GetModulesNamesForCapability(a,b) \
-                    __module_GetModulesNamesForCapability(VLC_OBJECT(a),b)
+ #define module_GetModulesNamesForCapability(a,b,c) \
+                    __module_GetModulesNamesForCapability(VLC_OBJECT(a),b,c)
 VLC_EXPORT(char **, __module_GetModulesNamesForCapability,
-                    ( vlc_object_t *p_this, const char * psz_capability ) );
+                    ( vlc_object_t *p_this, const char * psz_capability,
+                      char ***psz_longname ) );
 
 VLC_EXPORT( module_t *, vlc_module_create, ( vlc_object_t * ) );
 VLC_EXPORT( module_t *, vlc_submodule_create, ( module_t * ) );
index 1b0cde0..b2eb0a5 100644 (file)
@@ -62,7 +62,7 @@ struct services_discovery_t
 
 /* Get the services discovery modules names to use in Create(), in a null
  * terminated string array. Array and string must be freed after use. */
-VLC_EXPORT( char **, services_discovery_GetServicesNames, ( vlc_object_t * p_super ) );
+VLC_EXPORT( char **, services_discovery_GetServicesNames, ( vlc_object_t * p_super, char ***pppsz_longnames ) );
 
 /* Creation of a service_discovery object */
 VLC_EXPORT( services_discovery_t *, services_discovery_Create, ( vlc_object_t * p_super, const char * psz_service_name ) );
index 83dfb94..bc51f85 100644 (file)
@@ -779,7 +779,8 @@ vlc_bool_t __module_Exists(  vlc_object_t *p_this, const char * psz_name )
  * Free after uses both the string and the table.
  *****************************************************************************/
 char ** __module_GetModulesNamesForCapability( vlc_object_t *p_this,
-                                               const char * psz_capability )
+                                               const char * psz_capability,
+                                               char ***pppsz_longname )
 {
     vlc_list_t *p_list;
     int i, j, count = 0;
@@ -795,6 +796,8 @@ char ** __module_GetModulesNamesForCapability( vlc_object_t *p_this,
             count++;
     }
     psz_ret = malloc( sizeof(char*) * (count+1) );
+    if( pppsz_longname )
+        *pppsz_longname = malloc( sizeof(char*) * (count+1) );
     j = 0;
     for( i = 0 ; i < p_list->i_count; i++)
     {
@@ -810,6 +813,8 @@ char ** __module_GetModulesNamesForCapability( vlc_object_t *p_this,
             }
             psz_ret[j] = strdup( k>=0?p_module->pp_shortcuts[k]
                                      :p_module->psz_object_name );
+            if( pppsz_longname )
+                (*pppsz_longname)[j] = strdup( module_GetName( p_module, VLC_TRUE ) );
             j++;
         }
     }
index 2dc5786..6481598 100644 (file)
@@ -37,9 +37,11 @@ static void RunSD( services_discovery_t *p_sd );
 /***********************************************************************
  * GetServicesNames
  ***********************************************************************/
-char ** services_discovery_GetServicesNames( vlc_object_t * p_super )
+char ** services_discovery_GetServicesNames( vlc_object_t * p_super,
+                                             char ***pppsz_longnames )
 {
-    return module_GetModulesNamesForCapability( p_super, "services_discovery" );
+    return module_GetModulesNamesForCapability( p_super, "services_discovery",
+                                                pppsz_longnames );
 }
 
 /***********************************************************************