Added support for calling script functions from extern C hooks
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-07 13:51:49 +02:00
parent a747c60f32
commit f143e526ab
2 changed files with 28 additions and 2 deletions

View File

@@ -1,4 +1,6 @@
#include "EvalValue.hpp"
#include "NumericEvalValue.hpp"
#include "StringEvalValue.hpp"
#include <cstring>
extern "C" {
@@ -26,6 +28,21 @@ extern "C" {
return v->EvaluateString() -> c_str();
}
EvalValue* CreateIntegerEvalValue(long l){
return new IntegerEvalValue(l);
}
EvalValue* CreateFloatEvalValue(double d){
return new FloatEvalValue(d);
}
EvalValue* CreateBoolEvalValue(bool b){
return new BooleanEvalValue(b);
}
EvalValue* CreateStringEvalValue(const char* s){
return new StringEvalValue(s);
}
}
#ifdef TESTS_BUILD