00001 /* 00002 plugin.h - Plugin loader 00003 00004 Copyright (C) Lumiera.org 00005 2008, Christian Thaeter <ct@pipapo.org> 00006 00007 This program is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU General Public License as 00009 published by the Free Software Foundation; either version 2 of the 00010 License, or (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 #ifndef LUMIERA_PLUGIN_H 00022 #define LUMIERA_PLUGIN_H 00023 00024 #include "lib/psplay.h" 00025 #include "lib/error.h" 00026 00027 #include "backend/interface.h" 00028 00029 #include <stdlib.h> 00030 #include <nobug.h> 00031 00060 LUMIERA_ERROR_DECLARE(PLUGIN_INIT); 00061 LUMIERA_ERROR_DECLARE(PLUGIN_OPEN); 00062 LUMIERA_ERROR_DECLARE(PLUGIN_WTF); 00063 LUMIERA_ERROR_DECLARE(PLUGIN_REGISTER); 00064 LUMIERA_ERROR_DECLARE(PLUGIN_VERSION); 00065 00066 00067 NOBUG_DECLARE_FLAG (plugin); 00068 00069 /* tool macros*/ 00070 00071 00072 struct lumiera_plugin_struct; 00073 typedef struct lumiera_plugin_struct lumiera_plugin; 00074 typedef lumiera_plugin* LumieraPlugin; 00075 enum lumiera_plugin_type; 00076 00083 LumieraPlugin 00084 lumiera_plugin_new (const char* name); 00085 00095 LumieraPlugin 00096 lumiera_plugin_init (LumieraPlugin self, void* handle, LumieraInterface plugin); 00097 00098 00106 LumieraPlugin 00107 lumiera_plugin_load (const char* plugin); 00108 00109 00119 int 00120 lumiera_plugin_register (LumieraPlugin self); 00121 00122 00128 lumiera_err 00129 lumiera_plugin_error (LumieraPlugin self); 00130 00136 void* 00137 lumiera_plugin_handle (LumieraPlugin self); 00138 00139 00146 const char* 00147 lumiera_plugin_name (LumieraPlugin self); 00148 00149 00155 void 00156 lumiera_plugin_refinc (LumieraPlugin self); 00157 00158 00164 void 00165 lumiera_plugin_refdec (LumieraPlugin self); 00166 00167 00174 unsigned 00175 lumiera_plugin_unload (LumieraPlugin self); 00176 00177 00183 LumieraPlugin 00184 lumiera_plugin_lookup (const char* name); 00185 00186 00193 int 00194 lumiera_plugin_discover (LumieraPlugin (*callback_load)(const char* plugin), 00195 int (*callback_register) (LumieraPlugin)); 00196 00197 00198 /* psplay support functions */ 00199 int 00200 lumiera_plugin_cmp_fn (const void* keya, const void* keyb); 00201 00202 const void* 00203 lumiera_plugin_key_fn (const PSplaynode node); 00204 00205 void 00206 lumiera_plugin_delete_fn (PSplaynode node); 00207 00208 #endif /* LUMIERA_PLUGIN_H */
1.5.6