X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fmodules_inner.h;h=9cab60a6c8ed9d411af983ec58518f8459bcff4e;hb=8b61d4ef6120a68ea9e4dd3865d6a35d11965e2c;hp=904b3576bfe36ccf6ecdf67353dbb798fecd85e2;hpb=7f00f3bf4aff9ac5ccaa122c82cc747b2adf3cce;p=vlc diff --git a/include/modules_inner.h b/include/modules_inner.h index 904b3576bf..9cab60a6c8 100644 --- a/include/modules_inner.h +++ b/include/modules_inner.h @@ -2,7 +2,7 @@ * modules_inner.h : Macros used from within a module. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules_inner.h,v 1.36 2003/01/06 00:37:29 garf Exp $ + * $Id$ * * Authors: Samuel Hocevar * @@ -10,7 +10,7 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -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 @@ -91,13 +91,15 @@ EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \ __VLC_SYMBOL(vlc_entry) ( module_t *p_module ) \ { \ - int i_shortcut = 1, i_config = 0; \ - module_config_t p_config[ 100 ]; \ + 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 = MODULE_STRING; \ p_module->psz_longname = MODULE_STRING; \ p_module->pp_shortcuts[ 0 ] = MODULE_STRING; \ p_module->i_cpu = 0; \ @@ -112,17 +114,18 @@ #define vlc_module_end( ) \ p_submodule->pp_shortcuts[ i_shortcut ] = NULL; \ } \ + if( p_config ) \ { \ - static module_config_t tmp = { CONFIG_HINT_END, NULL, NULL, '\0', \ - NULL, NULL, NULL, 0, 0.0, 0, 0, 0.0, 0.0, NULL,NULL, NULL, VLC_FALSE }; \ - p_config[ i_config ] = tmp; \ + p_config[ ++i_config ] = config_end; \ + config_Duplicate( p_module, p_config ); \ + free( p_config ); \ } \ - config_Duplicate( p_module, p_config ); \ + else config_Duplicate( p_module, &config_end ); \ if( p_module->p_config == NULL ) \ { \ - return -1; \ + return VLC_EGENERIC; \ } \ - return 0 && i_shortcut; \ + return VLC_SUCCESS && i_shortcut; \ } \ struct _u_n_u_s_e_d_ /* the ; gets added */ @@ -140,6 +143,7 @@ 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; \ @@ -147,7 +151,7 @@ p_submodule->i_cpu = p_module->i_cpu; \ p_submodule->pf_activate = NULL; \ p_submodule->pf_deactivate = NULL - + #define add_requirement( cap ) \ p_module->i_cpu |= CPU_CAPABILITY_##cap @@ -155,6 +159,9 @@ 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