]> git.sesse.net Git - vlc/commitdiff
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 ccecc3f8e560d536ea5d2e6bf813c6d13ef686af..70d0373398ebd5e7a0d8918d8d1369c3de6db99a 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 1b0cde073dd4cb61af900be7133a572c711a0347..b2eb0a586dcf128f4e174f6483a5b989c4ee67d7 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 83dfb9443755473b7a239be09dacda629a78d7ef..bc51f8523f293f2f2afebceb39991da005d6b54b 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 2dc578681da16b0c66a6aa56cfec0d76aaa6a653..64815981b3ce60ead6f3852fd7277c9159db2499 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 );
 }
 
 /***********************************************************************