]> git.sesse.net Git - vlc/blobdiff - include/vlc_plugin.h
s/pl_Yield/pl_Hold/
[vlc] / include / vlc_plugin.h
index b5893003637fc905a2d9b0525860cc0013466d19..57dc998fc4ce01921e115b678614fb49f87db188 100644 (file)
 #ifndef LIBVLC_MODULES_MACROS_H
 # define LIBVLC_MODULES_MACROS_H 1
 
+/**
+ * \file
+ * This file implements plugin (module) macros used to define a vlc module.
+ */
+
 /*****************************************************************************
  * If we are not within a module, assume we're in the vlc core.
  *****************************************************************************/
@@ -34,8 +39,8 @@
 /**
  * Current plugin ABI version
  */
-# define MODULE_SYMBOL 0_9_0k
-# define MODULE_SUFFIX "__0_9_0k"
+# define MODULE_SYMBOL 1_0_0c
+# define MODULE_SUFFIX "__1_0_0c"
 
 /*****************************************************************************
  * Add a few defines. You do not want to read this section. Really.
  * 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;                                     \
@@ -107,7 +110,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 );
@@ -404,21 +408,21 @@ enum vlc_config_properties
                     (size_t)(sizeof (list) / sizeof (char *)), \
                     (const char *const *)(list), \
                     (const char *const *)(list_text), \
-                    list_update_func);
+                    (vlc_callback_t)(list_update_func));
 
 #define change_integer_list( list, list_text, list_update_func ) \
     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);
+                    (vlc_callback_t)(list_update_func));
 
 #define change_float_list( list, list_text, list_update_func ) \
     vlc_config_set (p_config, VLC_CONFIG_LIST, domain, \
                     (size_t)(sizeof (list) / sizeof (float)), \
                     (const float *)(list), \
                     (const char *const *)(list_text), \
-                    list_update_func);
+                    (vlc_callback_t)(list_update_func));
 
 #define change_integer_range( minv, maxv ) \
     vlc_config_set (p_config, VLC_CONFIG_RANGE, (int)(minv), (int)(maxv));
@@ -448,4 +452,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