modules.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
00025 # error This header file can only be included from LibVLC.
00026 #endif
00027
00028 #ifndef LIBVLC_MODULES_H
00029 # define LIBVLC_MODULES_H 1
00030
00031
00032
00033
00034
00035
00036 struct module_bank_t
00037 {
00038 unsigned i_usage;
00039
00040
00041 bool b_cache;
00042 bool b_cache_dirty;
00043
00044 int i_cache;
00045 module_cache_t **pp_cache;
00046
00047 int i_loaded_cache;
00048 module_cache_t **pp_loaded_cache;
00049
00050 module_t *head;
00051 };
00052
00053
00054
00055
00056 struct module_cache_t
00057 {
00058
00059 char *psz_file;
00060 int64_t i_time;
00061 int64_t i_size;
00062
00063
00064 module_t *p_module;
00065 };
00066
00067
00068 #define MODULE_SHORTCUT_MAX 20
00069
00070
00071 #if defined(HAVE_DL_DYLD) && !defined(__x86_64__)
00072 # if defined (HAVE_MACH_O_DYLD_H)
00073 # include <mach-o/dyld.h>
00074 # endif
00075 typedef NSModule module_handle_t;
00076 #elif defined(HAVE_IMAGE_H)
00077 typedef int module_handle_t;
00078 #elif defined(WIN32) || defined(UNDER_CE)
00079 typedef void * module_handle_t;
00080 #elif defined(HAVE_DL_DLOPEN)
00081 typedef void * module_handle_t;
00082 #elif defined(HAVE_DL_SHL_LOAD)
00083 typedef shl_t module_handle_t;
00084 #endif
00085
00086
00087
00088
00089 struct module_t
00090 {
00091 char *psz_object_name;
00092 gc_object_t vlc_gc_data;
00093
00094 module_t *next;
00095 module_t *parent;
00096 module_t *submodule;
00097 unsigned submodule_count;
00098
00099
00100 unsigned i_shortcuts;
00101 char **pp_shortcuts;
00102
00103
00104
00105
00106 char *psz_shortname;
00107 char *psz_longname;
00108 char *psz_help;
00109
00110 char *psz_capability;
00111 int i_score;
00112
00113 bool b_builtin;
00114 bool b_loaded;
00115 bool b_unloadable;
00116 bool b_submodule;
00117
00118
00119 int ( * pf_activate ) ( vlc_object_t * );
00120 void ( * pf_deactivate ) ( vlc_object_t * );
00121
00122
00123
00124
00125 module_config_t *p_config;
00126 size_t confsize;
00127 unsigned int i_config_items;
00128 unsigned int i_bool_items;
00129
00130
00131
00132
00133
00134 module_handle_t handle;
00135 char * psz_filename;
00136 char * domain;
00137 };
00138
00139 module_t *vlc_module_create (vlc_object_t *);
00140 module_t *vlc_submodule_create (module_t *module);
00141
00142 void module_InitBank( vlc_object_t * );
00143 #define module_InitBank(a) module_InitBank(VLC_OBJECT(a))
00144 void module_LoadPlugins( vlc_object_t * );
00145 #define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
00146 void module_EndBank( vlc_object_t *, bool );
00147 #define module_EndBank(a,b) module_EndBank(VLC_OBJECT(a), b)
00148
00149 int vlc_bindtextdomain (const char *);
00150
00151
00152 int module_Load (vlc_object_t *, const char *, module_handle_t *);
00153 int module_Call (vlc_object_t *obj, module_t *);
00154 void module_Unload (module_handle_t);
00155
00156
00157 void CacheMerge (vlc_object_t *, module_t *, module_t *);
00158 void CacheDelete(vlc_object_t *, const char *);
00159 void CacheLoad (vlc_object_t *, module_bank_t *, const char *);
00160 void CacheSave (vlc_object_t *, const char *, module_cache_t *const *, size_t);
00161 module_cache_t * CacheFind (module_bank_t *, const char *, int64_t, int64_t);
00162
00163 #endif