]> git.sesse.net Git - vlc/blobdiff - include/modules_inner.h
Forward-port [15539]
[vlc] / include / modules_inner.h
index af6e618ada07234d2770938731230e03f19d7364..6cbdd05c2b0a3b13f387c5d4e93a1453d9e2e99a 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * modules_inner.h : Macros used from within a module.
  *****************************************************************************
- * Copyright (C) 2001 the VideoLAN team
+ * Copyright (C) 2001-2006 the VideoLAN team
  * $Id$
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  * 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
 
     {                                                                         \
         int i_shortcut = 1, i_config = -1;                                    \
         module_config_t *p_config = NULL;                                     \
-        static module_config_t config_end = {CONFIG_HINT_END};            \
+        static module_config_t config_end = {                                 \
+            CONFIG_HINT_END, NULL, NULL, 0, NULL, NULL, NULL, 0, 0., 0, 0,    \
+            0., 0., NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0, NULL,     \
+            VLC_FALSE, NULL, VLC_FALSE, VLC_FALSE, NULL, 0, 0., NULL, 0, 0.,  \
+            VLC_FALSE                                                         \
+        };                                                                    \
         STORE_SYMBOLS;                                                        \
         p_module->b_submodule = VLC_FALSE;                                    \
         p_module->b_unloadable = VLC_TRUE;                                    \
         }                                                                     \
         if( p_config )                                                        \
         {                                                                     \
+            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, &config_end );                       \