Fix usage of field named "new" in configitem.h
This prevents including config.h into C++ code
This commit is contained in:
parent
9f3c1ecf00
commit
87475fa3c1
6 changed files with 15 additions and 30 deletions
|
|
@ -94,11 +94,8 @@ typedef lumiera_config* LumieraConfig;
|
|||
LUMIERA_CONFIG_TYPE(bool, int)
|
||||
|
||||
|
||||
// * does only initialize the variables, so that they get valid values, but does not allocate them as they will be allocated before as they are singleton.
|
||||
// * lumiera_config_init (const char* searchpath) searchpath is a builtin-default, can be changed via configure and can be appended and overridden by using a flag, e.g. {{{ --config-path-append="" }}} or {{{ --config-path="" }}}
|
||||
|
||||
/**
|
||||
* Initialize the configuration subsystem.
|
||||
* Initialise the configuration subsystem.
|
||||
* @param path search path for config files.
|
||||
* Must be called only once
|
||||
*/
|
||||
|
|
@ -106,7 +103,6 @@ int
|
|||
lumiera_config_init (const char* path);
|
||||
|
||||
|
||||
// * frees all space allocated by the ConfigLoader.
|
||||
|
||||
/**
|
||||
* Destroys the configuration subsystem.
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ lumiera_configentry_destroy (LumieraConfigitem self)
|
|||
|
||||
struct lumiera_configitem_vtable lumiera_configentry_funcs =
|
||||
{
|
||||
.new = lumiera_configentry_new,
|
||||
.newitem = lumiera_configentry_new,
|
||||
.destroy = lumiera_configentry_destroy
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -25,19 +25,8 @@
|
|||
#include "include/lifecycle.h"
|
||||
#include "include/configfacade.hpp"
|
||||
|
||||
extern "C" { // TODO: can't include "lumiera/config.h" from C++ code, because it uses an identifier "new"
|
||||
|
||||
/** Initialise the configuration subsystem.
|
||||
* Must be called exactly once prior to any use
|
||||
* @param path search path for config files.
|
||||
*/
|
||||
int lumiera_config_init (const char* path);
|
||||
|
||||
/** Destroys the configuration subsystem.
|
||||
* Subsequent calls are no-op. */
|
||||
void
|
||||
lumiera_config_destroy ();
|
||||
|
||||
extern "C" {
|
||||
#include "common/config.h"
|
||||
}
|
||||
|
||||
#ifndef LUMIERA_CONFIG_PATH
|
||||
|
|
|
|||
|
|
@ -109,8 +109,8 @@ lumiera_configitem_new (const char* line)
|
|||
|
||||
lumiera_configitem_parse (&tmp, line);
|
||||
|
||||
LumieraConfigitem self = tmp.vtable && tmp.vtable->new
|
||||
? tmp.vtable->new (&tmp)
|
||||
LumieraConfigitem self = tmp.vtable && tmp.vtable->newitem
|
||||
? tmp.vtable->newitem (&tmp)
|
||||
: lumiera_configitem_move (lumiera_malloc (sizeof (*self)), &tmp);
|
||||
|
||||
return self;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ struct lumiera_configitem_vtable;
|
|||
|
||||
struct lumiera_configitem_vtable
|
||||
{
|
||||
LumieraConfigitem (*new)(LumieraConfigitem);
|
||||
LumieraConfigitem (*newitem)(LumieraConfigitem);
|
||||
LumieraConfigitem (*destroy)(LumieraConfigitem);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -48,23 +48,23 @@ namespace lumiera {
|
|||
|
||||
/*********************************************************************
|
||||
* C++ wrapper for convenient access to the Lumiera config system.
|
||||
*
|
||||
* @warning Config system not fully implemented yet. Thus for now
|
||||
* this facade is wired with the setup.ini and will just
|
||||
* fetch the values from there.
|
||||
*/
|
||||
struct Config
|
||||
class Config
|
||||
{
|
||||
|
||||
public:
|
||||
static const string get (string const& key);
|
||||
|
||||
|
||||
static lib::Singleton<Config> instance;
|
||||
|
||||
|
||||
private:
|
||||
Config();
|
||||
~Config();
|
||||
|
||||
~Config();
|
||||
friend class lib::singleton::StaticCreate<Config>;
|
||||
|
||||
//////////////////TODO: define startup/shutdown and loading of the config interface
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue