*/
VLC_EXPORT( module_t *, vlc_submodule_create, ( module_t * ) );
-VLC_EXPORT( int, vlc_module_set, (module_t *module, int propid, ...) );
-VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int type) );
-VLC_EXPORT( int, vlc_config_set, (module_config_t *, int, ...) );
+VLC_EXPORT( int, vlc_plugin_set, (module_t *, module_config_t *, int, ...) );
+VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int) );
+
+#define vlc_module_set( mod, ... ) vlc_plugin_set ((mod), NULL, __VA_ARGS__)
+#define vlc_config_set( cfg, ... ) vlc_plugin_set (NULL, (cfg), __VA_ARGS__)
enum vlc_module_properties
{
/* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
* Append new items at the end ONLY. */
- VLC_MODULE_CPU_REQUIREMENT,
+ VLC_MODULE_CPU_REQUIREMENT=0x100,
VLC_MODULE_SHORTCUT,
VLC_MODULE_CAPABILITY,
VLC_MODULE_SCORE,
VLC_MODULE_SHORTNAME,
VLC_MODULE_DESCRIPTION,
VLC_MODULE_HELP,
-};
+ /* Insert new VLC_MODULE_* here */
-enum vlc_config_properties
-{
/* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI!
* Append new items at the end ONLY. */
-
- VLC_CONFIG_NAME,
+ VLC_CONFIG_NAME=0x1000,
/* command line name (args=const char *, vlc_callback_t) */
VLC_CONFIG_VALUE,
VLC_CONFIG_ADD_ACTION,
/* add value change callback
* (args=const char *, vlc_callback_t, const char *) */
+
+ /* Insert new VLC_CONFIG_* here */
};
/*****************************************************************************
#include <vlc_common.h>
#include <vlc_plugin.h>
+#undef vlc_module_set
+#undef vlc_config_set
#include <assert.h>
#include <stdarg.h>
}
-int vlc_module_set (module_t *module, int propid, ...)
+static int vlc_module_set (module_t *module, int propid, va_list ap)
{
- va_list ap;
int ret = VLC_SUCCESS;
- va_start (ap, propid);
switch (propid)
{
case VLC_MODULE_CPU_REQUIREMENT:
ret = VLC_EGENERIC;
break;
}
- va_end (ap);
return ret;
}
return tab + confsize;
}
-int vlc_config_set (module_config_t *restrict item, int id, ...)
+static int vlc_config_set (module_config_t *restrict item, int id, va_list ap)
{
int ret = -1;
- va_list ap;
assert (item != NULL);
- va_start (ap, id);
switch (id)
{
break;
}
}
+ return ret;
+}
+int vlc_plugin_set (module_t *module, module_config_t *cfg, int id, ...)
+{
+ va_list ap;
+ int ret = -1;
+
+ va_start (ap, id);
+ if (module != NULL)
+ ret = vlc_module_set (module, id, ap);
+ else if (cfg != NULL)
+ ret = vlc_config_set (cfg, id, ap);
va_end (ap);
+
return ret;
}