vlc_modules.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_modules.h : Module descriptor and load functions
00003  *****************************************************************************
00004  * Copyright (C) 2001-2011 VLC authors and VideoLAN
00005  * $Id: d152f256bd9c66e0b14647981b55244fb49ff00e $
00006  *
00007  * Authors: Samuel Hocevar <sam@zoy.org>
00008  *
00009  * This program is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU Lesser General Public License as published by
00011  * the Free Software Foundation; either version 2.1 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017  * GNU Lesser General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU Lesser General Public License
00020  * along with this program; if not, write to the Free Software Foundation,
00021  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 /**
00025  * \file
00026  * This file defines functions for modules in vlc
00027  */
00028 
00029 typedef int (*vlc_activate_t)(void *func, va_list args);
00030 typedef void (*vlc_deactivate_t)(void *func, va_list args);
00031 
00032 /*****************************************************************************
00033  * Exported functions.
00034  *****************************************************************************/
00035 
00036 VLC_API module_t * vlc_module_load( vlc_object_t *obj, const char *cap, const char *name, bool strict, vlc_activate_t probe, ... ) VLC_USED;
00037 #define vlc_module_load(o,c,n,s,...) \
00038         vlc_module_load(VLC_OBJECT(o),c,n,s,__VA_ARGS__)
00039 VLC_API void vlc_module_unload( module_t *, vlc_deactivate_t deinit, ... );
00040 
00041 VLC_API module_t * module_need( vlc_object_t *, const char *, const char *, bool ) VLC_USED;
00042 #define module_need(a,b,c,d) module_need(VLC_OBJECT(a),b,c,d)
00043 VLC_API void module_unneed( vlc_object_t *, module_t * );
00044 #define module_unneed(a,b) module_unneed(VLC_OBJECT(a),b)
00045 VLC_API bool module_exists(const char *) VLC_USED;
00046 VLC_API module_t * module_find(const char *) VLC_USED;
00047 
00048 int module_start(vlc_object_t *, const module_t *);
00049 #define module_start(o, m) module_start(VLC_OBJECT(o),m)
00050 void module_stop(vlc_object_t *, const module_t *);
00051 #define module_stop(o, m) module_stop(VLC_OBJECT(o),m)
00052 
00053 VLC_API module_config_t * module_config_get( const module_t *, unsigned * ) VLC_USED;
00054 VLC_API void module_config_free( module_config_t * );
00055 
00056 VLC_API void module_list_free(module_t **);
00057 VLC_API module_t ** module_list_get(size_t *n) VLC_USED;
00058 
00059 VLC_API bool module_provides( const module_t *m, const char *cap );
00060 VLC_API const char * module_get_object( const module_t *m ) VLC_USED;
00061 VLC_API const char * module_get_name( const module_t *m, bool long_name ) VLC_USED;
00062 #define module_GetLongName( m ) module_get_name( m, true )
00063 VLC_API const char * module_get_help( const module_t *m ) VLC_USED;
00064 VLC_API const char * module_get_capability( const module_t *m ) VLC_USED;
00065 VLC_API int module_get_score( const module_t *m ) VLC_USED;
00066 VLC_API const char * module_gettext( const module_t *, const char * ) VLC_USED;
00067 
00068 VLC_USED static inline module_t *module_get_main (void)
00069 {
00070     return module_find ("main");
00071 }
00072 #define module_get_main(a) module_get_main()
00073 
00074 VLC_USED static inline bool module_is_main( const module_t * p_module )
00075 {
00076     return !strcmp( module_get_object( p_module ), "main" );
00077 }
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines