Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Implementation: handling of interfaces (extension points).
From a programmers perspective interfaces only need to be opened when needed and closed when finished with them. There is no difference if the interface is internally provided by the core or provided by an external plugin. Interfaces can be opened multiple times and cross reference each other.
Definition in file interface.c.
#include "include/logging.h"
#include "lib/recmutex.h"
#include "lib/safeclib.h"
#include "common/plugin.h"
#include "common/interface.h"
#include "common/interfaceregistry.h"
#include <nobug.h>
Functions | |
static void | depwalk (LumieraInterfacenode self, LumieraInterfacenode *stack) |
LUMIERA_EXPORT (LUMIERA_INTERFACE_DEFINE(lumieraorg_interface, 0, lumieraorg_interface, NULL, NULL, NULL, LUMIERA_INTERFACE_MAP(open, lumiera_interface_open), LUMIERA_INTERFACE_MAP(close, lumiera_interface_close), LUMIERA_INTERFACE_MAP(version, lumiera_interface_version),)) | |
Definition of 'the mother of all interfaces' since this interface is singleton and required for any component to open any other interface this should get a very stable interface and likely never change. | |
void | lumiera_interface_close (LumieraInterface self) |
Close an interface after use. More... | |
void | lumiera_interface_destroy (void) |
deregistering implementations of the above interface | |
LumieraInterface | lumiera_interface_open (const char *interface, unsigned version, size_t minminorversion, const char *name) |
Open an interface by version and name. More... | |
static LumieraInterfacenode | lumiera_interface_open_interfacenode (LumieraInterfacenode self) |
unsigned | lumiera_interface_version (LumieraInterface self, const char *iname) |
Runtime check for interface type and version. More... | |
static void | lumiera_interfacenode_close (LumieraInterfacenode self) |
static void | push_dependency (LumieraInterfacenode parent, LumieraInterfacenode child) |
Variables | |
LumieraInterface | lumiera_interface_interface |
the mother of all interfaces | |
LumieraInterface lumiera_interface_open | ( | const char * | interface, |
unsigned | version, | ||
size_t | minminorversion, | ||
const char * | name | ||
) |
Open an interface by version and name.
Looks up the requested interface, possibly loading it from a plugin.
interface | name of the interface definition |
version | major version of the interface definition |
minminorversion | required minor version (structure size) |
name | name of the interface implementation |
Definition at line 49 of file interface.c.
void lumiera_interface_close | ( | LumieraInterface | self | ) |
Close an interface after use.
self | interface to be closed consider 'self' to be invalidated after this call |
Definition at line 226 of file interface.c.
References LUMIERA_RECMUTEX_SECTION.
Referenced by lumiera_interface_destroy().
unsigned lumiera_interface_version | ( | LumieraInterface | self, |
const char * | iname | ||
) |
Runtime check for interface type and version.
self | interface to check |
iname | name of the interface |
Definition at line 238 of file interface.c.