35 LUMIERA_INTERFACE_SLOT (
void, foo1, (
const char*)),
36 LUMIERA_INTERFACE_SLOT (
void, bar1, (
const char*)),
40 LUMIERA_INTERFACE_SLOT (
void, foo2, (
const char*)),
41 LUMIERA_INTERFACE_SLOT (
void, bar2, (
const char*)),
55 ECHO (
"Called as '%s'", message);
64 ECHO (
"Acquire %s_%d_%s", self->interface, self->version, self->name);
72 ECHO (
"Release %s_%d_%s", self->interface, self->version, self->name);
80 lumieraorg_tests_descriptor,
85 LUMIERA_INTERFACE_INLINE (name,
87 {(void)iface;
return "LumieraTest";}
89 LUMIERA_INTERFACE_INLINE (brief,
91 {(void)iface;
return "Lumiera Test suite examples";}
93 LUMIERA_INTERFACE_INLINE (homepage,
95 {(void)iface;
return "http://www.lumiera.org/develompent.html";}
97 LUMIERA_INTERFACE_INLINE (version,
99 {(void)iface;
return "No Version";}
101 LUMIERA_INTERFACE_INLINE (author,
103 {(void)iface;
return "Christian Thaeter";}
105 LUMIERA_INTERFACE_INLINE (email,
107 {(void)iface;
return "ct@pipapo.org";}
109 LUMIERA_INTERFACE_INLINE (copyright,
115 " 2008, Christian Thaeter <ct@pipapo.org>";
118 LUMIERA_INTERFACE_INLINE (license,
123 "**Lumiera** is free software; you can redistribute it and/or modify it\n"
124 "under the terms of the GNU General Public License as published by the\n"
125 "Free Software Foundation; either version 2 of the License, or (at your\n"
126 "option) any later version. See the file COPYING for further details."
131 LUMIERA_INTERFACE_INLINE (state,
136 LUMIERA_INTERFACE_INLINE (versioncmp,
137 int, (
const char* a,
const char* b),
138 {(void)a;(void)b;
return 0;}
166 ECHO (
"Acquire one %s_%d_%s", self->interface, self->version, self->name);
167 one_keeps_two =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_two);
168 one_keeps_three =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_three);
175 ECHO (
"Release one %s_%d_%s", self->interface, self->version, self->name);
187 ECHO (
"Acquire two %s_%d_%s", self->interface, self->version, self->name);
188 two_keeps_one =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_one);
189 two_keeps_four =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_four);
196 ECHO (
"Release two %s_%d_%s", self->interface, self->version, self->name);
208 ECHO (
"Acquire three %s_%d_%s", self->interface, self->version, self->name);
209 three_keeps_two =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_two);
210 three_keeps_four =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_four);
217 ECHO (
"Release three %s_%d_%s", self->interface, self->version, self->name);
230 ECHO (
"Acquire four %s_%d_%s", self->interface, self->version, self->name);
231 four_keeps_one =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_one);
232 four_keeps_two =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_two);
233 four_keeps_three =
LUMIERA_INTERFACE_OPEN (lumieraorg_testexample_void, 0, 0, lumieraorg_dependencytest_three);
240 ECHO (
"Release four %s_%d_%s", self->interface, self->version, self->name);
248 LUMIERA_INTERFACE_DEFINE (lumieraorg_testexample_one, 0,
249 lumieraorg_first_test,
253 LUMIERA_INTERFACE_MAP (foo1,
255 LUMIERA_INTERFACE_MAP (bar1,
258 LUMIERA_INTERFACE_DEFINE (lumieraorg_testexample_two, 0,
259 lumieraorg_second_test,
263 LUMIERA_INTERFACE_MAP (foo2,
265 LUMIERA_INTERFACE_MAP (bar2,
268 LUMIERA_INTERFACE_DEFINE (lumieraorg_testexample_void, 0,
269 lumieraorg_dependencytest_one,
274 LUMIERA_INTERFACE_DEFINE (lumieraorg_testexample_void, 0,
275 lumieraorg_dependencytest_two,
280 LUMIERA_INTERFACE_DEFINE (lumieraorg_testexample_void, 0,
281 lumieraorg_dependencytest_three,
286 LUMIERA_INTERFACE_DEFINE (lumieraorg_testexample_void, 0,
287 lumieraorg_dependencytest_four,
315 handle2->foo2 (
"this is foo2");
330 handle->bar1 (
"this is bar1");
347 ECHO (
"Sucessfully opened");
365 ECHO (
"Sucessfully opened");
382 ECHO (
"Sucessfully opened");
400 ECHO (
"Sucessfully opened");
423 CHECK (handle_three);
435 ECHO (
"Sucessfully OPENED");
443 ECHO (
"CLOSE three");
480 printf (
"plugin discovered before unload: %p\n", p);
481 CHECK (p,
"prerequisite: need to load test-c-plugin.lum");
485 printf (
"plugin discovered after unload: %p\n", p);
486 CHECK (!p,
"failed to unload plugin.");
497 TODO (
"macro to derive minminor version from a slot");
506 german->goodbye (
"Welt!");
509 english->goodbye (
"World!");
517TEST (plugin_exampleplugin_nested)
548 german->goodbye (
"schnöde Welt!");
551 english->goodbye (
"Vale of Tears!");
void lumiera_config_interface_destroy(void)
void lumiera_config_interface_init(void)
External interface to the lumiera configuration system.
Interface for a lumiera configuration system (draft).
lumiera_err lumiera_error(void)
Get and clear current error state.
A data record to describe interface, interface instances and plug-in instances.
@ LUMIERA_INTERFACE_EXPERIMENTAL
Not finished development code.
void lumiera_interface_close(LumieraInterface self)
Close an interface after use.
Lumiera interface macros and structures.
#define LUMIERA_INTERFACE_REF(iname, version, dname)
Return a reference (pointer) to an interface implementation.
#define LUMIERA_INTERFACE_DECLARE(name, version,...)
Declare an interface.
#define LUMIERA_INTERFACE_UNREGISTEREXPORTED
Unregister all exported interfaces when not a plugin This is a no-op when LUMIERA_PLUGIN is defined,...
#define LUMIERA_EXPORT(...)
Generate interface container suitable for enumerating interfaces.
#define LUMIERA_INTERFACE_REGISTEREXPORTED
Register all exported interfaces when not a plugin This is a no-op when LUMIERA_PLUGIN is defined,...
#define LUMIERA_INTERFACE_INSTANCE(iname, version, name, descriptor, acquire, release,...)
Define an interface instance.
#define LUMIERA_INTERFACE_CAST(name, version)
Construct a cast to the target interface type Used to cast a generic LumieraInterface to the real typ...
#define LUMIERA_INTERFACE_CLOSE(handle)
#define LUMIERA_INTERFACE_TYPE(name, version)
Construct the type of the interface.
#define LUMIERA_INTERFACE_OPEN(interface, version, minminor, name)
lumiera_interface * LumieraInterface
#define LUMIERA_INTERFACE_HANDLE(interface, version)
create a handle for a interface (WIP)
void lumiera_interfaceregistry_init(void)
Initialise the interface registry.
LumieraInterface lumiera_interfaceregistry_interface_find(const char *interface, unsigned version, const char *name)
void lumiera_interfaceregistry_destroy(void)
void lumiera_interfaceregistry_bulkregister_interfaces(LumieraInterface *self, LumieraPlugin plugin)
Global registry for interfaces (extension points).
Test runner and basic definitions for tests.
LumieraPlugin lumiera_plugin_lookup(const char *name)
Lookup a plugin handle in the pluginregistry.
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.
int lumiera_plugin_register(LumieraPlugin plugin)
Register a plugin and its interfaces.
const char * lumiera_plugin_name(LumieraPlugin self)
Query the plugin name The name is the path and filename under which it was loaded.
unsigned lumiera_plugin_unload(LumieraPlugin self)
Tries to unload a plugin.
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...
lumiera_plugin * LumieraPlugin
A mock interface to support testing of the interface system.
void testrelease(LumieraInterface self)
void testrelease_three(LumieraInterface self)
void testfunc(const char *message)
LumieraInterface testacquire(LumieraInterface self, LumieraInterface interface)
void testrelease_one(LumieraInterface self)
void testrelease_four(LumieraInterface self)
void testrelease_two(LumieraInterface self)
Helpers and support macros for defining test executables in C.