+
+ case VLC_CONFIG_SHORTCUT:
+ item->i_short = va_arg (ap, int);
+ break;
+
+ case VLC_CONFIG_OLDNAME:
+ {
+ const char *oldname = va_arg (ap, const char *);
+ item->psz_oldname = oldname ? strdup (oldname) : NULL;
+ break;
+ }
+
+ case VLC_CONFIG_SAFE:
+ item->b_safe = true;
+ break;
+
+ case VLC_CONFIG_DESC:
+ {
+ const char *text = va_arg (ap, const char *);
+ const char *longtext = va_arg (ap, const char *);
+
+ item->psz_text = text ? strdup (text) : NULL;
+ item->psz_longtext = longtext ? strdup (longtext) : NULL;
+ break;
+ }
+
+ case VLC_CONFIG_LIST:
+ {
+ size_t len = va_arg (ap, size_t);
+
+ /* Copy values */
+ if (IsConfigIntegerType (item->i_type))
+ {
+ const int *src = va_arg (ap, const int *);
+ int *dst = malloc (sizeof (int) * (len + 1));
+
+ if (dst != NULL)
+ {
+ memcpy (dst, src, sizeof (int) * len);
+ dst[len] = 0;
+ }
+ item->pi_list = dst;
+ }
+ else
+ if (IsConfigStringType (item->i_type))
+ {
+ const char *const *src = va_arg (ap, const char *const *);
+ char **dst = malloc (sizeof (char *) * (len + 1));
+
+ if (dst != NULL)
+ {
+ for (size_t i = 0; i < len; i++)
+ dst[i] = src[i] ? strdup (src[i]) : NULL;
+ dst[len] = NULL;
+ }
+ item->ppsz_list = dst;
+ }
+ else
+ break;
+
+ /* Copy textual descriptions */
+ const char *const *text = va_arg (ap, const char *const *);
+ if (text != NULL)
+ {
+ char **dtext = malloc (sizeof (char *) * (len + 1));
+ if( dtext != NULL )
+ {
+ for (size_t i = 0; i < len; i++)
+ dtext[i] = text[i] ? strdup (text[i]) : NULL;
+ dtext[len] = NULL;
+ }
+ item->ppsz_list_text = dtext;
+ }
+ else
+ item->ppsz_list_text = NULL;
+
+ item->i_list = len;
+ item->pf_update_list = va_arg (ap, vlc_callback_t);
+ break;
+ }
+
+ case VLC_CONFIG_ADD_ACTION:
+ {
+ vlc_callback_t cb = va_arg (ap, vlc_callback_t), *tabcb;
+ const char *name = va_arg (ap, const char *);
+ char **tabtext;
+
+ tabcb = realloc (item->ppf_action,
+ (item->i_action + 2) * sizeof (cb));
+ if (tabcb == NULL)
+ break;
+ item->ppf_action = tabcb;
+ tabcb[item->i_action] = cb;
+ tabcb[item->i_action + 1] = NULL;
+
+ tabtext = realloc (item->ppsz_action_text,
+ (item->i_action + 2) * sizeof (name));
+ if (tabtext == NULL)
+ break;
+ item->ppsz_action_text = tabtext;
+
+ if (name)
+ tabtext[item->i_action] = strdup (name);
+ else
+ tabtext[item->i_action] = NULL;
+ tabtext[item->i_action + 1] = NULL;
+
+ item->i_action++;
+ break;
+ }
+
+ default:
+ fprintf (stderr, "LibVLC: unknown module property %d\n", propid);
+ fprintf (stderr, "LibVLC: too old to use this module?\n");
+ ret = -1;
+ break;