From 04e363a9459baba69a6906d20c4336b2dbcc21c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sun, 19 Aug 2012 22:08:50 +0300 Subject: [PATCH] plugin: use separate description command for lists and list callbacks --- include/vlc_plugin.h | 20 ++++++++++++-------- src/modules/entry.c | 6 ++++-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h index 49adb532ed..a3f589d542 100644 --- a/include/vlc_plugin.h +++ b/include/vlc_plugin.h @@ -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 *, 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 *, const char *const *) */ + + VLC_CONFIG_LIST_CB, + /* callback for suggested values (args=size_t (*)( **, 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)); diff --git a/src/modules/entry.c b/src/modules/entry.c index a23ea6a436..7aba1989e5 100644 --- a/src/modules/entry.c +++ b/src/modules/entry.c @@ -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"); -- 2.39.2