]> git.sesse.net Git - vlc/blobdiff - include/modules_inner.h
More UTF8ication
[vlc] / include / modules_inner.h
index 7e0b128a187439048c3235257f3f39c929b2dde5..b13cfc18de39fff01dcebcc4e0506308caaceedd 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
  * modules_inner.h : Macros used from within a module.
  *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: modules_inner.h,v 1.41 2003/12/13 17:16:11 gbazin Exp $
+ * Copyright (C) 2001 the VideoLAN team
+ * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /*****************************************************************************
  * this can't easily be done with the C preprocessor, thus a few ugly hacks.
  */
 
-/* I can't believe I need to do this to change « foo » to « "foo" » */
+/* I can't believe I need to do this to change Â« foo Â» to Â« "foo" Â» */
 #define STRINGIFY( z )   UGLY_KLUDGE( z )
 #define UGLY_KLUDGE( z ) #z
-/* And I need to do _this_ to change « foo bar » to « module_foo_bar » ! */
+/* And I need to do _this_ to change Â« foo bar Â» to Â« module_foo_bar Â» ! */
 #define CONCATENATE( y, z ) CRUDE_HACK( y, z )
 #define CRUDE_HACK( y, z )  y##__##z
 
@@ -58,7 +58,7 @@
 #   define DECLARE_SYMBOLS         struct _u_n_u_s_e_d_
 #   define STORE_SYMBOLS           struct _u_n_u_s_e_d_
 #elif defined( __PLUGIN__ )
-#   define E_( function )          function
+#   define E_( function )          CONCATENATE( function, MODULE_SYMBOL )
 #   define __VLC_SYMBOL( symbol  ) CONCATENATE( symbol, MODULE_SYMBOL )
 #   define DECLARE_SYMBOLS         module_symbols_t* p_symbols
 #   define STORE_SYMBOLS           p_symbols = p_module->p_symbols
 #   define EXTERN_SYMBOL
 #endif
 
+#if defined( USE_DLL )
+#   define IMPORT_SYMBOL __declspec(dllimport)
+#else
+#   define IMPORT_SYMBOL
+#endif
+
 #define MODULE_STRING STRINGIFY( MODULE_NAME )
 
 /*
     {                                                                         \
         int i_shortcut = 1, i_config = -1;                                    \
         module_config_t *p_config = NULL;                                     \
+        static module_config_t config_end = {CONFIG_HINT_END};            \
         STORE_SYMBOLS;                                                        \
         p_module->b_submodule = VLC_FALSE;                                    \
         p_module->b_unloadable = VLC_TRUE;                                    \
         p_module->b_reentrant = VLC_TRUE;                                     \
         p_module->psz_object_name = MODULE_STRING;                            \
+        p_module->psz_shortname = NULL;                                       \
         p_module->psz_longname = MODULE_STRING;                               \
         p_module->pp_shortcuts[ 0 ] = MODULE_STRING;                          \
         p_module->i_cpu = 0;                                                  \
         }                                                                     \
         if( p_config )                                                        \
         {                                                                     \
-            p_config[ ++i_config ] = (module_config_t){ CONFIG_HINT_END };    \
+            int i;                                                            \
+            p_config[ ++i_config ] = config_end;                              \
             config_Duplicate( p_module, p_config );                           \
+            for( i = 0; i < i_config; i++ )                                   \
+            {                                                                 \
+                if( p_config[ i ].i_action )                                  \
+                {                                                             \
+                    free( p_config[ i ].ppf_action );                         \
+                    free( p_config[ i ].ppsz_action_text );                   \
+                }                                                             \
+            }                                                                 \
             free( p_config );                                                 \
         }                                                                     \
-        else config_Duplicate(p_module, &(module_config_t){CONFIG_HINT_END}); \
+        else config_Duplicate( p_module, &config_end );                       \
         if( p_module->p_config == NULL )                                      \
         {                                                                     \
             return VLC_EGENERIC;                                              \
                                 p_module->pp_shortcuts[ i_shortcut ];         \
     }                                                                         \
     p_submodule->psz_object_name = p_module->psz_object_name;                 \
+    p_submodule->psz_shortname = p_module->psz_shortname;                     \
     p_submodule->psz_longname = p_module->psz_longname;                       \
     p_submodule->psz_program = p_module->psz_program;                         \
     p_submodule->psz_capability = p_module->psz_capability;                   \
     p_submodule->pp_shortcuts[ i_shortcut ] = shortcut;                       \
     i_shortcut++
 
+#define set_shortname( desc )                                                 \
+    p_submodule->psz_shortname = desc
+
 #define set_description( desc )                                               \
     p_submodule->psz_longname = desc