diff options
author | Torsten Paul <Torsten.Paul@gmx.de> | 2014-01-02 21:50:04 (GMT) |
---|---|---|
committer | Torsten Paul <Torsten.Paul@gmx.de> | 2014-01-02 22:28:02 (GMT) |
commit | 09f8e80a7d49188ff18195e40e3c02a2d8768257 (patch) | |
tree | 88f711ffae5863c8673f7bdd3c34b5f7faf74cb2 /src/modcontext.cc | |
parent | 7f3659907358f57e912f76291f8c9500b3032fbd (diff) |
Integrate feature registry with functions.
In case a function is attached to a disabled feature, the function lookup
will give a warning message and ignore that (builtin) function.
Diffstat (limited to 'src/modcontext.cc')
-rw-r--r-- | src/modcontext.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/modcontext.cc b/src/modcontext.cc index 7b8cb07..21b04fd 100644 --- a/src/modcontext.cc +++ b/src/modcontext.cc @@ -95,7 +95,12 @@ void ModuleContext::registerBuiltin() const AbstractFunction *ModuleContext::findLocalFunction(const std::string &name) const { if (this->functions_p && this->functions_p->find(name) != this->functions_p->end()) { - return this->functions_p->find(name)->second; + AbstractFunction *f = this->functions_p->find(name)->second; + if (!f->is_enabled()) { + PRINTB("WARNING: Experimental builtin function '%s' is not enabled.", name); + return NULL; + } + return f; } return NULL; } |