]> git.sesse.net Git - vlc/commitdiff
plugin: use separate description command for lists and list callbacks
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 19 Aug 2012 19:08:50 +0000 (22:08 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 19 Aug 2012 21:07:11 +0000 (00:07 +0300)
include/vlc_plugin.h
src/modules/entry.c

index 49adb532edf14dae5ea2be2b14339bab091d6b2b..a3f589d54272f15543a39d5a4feb4be86cbfd5cc 100644 (file)
@@ -91,13 +91,19 @@ enum vlc_module_properties
     VLC_CONFIG_DESC,
     /* description (args=const char *, const char *, const char *) */
 
-    VLC_CONFIG_LIST,
-    /* possible values list
-     * (args=const char *, size_t, const <type> *, const char *const *) */
+    VLC_CONFIG_LIST_OBSOLETE,
+    /* unused (ignored) */
 
     VLC_CONFIG_ADD_ACTION_OBSOLETE,
     /* unused (ignored) */
 
+    VLC_CONFIG_LIST,
+    /* list of suggested values
+     * (args=size_t, const <type> *, const char *const *) */
+
+    VLC_CONFIG_LIST_CB,
+    /* callback for suggested values (args=size_t (*)(<type> **, char ***)) */
+
     /* Insert new VLC_CONFIG_* here */
 };
 
@@ -473,18 +479,16 @@ VLC_METADATA_EXPORTS
     vlc_config_set (VLC_CONFIG_LIST, \
                     (size_t)(sizeof (list) / sizeof (char *)), \
                     (const char *const *)(list), \
-                    (const char *const *)(list_text), \
-                    (vlc_callback_t)NULL);
+                    (const char *const *)(list_text));
 
 #define change_string_cb( cb ) \
-    vlc_config_set (VLC_CONFIG_LIST, 0, NULL, NULL, (vlc_callback_t)(cb));
+    vlc_config_set (VLC_CONFIG_LIST_CB, (cb));
 
 #define change_integer_list( list, list_text ) \
     vlc_config_set (VLC_CONFIG_LIST, \
                     (size_t)(sizeof (list) / sizeof (int)), \
                     (const int *)(list), \
-                    (const char *const *)(list_text), \
-                    (vlc_callback_t)(NULL));
+                    (const char *const *)(list_text));
 
 #define change_integer_range( minv, maxv ) \
     vlc_config_set (VLC_CONFIG_RANGE, (int64_t)(minv), (int64_t)(maxv));
index a23ea6a436eb0bfd33535d0f94c4462c7d87f0ad..7aba1989e5038b63a79e404e5d4e1dd968dc7349 100644 (file)
@@ -417,12 +417,14 @@ static int vlc_plugin_setter (void *plugin, void *tgt, int propid, ...)
                 dtext[len] = NULL;
             }
             item->ppsz_list_text = dtext;
-
             item->i_list = len;
-            item->pf_update_list = va_arg (ap, vlc_callback_t);
             break;
         }
 
+        case VLC_CONFIG_LIST_CB:
+            item->pf_update_list = va_arg (ap, vlc_callback_t);
+            break;
+
         default:
             fprintf (stderr, "LibVLC: unknown module property %d\n", propid);
             fprintf (stderr, "LibVLC: too old to use this module?\n");