mirror of https://github.com/Icinga/icinga2.git
Use Application::Exit to implement the exit() script function
This commit is contained in:
parent
f85be08480
commit
8e4148d33c
|
@ -25,6 +25,7 @@
|
|||
#include "base/logger.hpp"
|
||||
#include "base/objectlock.hpp"
|
||||
#include "base/dynamictype.hpp"
|
||||
#include "base/application.hpp"
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <algorithm>
|
||||
|
@ -39,7 +40,7 @@ REGISTER_SCRIPTFUNCTION(union, &ScriptUtils::Union);
|
|||
REGISTER_SCRIPTFUNCTION(intersection, &ScriptUtils::Intersection);
|
||||
REGISTER_SCRIPTFUNCTION(log, &ScriptUtils::Log);
|
||||
REGISTER_SCRIPTFUNCTION(range, &ScriptUtils::Range);
|
||||
REGISTER_SCRIPTFUNCTION(exit, &ScriptUtils::Exit);
|
||||
REGISTER_SCRIPTFUNCTION(exit, &Application::Exit);
|
||||
REGISTER_SCRIPTFUNCTION(typeof, &ScriptUtils::TypeOf);
|
||||
REGISTER_SCRIPTFUNCTION(keys, &ScriptUtils::Keys);
|
||||
REGISTER_SCRIPTFUNCTION(random, &Utility::Random);
|
||||
|
@ -179,11 +180,6 @@ Array::Ptr ScriptUtils::Range(const std::vector<Value>& arguments)
|
|||
return result;
|
||||
}
|
||||
|
||||
void ScriptUtils::Exit(int code)
|
||||
{
|
||||
exit(code);
|
||||
}
|
||||
|
||||
Type::Ptr ScriptUtils::TypeOf(const Value& value)
|
||||
{
|
||||
switch (value.GetType()) {
|
||||
|
|
|
@ -42,7 +42,6 @@ public:
|
|||
static Array::Ptr Intersection(const std::vector<Value>& arguments);
|
||||
static void Log(const std::vector<Value>& arguments);
|
||||
static Array::Ptr Range(const std::vector<Value>& arguments);
|
||||
static void Exit(int code);
|
||||
static Type::Ptr TypeOf(const Value& value);
|
||||
static Array::Ptr Keys(const Dictionary::Ptr& dict);
|
||||
static DynamicObject::Ptr GetObject(const String& type, const String& name);
|
||||
|
|
Loading…
Reference in New Issue