1 /*****************************************************************************
2 * modules.h : Module management functions.
3 *****************************************************************************
4 * Copyright (C) 2001 the VideoLAN team
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef LIBVLC_MODULES_H
25 # define LIBVLC_MODULES_H 1
27 typedef struct module_cache_t module_cache_t;
29 /*****************************************************************************
30 * Module cache description structure
31 *****************************************************************************/
34 /* Mandatory cache entry header */
39 /* Optional extra data */
44 #define MODULE_SHORTCUT_MAX 20
46 /** The module handle type */
47 typedef void *module_handle_t;
49 typedef module_t *(*vlc_plugin_cb) (void);
52 * Internal module descriptor
59 unsigned submodule_count;
61 /** Shortcuts to the module */
66 * Variables set by the module to identify itself
68 char *psz_shortname; /**< Module name */
69 char *psz_longname; /**< Module descriptive name */
70 char *psz_help; /**< Long help string for "special" modules */
72 char *psz_capability; /**< Capability */
73 int i_score; /**< Score for the capability */
75 bool b_loaded; /* Set to true if the dll is loaded */
76 bool b_unloadable; /**< Can we be dlclosed? */
83 * Variables set by the module to store its config options
85 module_config_t *p_config; /* Module configuration structure */
86 size_t confsize; /* Number of module_config_t items */
87 unsigned int i_config_items; /* number of configuration items */
88 unsigned int i_bool_items; /* number of bool config items */
91 * Variables used internally by the module manager
93 /* Plugin-specific stuff */
94 module_handle_t handle; /* Unique handle */
95 char * psz_filename; /* Module filename */
96 char * domain; /* gettext domain */
99 module_t *vlc_module_create (module_t *);
100 void vlc_module_destroy (module_t *);
102 void module_InitBank (void);
103 void module_LoadPlugins( vlc_object_t * );
104 #define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
105 void module_EndBank (bool);
106 int module_Map (vlc_object_t *, module_t *);
108 int vlc_bindtextdomain (const char *);
110 /* Low-level OS-dependent handler */
111 int module_Load (vlc_object_t *, const char *, module_handle_t *, bool);
112 void *module_Lookup (module_handle_t, const char *);
113 void module_Unload (module_handle_t);
116 void CacheMerge (vlc_object_t *, module_t *, module_t *);
117 void CacheDelete(vlc_object_t *, const char *);
118 size_t CacheLoad (vlc_object_t *, const char *, module_cache_t **);
119 int CacheAdd (module_cache_t **, size_t *,
120 const char *, const struct stat *, module_t *);
121 void CacheSave (vlc_object_t *, const char *, module_cache_t *, size_t);
122 module_t *CacheFind (module_cache_t *, size_t,
123 const char *, const struct stat *);
125 #endif /* !LIBVLC_MODULES_H */