51 self->interface = iface;
53 self->plugin = plugin;
67 REQUIRE (self->refcnt == 0);
79 TRACE (interfaceregistry_dbg);
100 TRACE (interfaceregistry_dbg);
121 TRACE (interfaceregistry_dbg);
126 TRACE (interfaceregistry,
"interface %s, version %d, instance %s", self->interface, self->version, self->name);
135 TRACE (interfaceregistry_dbg);
142 TRACE (interfaceregistry,
"interface %s, version %d, instance %s", (*self)->interface, (*self)->version, (*self)->name);
153 TRACE (interfaceregistry_dbg);
158 TRACE (interfaceregistry,
"interface %s, version %d, instance %s", self->interface, self->version, self->name);
160 REQUIRE (node->refcnt == 0,
"but is %d", node->refcnt);
170 TRACE (interfaceregistry_dbg);
177 TRACE (interfaceregistry,
"interface %s, version %d, instance %s", (*self)->interface, (*self)->version, (*self)->name);
182 REQUIRE (node->refcnt == 0,
"but is %d", node->refcnt);
190 WARN (interfaceregistry,
"ENTRY NOT FOUND in interfaceregistry at clean-up of interface %s, instance %s"
204 TRACE (interfaceregistry_dbg);
234 int r = strcmp (a->interface, b->interface);
240 if (a->version < b->version)
242 else if (a->version > b->version)
245 r = strcmp (a->name, b->name);
Lumiera error handling (C interface).
#define LUMIERA_DIE(err)
Abort unconditionally with a 'Fatal Error!' message.
void lumiera_interface_destroy(void)
deregistering implementations of the above interface
lumiera_interface * LumieraInterface
void lumiera_interface_init(void)
registering implementations of the above interface
void lumiera_interfaceregistry_register_interface(LumieraInterface self, LumieraPlugin plugin)
static LumieraInterfacenode lumiera_interfacenode_new(LumieraInterface iface, LumieraPlugin plugin)
void lumiera_interfaceregistry_init(void)
Initialise the interface registry.
LumieraInterfacenode lumiera_interfaceregistry_interfacenode_find(const char *interface, unsigned version, const char *name)
static void lumiera_interfacenode_delete(LumieraInterfacenode self)
void lumiera_interfaceregistry_remove_interface(LumieraInterface self)
lumiera_recmutex lumiera_interface_mutex
void lumiera_interfaceregistry_bulkremove_interfaces(LumieraInterface *self)
LumieraInterface lumiera_interfaceregistry_interface_find(const char *interface, unsigned version, const char *name)
void lumiera_interfaceregistry_destroy(void)
PSplay lumiera_interfaceregistry
static int lumiera_interface_cmp_fn(const void *keya, const void *keyb)
void lumiera_interfaceregistry_bulkregister_interfaces(LumieraInterface *self, LumieraPlugin plugin)
PSplay lumiera_pluginregistry
static const void * lumiera_interface_key_fn(const PSplaynode node)
Global registry for interfaces (extension points).
lumiera_interfacenode * LumieraInterfacenode
const_LList llist_cmpfn cmp
This header is for including and configuring NoBug.
void lumiera_plugin_delete_fn(PSplaynode node)
const void * lumiera_plugin_key_fn(const PSplaynode node)
int lumiera_plugin_cmp_fn(const void *keya, const void *keyb)
Lumiera plugins define 'interfaces' as shown in interface.h, the plugin system handles the loading of...
lumiera_plugin * LumieraPlugin
void psplay_delete(PSplay self)
Delete a splay tree Frees all elements and associated resources of a splay tree and then itseld.
PSplay psplay_destroy(PSplay self)
Destroy a splay tree Frees all elements and associated resources of a splay tree.
PSplaynode psplay_insert(PSplay self, PSplaynode node, int splayfactor)
Insert a element into a splay tree.
PSplay psplay_new(psplay_cmp_fn cmp, psplay_key_fn key, psplay_delete_fn del)
Allocate a splay tree.
PSplaynode psplaynode_init(PSplaynode self)
Initialise a splay tree node The user has to place this nodes within his datastructure and must Initi...
PSplaynode psplay_remove(PSplay self, PSplaynode node)
Remove a node from a splay tree.
PSplaynode psplay_find(PSplay self, const void *key, int splayfactor)
Find a element in a splay tree.
Probabilistic splay tree.
static size_t psplay_nelements(PSplay self)
Number of elements in tree.
LumieraRecmutex lumiera_recmutex_init(LumieraRecmutex self, const char *purpose, struct nobug_flag *flag, const struct nobug_context ctx)
Initialise a recursive mutex variable Initialises a 'recursive' mutex which might be locked by the sa...
LumieraRecmutex lumiera_recmutex_destroy(LumieraRecmutex self, struct nobug_flag *flag, const struct nobug_context ctx)
Destroy a recursive mutex variable.
#define LUMIERA_RECMUTEX_SECTION(nobugflag, mtx)
Recursive Mutual exclusive section.
void * lumiera_malloc(size_t size)
Allocate memory.
Portable and safe wrappers around some C-Lib functions.
static void lumiera_free(void *mem)
Free previously allocated memory.
Header for an interface, just the absolute necessary metadata.
unsigned version
major version, 0 means experimental
const char * interface
name of the interface (type)
const char * name
name of this instance