?? vlc_plugin.h
字號:
/***************************************************************************** * vlc_plugin.h : Macros used from within a module. ***************************************************************************** * Copyright (C) 2001-2006 the VideoLAN team * Copyright ? 2007-2008 Rémi Denis-Courmont * * Authors: Samuel Hocevar <sam@zoy.org> * * This program is free software; you can redistribute it and/or modify * 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 * GNU General Public License for more details. * * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/#ifndef LIBVLC_MODULES_MACROS_H# define LIBVLC_MODULES_MACROS_H 1/** * \file * This file implements plugin (module) macros used to define a vlc module. */VLC_EXPORT( module_t *, vlc_module_create, ( vlc_object_t * ) );VLC_EXPORT( module_t *, vlc_submodule_create, ( module_t * ) );VLC_EXPORT( int, vlc_module_set, (module_t *module, int propid, ...) );VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int type) );VLC_EXPORT( int, vlc_config_set, (module_config_t *, int, ...) );enum vlc_module_properties{ /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI! * Append new items at the end ONLY. */ VLC_MODULE_CPU_REQUIREMENT, VLC_MODULE_SHORTCUT, VLC_MODULE_SHORTNAME_NODOMAIN, VLC_MODULE_DESCRIPTION_NODOMAIN, VLC_MODULE_HELP_NODOMAIN, VLC_MODULE_CAPABILITY, VLC_MODULE_SCORE, VLC_MODULE_PROGRAM, /* obsoleted */ VLC_MODULE_CB_OPEN, VLC_MODULE_CB_CLOSE, VLC_MODULE_NO_UNLOAD, VLC_MODULE_NAME, VLC_MODULE_SHORTNAME, VLC_MODULE_DESCRIPTION, VLC_MODULE_HELP,};enum vlc_config_properties{ /* DO NOT EVER REMOVE, INSERT OR REPLACE ANY ITEM! It would break the ABI! * Append new items at the end ONLY. */ VLC_CONFIG_NAME, /* command line name (args=const char *, vlc_callback_t) */ VLC_CONFIG_DESC_NODOMAIN, /* description (args=const char *, const char *) */ VLC_CONFIG_VALUE, /* actual value (args=int/double/const char *) */ VLC_CONFIG_RANGE, /* minimum value (args=int/double/const char * twice) */ VLC_CONFIG_ADVANCED, /* enable advanced flag (args=none) */ VLC_CONFIG_VOLATILE, /* don't write variable to storage (args=none) */ VLC_CONFIG_PERSISTENT, /* always write variable to storage (args=none) */ VLC_CONFIG_RESTART, /* restart required to apply value change (args=none) */ VLC_CONFIG_PRIVATE, /* hide from user (args=none) */ VLC_CONFIG_REMOVED, /* tag as no longer supported (args=none) */ VLC_CONFIG_CAPABILITY, /* capability for a module or list thereof (args=const char*) */ VLC_CONFIG_SHORTCUT, /* one-character (short) command line option name (args=char) */ VLC_CONFIG_LIST_NODOMAIN, /* possible values list * (args=size_t, const <type> *, const char *const *) */ VLC_CONFIG_ADD_ACTION_NODOMAIN, /* add value change callback (args=vlc_callback_t, const char *) */ VLC_CONFIG_OLDNAME, /* former option name (args=const char *) */ VLC_CONFIG_SAFE, /* tag as modifiable by untrusted input item "sources" (args=none) */ VLC_CONFIG_DESC, /* description (args=const char *, const char *, const char *) */ VLC_CONFIG_LIST, /* possible values list * (args=const char *, size_t, const <type> *, const char *const *) */ VLC_CONFIG_ADD_ACTION, /* add value change callback * (args=const char *, vlc_callback_t, const char *) */};/***************************************************************************** * If we are not within a module, assume we're in the vlc core. *****************************************************************************/#if !defined( __PLUGIN__ ) && !defined( __BUILTIN__ )# define MODULE_NAME main#endif/** * Current plugin ABI version */# 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. *****************************************************************************//* Explanation: * * if linking a module statically, we will need: * #define MODULE_FUNC( zog ) module_foo_zog * * this can't easily be done with the C preprocessor, thus a few ugly hacks. *//* 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/* If the module is built-in, then we need to define foo_InitModule instead * of InitModule. Same for Activate- and DeactivateModule. */#ifdef __PLUGIN__# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_SYMBOL )#else# define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME )#endif#if defined( __PLUGIN__ ) && ( defined( WIN32 ) || defined( UNDER_CE ) )# define DLL_SYMBOL __declspec(dllexport)# define CDECL_SYMBOL __cdecl#else# define DLL_SYMBOL# define CDECL_SYMBOL#endif#if defined( __cplusplus )# define EXTERN_SYMBOL extern "C"#else# define EXTERN_SYMBOL#endif/* * InitModule: this function is called once and only once, when the module * is looked at for the first time. We get the useful data from it, for * 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. */#define vlc_module_begin( ) \ EXTERN_SYMBOL DLL_SYMBOL int CDECL_SYMBOL \ __VLC_SYMBOL(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; \ const char *domain = NULL; \ if (vlc_module_set (p_module, VLC_MODULE_NAME, \ (const char *)(MODULE_STRING))) \ goto error; \ { \ module_t *p_submodule = p_module;#define vlc_module_end( ) \ } \ (void)p_config; \ return VLC_SUCCESS; \ \ error: \ return VLC_EGENERIC; \ } \ VLC_METADATA_EXPORTS#define add_submodule( ) \ p_submodule = vlc_submodule_create( p_module );#define add_requirement( cap ) \ if (vlc_module_set (p_module, VLC_MODULE_CPU_REQUIREMENT, \ (int)(CPU_CAPABILITY_##cap))) \ goto error;#define add_shortcut( shortcut ) \ if (vlc_module_set (p_submodule, VLC_MODULE_SHORTCUT, \ (const char *)(shortcut))) \ goto error;#define set_shortname( shortname ) \ if (vlc_module_set (p_submodule, VLC_MODULE_SHORTNAME, domain, \ (const char *)(shortname))) \ goto error;#define set_description( desc ) \ if (vlc_module_set (p_submodule, VLC_MODULE_DESCRIPTION, domain, \ (const char *)(desc))) \ goto error;#define set_help( help ) \ if (vlc_module_set (p_submodule, VLC_MODULE_HELP, domain, \ (const char *)(help))) \ goto error;#define set_capability( cap, score ) \ if (vlc_module_set (p_submodule, VLC_MODULE_CAPABILITY, \ (const char *)(cap)) \ || vlc_module_set (p_submodule, VLC_MODULE_SCORE, (int)(score))) \ goto error;#define set_callbacks( activate, deactivate ) \
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -