Lumiera  0.pre.03
»edit your freedom«
plugin.h
Go to the documentation of this file.
1 /*
2  PLUGIN.h - Plugin loader
3 
4  Copyright (C)
5  2008, Christian Thaeter <ct@pipapo.org>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
41 #ifndef COMMON_PLUGIN_H
42 #define COMMON_PLUGIN_H
43 
44 #include "lib/psplay.h"
45 #include "lib/error.h"
46 
47 #include "common/interface.h"
48 
49 #include <stdlib.h>
50 #include <nobug.h>
51 
52 
53 LUMIERA_ERROR_DECLARE(PLUGIN_INIT);
54 LUMIERA_ERROR_DECLARE(PLUGIN_OPEN);
55 LUMIERA_ERROR_DECLARE(PLUGIN_WTF);
56 LUMIERA_ERROR_DECLARE(PLUGIN_REGISTER);
57 LUMIERA_ERROR_DECLARE(PLUGIN_VERSION);
58 
59 
60 
61 
63 typedef struct lumiera_plugin_struct lumiera_plugin;
64 typedef lumiera_plugin* LumieraPlugin;
65 
66 
73 LumieraPlugin
74 lumiera_plugin_new (const char* name);
75 
84 LumieraPlugin
85 lumiera_plugin_init (LumieraPlugin self, void* handle, LumieraInterface plugin);
86 
87 
95 LumieraPlugin
96 lumiera_plugin_load (const char* plugin);
97 
98 
108 int
109 lumiera_plugin_register (LumieraPlugin self);
110 
111 
117 lumiera_err
118 lumiera_plugin_error (LumieraPlugin self);
119 
125 void*
126 lumiera_plugin_handle (LumieraPlugin self);
127 
128 
135 const char*
136 lumiera_plugin_name (LumieraPlugin self);
137 
138 
143 void
144 lumiera_plugin_refinc (LumieraPlugin self);
145 
146 
151 void
152 lumiera_plugin_refdec (LumieraPlugin self);
153 
154 
161 unsigned
162 lumiera_plugin_unload (LumieraPlugin self);
163 
164 
170 LumieraPlugin
171 lumiera_plugin_lookup (const char* name);
172 
173 
180 int
181 lumiera_plugin_discover (LumieraPlugin (*callback_load)(const char* plugin),
182  int (*callback_register) (LumieraPlugin));
183 
184 
185 /* === psplay support functions === */
186 
187 int
188 lumiera_plugin_cmp_fn (const void* keya, const void* keyb);
189 
190 const void*
191 lumiera_plugin_key_fn (const PSplaynode node);
192 
193 void
194 lumiera_plugin_delete_fn (PSplaynode node);
195 
196 
197 
198 #endif /*COMMON_PLUGIN_H*/
unsigned lumiera_plugin_unload(LumieraPlugin self)
Tries to unload a plugin.
Definition: plugin.c:297
int lumiera_plugin_register(LumieraPlugin self)
Register a plugin and its interfaces.
Definition: plugin.c:260
void * lumiera_plugin_handle(LumieraPlugin self)
Query the plugin handle.
Definition: plugin.c:157
int lumiera_plugin_discover(LumieraPlugin(*callback_load)(const char *plugin), int(*callback_register)(LumieraPlugin))
discover new plugins traverses the configured plugin paths and calls the callback_load function for a...
Definition: plugin.c:187
void lumiera_plugin_refdec(LumieraPlugin self)
Definition: plugin.c:179
void lumiera_plugin_refinc(LumieraPlugin self)
Definition: plugin.c:172
LumieraPlugin lumiera_plugin_lookup(const char *name)
Lookup a plugin handle in the pluginregistry.
Definition: plugin.c:338
lumiera_err lumiera_plugin_error(LumieraPlugin self)
Query the error state of a plugin.
Definition: plugin.c:149
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Definition: error.h:62
Lumiera error handling (C interface).
Lumiera interface macros and structures.
Probabilistic splay tree.
LumieraPlugin lumiera_plugin_new(const char *name)
Allocates an preinitialises a plugin structure.
Definition: plugin.c:123
const char * lumiera_plugin_name(LumieraPlugin self)
Query the plugin name The name is the path and filename under which it was loaded.
Definition: plugin.c:165
LumieraPlugin lumiera_plugin_load(const char *plugin)
Tries to load a plugin Creates a new plugin structure and tries to load and initialise the plugin...
Definition: plugin.c:241
ElementBoxWidget::Config::Qualifier name(string id)
define the name-ID displayed in the caption
LumieraPlugin lumiera_plugin_init(LumieraPlugin self, void *handle, LumieraInterface plugin)
Definition: plugin.c:139