if (vlc_plugin_set (p_module, NULL, VLC_SUBMODULE_CREATE, &p_submodule)) \
goto error;
-#define add_shortcut( shortcut ) \
+#define add_shortcut( ... ) \
if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \
- (const char *)(shortcut))) \
+ sizeof((const char*[]){__VA_ARGS__})/sizeof(const char*), __VA_ARGS__)) \
goto error;
#define set_shortname( shortname ) \
case VLC_MODULE_SHORTCUT:
{
- const char *psz_new = va_arg (ap, char*);
- module->pp_shortcuts = realloc (module->pp_shortcuts, sizeof( char ** ) * (module->i_shortcuts + 1));
- module->pp_shortcuts[module->i_shortcuts++] = psz_new;
+ unsigned i_shortcuts = va_arg (ap, unsigned);
+ unsigned index = module->i_shortcuts;
+ module->i_shortcuts += i_shortcuts;
+
+ module->pp_shortcuts = realloc (module->pp_shortcuts, sizeof( char ** ) * module->i_shortcuts);
+ for (; index < module->i_shortcuts; index++)
+ {
+ const char *psz_new = va_arg (ap, const char*);
+ module->pp_shortcuts[index] = psz_new;
+ }
break;
}