fdkaac: set channel configuration
[vlc/gmpfix.git] / src / modules / modules.h
blobe38e9524c1bf51ed0ac8e6da61759bb169b53b4c
1 /*****************************************************************************
2 * modules.h : Module management functions.
3 *****************************************************************************
4 * Copyright (C) 2001 VLC authors and VideoLAN
5 * $Id$
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * 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 *****************************************************************************/
32 struct module_cache_t
34 /* Mandatory cache entry header */
35 char *path;
36 time_t mtime;
37 off_t size;
39 /* Optional extra data */
40 module_t *p_module;
44 #define MODULE_SHORTCUT_MAX 20
46 /** The module handle type */
47 typedef void *module_handle_t;
49 /** Plugin entry point prototype */
50 typedef int (*vlc_plugin_cb) (int (*)(void *, void *, int, ...), void *);
52 /** Core module */
53 int vlc_entry__core (int (*)(void *, void *, int, ...), void *);
55 /**
56 * Internal module descriptor
58 struct module_t
60 module_t *next;
61 module_t *parent;
62 module_t *submodule;
63 unsigned submodule_count;
65 /** Shortcuts to the module */
66 unsigned i_shortcuts;
67 char **pp_shortcuts;
70 * Variables set by the module to identify itself
72 char *psz_shortname; /**< Module name */
73 char *psz_longname; /**< Module descriptive name */
74 char *psz_help; /**< Long help string for "special" modules */
76 char *psz_capability; /**< Capability */
77 int i_score; /**< Score for the capability */
79 bool b_loaded; /* Set to true if the dll is loaded */
80 bool b_unloadable; /**< Can we be dlclosed? */
82 /* Callbacks */
83 void *pf_activate;
84 void *pf_deactivate;
87 * Variables set by the module to store its config options
89 module_config_t *p_config; /* Module configuration structure */
90 size_t confsize; /* Number of module_config_t items */
91 unsigned int i_config_items; /* number of configuration items */
92 unsigned int i_bool_items; /* number of bool config items */
95 * Variables used internally by the module manager
97 /* Plugin-specific stuff */
98 module_handle_t handle; /* Unique handle */
99 char * psz_filename; /* Module filename */
100 char * domain; /* gettext domain */
103 module_t *vlc_plugin_describe (vlc_plugin_cb);
104 module_t *vlc_module_create (module_t *);
105 void vlc_module_destroy (module_t *);
107 void module_InitBank (void);
108 size_t module_LoadPlugins( vlc_object_t * );
109 #define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
110 void module_EndBank (bool);
111 int module_Map (vlc_object_t *, module_t *);
113 ssize_t module_list_cap (module_t ***, const char *);
115 int vlc_bindtextdomain (const char *);
117 /* Low-level OS-dependent handler */
118 int module_Load (vlc_object_t *, const char *, module_handle_t *, bool);
119 void *module_Lookup (module_handle_t, const char *);
120 void module_Unload (module_handle_t);
122 /* Plugins cache */
123 void CacheMerge (vlc_object_t *, module_t *, module_t *);
124 void CacheDelete(vlc_object_t *, const char *);
125 size_t CacheLoad (vlc_object_t *, const char *, module_cache_t **);
127 struct stat;
129 int CacheAdd (module_cache_t **, size_t *,
130 const char *, const struct stat *, module_t *);
131 void CacheSave (vlc_object_t *, const char *, module_cache_t *, size_t);
132 module_t *CacheFind (module_cache_t *, size_t,
133 const char *, const struct stat *);
135 #endif /* !LIBVLC_MODULES_H */