X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_plugin.h;h=f0d2554562ecbb4b15a76776a44664f5c0cf25c2;hb=67923a077e1ca09ba81ac607a15d8b0d225cf91c;hp=77b6c490033fa7b43fec45eb937d5a148c3ec8e2;hpb=64ae2cbffa7639c04869e6588f80f5c1a7d05221;p=vlc diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h index 77b6c49003..f0d2554562 100644 --- a/include/vlc_plugin.h +++ b/include/vlc_plugin.h @@ -34,8 +34,8 @@ /** * Current plugin ABI version */ -# define MODULE_SYMBOL 0_9_0k -# define MODULE_SUFFIX "__0_9_0k" +# define MODULE_SYMBOL 0_9_0m +# define MODULE_SUFFIX "__0_9_0m" /***************************************************************************** * Add a few defines. You do not want to read this section. Really. @@ -83,16 +83,15 @@ * instance the module name, its shortcuts, its capabilities... we also create * a copy of its config because the module can be unloaded at any time. */ -#if defined (__PLUGIN__) || defined (__BUILTIN__) -EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL -E_(vlc_entry) ( module_t *p_module ); -#endif - #define vlc_module_begin( ) \ EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \ + E_(vlc_entry) ( module_t *p_module ); \ + \ + EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \ __VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \ { \ module_config_t *p_config = NULL; \ + const char *domain = NULL; \ if (vlc_module_set (p_module, VLC_MODULE_NAME, \ (const char *)(MODULE_STRING))) \ goto error; \ @@ -106,7 +105,8 @@ E_(vlc_entry) ( module_t *p_module ); \ error: \ return VLC_EGENERIC; \ - } + } \ + VLC_METADATA_EXPORTS #define add_submodule( ) \ p_submodule = vlc_submodule_create( p_module ); @@ -151,6 +151,8 @@ E_(vlc_entry) ( module_t *p_module ); if (vlc_module_set (p_submodule, VLC_MODULE_NO_UNLOAD)) \ goto error; +#define set_text_domain( dom ) domain = (dom); + VLC_EXPORT( module_t *, vlc_module_create, ( vlc_object_t * ) ); VLC_EXPORT( module_t *, vlc_submodule_create, ( module_t * ) ); VLC_EXPORT( int, vlc_module_set, (module_t *module, int propid, ...) ); @@ -186,7 +188,7 @@ enum vlc_config_properties VLC_CONFIG_NAME, /* command line name (args=const char *, vlc_callback_t) */ - VLC_CONFIG_DESC, + VLC_CONFIG_DESC_NODOMAIN, /* description (args=const char *, const char *) */ VLC_CONFIG_VALUE, @@ -219,11 +221,11 @@ enum vlc_config_properties VLC_CONFIG_SHORTCUT, /* one-character (short) command line option name (args=char) */ - VLC_CONFIG_LIST, + VLC_CONFIG_LIST_NODOMAIN, /* possible values list * (args=size_t, const *, const char *const *) */ - VLC_CONFIG_ADD_ACTION, + VLC_CONFIG_ADD_ACTION_NODOMAIN, /* add value change callback (args=vlc_callback_t, const char *) */ VLC_CONFIG_OLDNAME, @@ -231,6 +233,17 @@ enum vlc_config_properties VLC_CONFIG_SAFE, /* tag as modifiable by untrusted input item "sources" (args=none) */ + + 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_ADD_ACTION, + /* add value change callback + * (args=const char *, vlc_callback_t, const char *) */ }; /***************************************************************************** @@ -251,7 +264,7 @@ enum vlc_config_properties #define add_typedesc_inner( type, text, longtext ) \ add_type_inner( type ) \ - vlc_config_set (p_config, VLC_CONFIG_DESC, \ + vlc_config_set (p_config, VLC_CONFIG_DESC, domain, \ (const char *)(text), (const char *)(longtext)); #define add_typeadv_inner( type, text, longtext, advc ) \ @@ -386,21 +399,21 @@ enum vlc_config_properties vlc_config_set (p_config, VLC_CONFIG_SHORTCUT, (int)(ch)); #define change_string_list( list, list_text, list_update_func ) \ - vlc_config_set (p_config, VLC_CONFIG_LIST, \ + vlc_config_set (p_config, VLC_CONFIG_LIST, domain, \ (size_t)(sizeof (list) / sizeof (char *)), \ (const char *const *)(list), \ (const char *const *)(list_text), \ list_update_func); #define change_integer_list( list, list_text, list_update_func ) \ - vlc_config_set (p_config, VLC_CONFIG_LIST, \ + vlc_config_set (p_config, VLC_CONFIG_LIST, domain, \ (size_t)(sizeof (list) / sizeof (int)), \ (const int *)(list), \ (const char *const *)(list_text), \ list_update_func); #define change_float_list( list, list_text, list_update_func ) \ - vlc_config_set (p_config, VLC_CONFIG_LIST, \ + vlc_config_set (p_config, VLC_CONFIG_LIST, domain, \ (size_t)(sizeof (list) / sizeof (float)), \ (const float *)(list), \ (const char *const *)(list_text), \ @@ -414,7 +427,7 @@ enum vlc_config_properties (double)(minv), (double)(maxv)); #define change_action_add( pf_action, text ) \ - vlc_config_set (p_config, VLC_CONFIG_ADD_ACTION, \ + vlc_config_set (p_config, VLC_CONFIG_ADD_ACTION, domain, \ (vlc_callback_t)(pf_action), (const char *)(text)); #define change_internal() \ @@ -434,4 +447,34 @@ enum vlc_config_properties #define change_safe() \ vlc_config_set (p_config, VLC_CONFIG_SAFE); +/* Meta data plugin exports */ +#define VLC_META_EXPORT( name, value ) \ + EXTERN_SYMBOL DLL_SYMBOL const char * CDECL_SYMBOL \ + E_(vlc_entry_ ## name) (void); \ + EXTERN_SYMBOL DLL_SYMBOL const char * CDECL_SYMBOL \ + __VLC_SYMBOL(vlc_entry_ ## name) (void) \ + { \ + return value; \ + } + +#if defined (__LIBVLC__) +# define VLC_COPYRIGHT_EXPORT VLC_META_EXPORT (copyright, \ + "\x43\x6f\x70\x79\x72\x69\x67\x68\x74\x20\x28\x43\x29\x20\x74\x68" \ + "\x65\x20\x56\x69\x64\x65\x6f\x4c\x41\x4e\x20\x56\x4c\x43\x20\x6d" \ + "\x65\x64\x69\x61\x20\x70\x6c\x61\x79\x65\x72\x20\x64\x65\x76\x65" \ + "\x6c\x6f\x70\x70\x65\x72\x73" ) +#elif !defined (VLC_COPYRIGHT_EXPORT) +# define VLC_COPYRIGHT_EXPORT +#endif +#define VLC_LICENSE_EXPORT VLC_META_EXPORT (license, \ + "\x4c\x69\x63\x65\x6e\x73\x65\x64\x20\x75\x6e\x64\x65\x72\x20\x74" \ + "\x68\x65\x20\x74\x65\x72\x6d\x73\x20\x6f\x66\x20\x74\x68\x65\x20" \ + "\x47\x4e\x55\x20\x47\x65\x6e\x65\x72\x61\x6c\x20\x50\x75\x62\x6c" \ + "\x69\x63\x20\x4c\x69\x63\x65\x6e\x73\x65\x2c\x20\x76\x65\x72\x73" \ + "\x69\x6f\x6e\x20\x32\x20\x6f\x72\x20\x6c\x61\x74\x65\x72\x2e" ) + +#define VLC_METADATA_EXPORTS \ + VLC_COPYRIGHT_EXPORT \ + VLC_LICENSE_EXPORT + #endif