X-Git-Url: https://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=blobdiff_plain;f=src%2Fmodules%2Fmodules.h;h=969a6a82f8410d0e93bafcb06d5f0a851a5fcff3;hp=13be2640085c0ef795b63f3e8ec926f56bbdd9a0;hb=264a446cdf82baafb2ee7514f9567b9a35852ac3;hpb=a1e8379fef3609a6ab791d1acc1d597962968ccf;ds=sidebyside diff --git a/src/modules/modules.h b/src/modules/modules.h index 13be264008..969a6a82f8 100644 --- a/src/modules/modules.h +++ b/src/modules/modules.h @@ -70,6 +70,84 @@ struct module_cache_t vlc_bool_t b_used; }; + +#define MODULE_SHORTCUT_MAX 50 + +/* The module handle type. */ +#if defined(HAVE_DL_DYLD) +# if defined (HAVE_MACH_O_DYLD_H) +# include +# endif +typedef NSModule module_handle_t; +#elif defined(HAVE_IMAGE_H) +typedef int module_handle_t; +#elif defined(WIN32) || defined(UNDER_CE) +typedef void * module_handle_t; +#elif defined(HAVE_DL_DLOPEN) +typedef void * module_handle_t; +#elif defined(HAVE_DL_SHL_LOAD) +typedef shl_t module_handle_t; +#endif + +/** + * Internal module descriptor + */ +struct module_t +{ + VLC_COMMON_MEMBERS + + /* + * Variables set by the module to identify itself + */ + const char *psz_shortname; /**< Module name */ + const char *psz_longname; /**< Module descriptive name */ + const char *psz_help; /**< Long help string for "special" modules */ + + /* + * Variables set by the module to tell us what it can do + */ + const char *psz_program; /**< Program name which will activate the module */ + + /** Shortcuts to the module */ + const char *pp_shortcuts[ MODULE_SHORTCUT_MAX ]; + + const char *psz_capability; /**< Capability */ + int i_score; /**< Score for the capability */ + uint32_t i_cpu; /**< Required CPU capabilities */ + + vlc_bool_t b_unloadable; /**< Can we be dlclosed? */ + vlc_bool_t b_reentrant; /**< Are we reentrant? */ + vlc_bool_t b_submodule; /**< Is this a submodule? */ + + /* Callbacks */ + int ( * pf_activate ) ( vlc_object_t * ); + void ( * pf_deactivate ) ( vlc_object_t * ); + + /* + * Variables set by the module to store its config options + */ + module_config_t *p_config; /* Module configuration structure */ + size_t confsize; /* Number of module_config_t items */ + unsigned int i_config_items; /* number of configuration items */ + unsigned int i_bool_items; /* number of bool config items */ + + /* + * Variables used internally by the module manager + */ + /* Plugin-specific stuff */ + module_handle_t handle; /* Unique handle */ + char * psz_filename; /* Module filename */ + + vlc_bool_t b_builtin; /* Set to true if the module is built in */ + vlc_bool_t b_loaded; /* Set to true if the dll is loaded */ + +#ifndef HAVE_SHARED_LIBVLC + /* Legacy symbols table */ + module_symbols_t *p_symbols; +#endif +}; + + #define module_InitBank(a) __module_InitBank(VLC_OBJECT(a)) void __module_InitBank ( vlc_object_t * ); #define module_LoadBuiltins(a) __module_LoadBuiltins(VLC_OBJECT(a))