MacOS: remove some callbacks
[vlc.git] / src / modules / modules.h
blob91c29614a25f890f5bb4d7ec6e23d075d6e900e0
1 /*****************************************************************************
2 * modules.h : Module management functions.
3 *****************************************************************************
4 * Copyright (C) 2001 the VideoLAN team
5 * $Id$
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 *****************************************************************************/
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 /** Main module */
53 int vlc_entry__main (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 int vlc_bindtextdomain (const char *);
115 /* Low-level OS-dependent handler */
116 int module_Load (vlc_object_t *, const char *, module_handle_t *, bool);
117 void *module_Lookup (module_handle_t, const char *);
118 void module_Unload (module_handle_t);
120 /* Plugins cache */
121 void CacheMerge (vlc_object_t *, module_t *, module_t *);
122 void CacheDelete(vlc_object_t *, const char *);
123 size_t CacheLoad (vlc_object_t *, const char *, module_cache_t **);
124 int CacheAdd (module_cache_t **, size_t *,
125 const char *, const struct stat *, module_t *);
126 void CacheSave (vlc_object_t *, const char *, module_cache_t *, size_t);
127 module_t *CacheFind (module_cache_t *, size_t,
128 const char *, const struct stat *);
130 #endif /* !LIBVLC_MODULES_H */