* Lumiera source code always was copyrighted by individual contributors * there is no entity "Lumiera.org" which holds any copyrights * Lumiera source code is provided under the GPL Version 2+ == Explanations == Lumiera as a whole is distributed under Copyleft, GNU General Public License Version 2 or above. For this to become legally effective, the ''File COPYING in the root directory is sufficient.'' The licensing header in each file is not strictly necessary, yet considered good practice; attaching a licence notice increases the likeliness that this information is retained in case someone extracts individual code files. However, it is not by the presence of some text, that legally binding licensing terms become effective; rather the fact matters that a given piece of code was provably copyrighted and published under a license. Even reformatting the code, renaming some variables or deleting parts of the code will not alter this legal situation, but rather creates a derivative work, which is likewise covered by the GPL! The most relevant information in the file header is the notice regarding the time of the first individual copyright claim. By virtue of this initial copyright, the first author is entitled to choose the terms of licensing. All further modifications are permitted and covered by the License. The specific wording or format of the copyright header is not legally relevant, as long as the intention to publish under the GPL remains clear. The extended wording was based on a recommendation by the FSF. It can be shortened, because the full terms of the license are provided alongside the distribution, in the file COPYING.
110 lines
2.8 KiB
C
110 lines
2.8 KiB
C
/*
|
||
INTERFACEREGISTRY.h - Lumiera interface registry
|
||
|
||
Copyright (C)
|
||
2008, Christian Thaeter <ct@pipapo.org>
|
||
|
||
**Lumiera** is free software; you can redistribute it and/or modify it
|
||
under the terms of the GNU General Public License as published by the
|
||
Free Software Foundation; either version 2 of the License, or (at your
|
||
option) any later version. See the file COPYING for further details.
|
||
|
||
*/
|
||
|
||
|
||
/** @file interfaceregistry.h
|
||
** Global registry for interfaces (extension points).
|
||
** Interface instances are published and activated by registering them
|
||
** into a global registry, which is defined here. This instances are identified
|
||
** by their name and major version.
|
||
*/
|
||
|
||
#ifndef LUMIERA_INTERFACEREGISTRY_H
|
||
#define LUMIERA_INTERFACEREGISTRY_H
|
||
|
||
#include "lib/mutex.h"
|
||
#include "lib/recmutex.h"
|
||
#include "lib/psplay.h"
|
||
|
||
#include "common/interface.h"
|
||
#include "common/plugin.h"
|
||
|
||
#include <nobug.h>
|
||
|
||
|
||
extern PSplay lumiera_interfaceregistry;
|
||
extern lumiera_recmutex lumiera_interface_mutex;
|
||
|
||
|
||
/**
|
||
* Interface management node.
|
||
* All active interfaces managed through this node which contains the dynamic data for
|
||
* dependency tracking and reference counting.
|
||
*/
|
||
typedef struct lumiera_interfacenode_struct lumiera_interfacenode;
|
||
typedef lumiera_interfacenode* LumieraInterfacenode;
|
||
|
||
struct lumiera_interfacenode_struct
|
||
{
|
||
/** all known interfaces are registered in a tree */
|
||
psplaynode node;
|
||
|
||
/** the interface itself */
|
||
LumieraInterface interface;
|
||
|
||
/** reference counters and link used for internal reference management */
|
||
unsigned refcnt;
|
||
|
||
/** backreference to its plugin if it comes from a plugin, else NULL */
|
||
LumieraPlugin plugin;
|
||
|
||
/** temporary used to stack interfaces when recursively opening/closing them */
|
||
LumieraInterfacenode lnk;
|
||
|
||
/** allocated size of the following dependency table */
|
||
size_t deps_size;
|
||
|
||
/** NULL terminated table of all dependencies (interfaces opened on initialisation) */
|
||
LumieraInterfacenode* deps;
|
||
};
|
||
|
||
|
||
/**
|
||
* Initialise the interface registry
|
||
*/
|
||
void
|
||
lumiera_interfaceregistry_init (void);
|
||
|
||
void
|
||
lumiera_interfaceregistry_destroy (void);
|
||
|
||
|
||
void
|
||
lumiera_interfaceregistry_register_interface (LumieraInterface self, LumieraPlugin plugin);
|
||
|
||
void
|
||
lumiera_interfaceregistry_bulkregister_interfaces (LumieraInterface* self, LumieraPlugin plugin);
|
||
|
||
void
|
||
lumiera_interfaceregistry_remove_interface (LumieraInterface self);
|
||
|
||
void
|
||
lumiera_interfaceregistry_bulkremove_interfaces (LumieraInterface* self);
|
||
|
||
LumieraInterfacenode
|
||
lumiera_interfaceregistry_interfacenode_find (const char* interface, unsigned version, const char* name);
|
||
|
||
LumieraInterface
|
||
lumiera_interfaceregistry_interface_find (const char* interface, unsigned version, const char* name);
|
||
|
||
|
||
|
||
|
||
#endif /* LUMIERA_INTERFACEREGISTRY_H */
|
||
/*
|
||
// Local Variables:
|
||
// mode: C
|
||
// c-file-style: "gnu"
|
||
// indent-tabs-mode: nil
|
||
// End:
|
||
*/
|