2023-02-21 09:09:48 -03:00
|
|
|
#include "obelisk.h"
|
|
|
|
#include "obelisk_wrapper.h"
|
|
|
|
|
2023-02-21 21:31:04 -03:00
|
|
|
#include <string.h>
|
|
|
|
|
2023-02-21 09:09:48 -03:00
|
|
|
extern "C"
|
|
|
|
{
|
2023-02-22 00:42:40 -03:00
|
|
|
CObelisk* create_obelisk(const char* filename)
|
2023-02-21 09:09:48 -03:00
|
|
|
{
|
2023-02-22 00:42:40 -03:00
|
|
|
obelisk::Obelisk* obelisk = new obelisk::Obelisk(filename);
|
2023-02-21 09:09:48 -03:00
|
|
|
return reinterpret_cast<CObelisk*>(obelisk);
|
|
|
|
}
|
|
|
|
|
2023-02-21 21:31:04 -03:00
|
|
|
char* call_obelisk_getVersion(CObelisk* p_obelisk)
|
2023-02-21 09:09:48 -03:00
|
|
|
{
|
|
|
|
obelisk::Obelisk* obelisk
|
|
|
|
= reinterpret_cast<obelisk::Obelisk*>(p_obelisk);
|
2023-02-21 21:31:04 -03:00
|
|
|
auto version = strdup(obelisk->getVersion().c_str());
|
|
|
|
return version;
|
2023-02-21 09:09:48 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
int call_obelisk_getLibVersion(CObelisk* p_obelisk)
|
|
|
|
{
|
|
|
|
obelisk::Obelisk* obelisk
|
|
|
|
= reinterpret_cast<obelisk::Obelisk*>(p_obelisk);
|
|
|
|
return obelisk->getLibVersion();
|
|
|
|
}
|
|
|
|
|
2023-02-22 00:42:40 -03:00
|
|
|
double call_obelisk_query(CObelisk* p_obelisk,
|
|
|
|
const char* left_entity,
|
|
|
|
const char* verb,
|
|
|
|
const char* right_entity)
|
|
|
|
{
|
|
|
|
obelisk::Obelisk* obelisk
|
|
|
|
= reinterpret_cast<obelisk::Obelisk*>(p_obelisk);
|
|
|
|
return obelisk->query(std::string(left_entity),
|
|
|
|
std::string(verb),
|
|
|
|
std::string(right_entity));
|
|
|
|
}
|
|
|
|
|
2023-02-23 01:07:44 -03:00
|
|
|
char* call_obelisk_queryAction(CObelisk* p_obelisk,
|
|
|
|
const char* left_entity,
|
|
|
|
const char* verb,
|
|
|
|
const char* right_entity)
|
|
|
|
{
|
|
|
|
obelisk::Obelisk* obelisk
|
|
|
|
= reinterpret_cast<obelisk::Obelisk*>(p_obelisk);
|
|
|
|
auto temp = obelisk->queryAction(std::string(left_entity),
|
|
|
|
std::string(verb),
|
|
|
|
std::string(right_entity));
|
|
|
|
auto action = strdup(temp.c_str());
|
|
|
|
return action;
|
|
|
|
}
|
|
|
|
|
2023-02-21 09:09:48 -03:00
|
|
|
void destroy_obelisk(CObelisk* p_obelisk)
|
|
|
|
{
|
|
|
|
obelisk::Obelisk* obelisk
|
|
|
|
= reinterpret_cast<obelisk::Obelisk*>(p_obelisk);
|
|
|
|
delete obelisk;
|
|
|
|
}
|
|
|
|
};
|