geode/loader/src/load/cgeode.cpp
2022-10-30 21:56:36 +03:00

34 lines
892 B
C++

#include <Geode/loader/Log.hpp>
#include <Geode/loader/Mod.hpp>
#include <Geode/loader/cgeode.h>
USE_GEODE_NAMESPACE();
std::string g_lastError = "";
void geode_mod_log(void* cmod, char const* message) {
auto mod = static_cast<Mod*>(cmod);
log::log(Severity::Debug, mod, "{}", message);
}
bool geode_mod_add_hook(void* cmod, void* address, void* detour) {
// auto mod = static_cast<Mod*>(cmod);
// auto res = mod->addHook(address, detour);
// if (!res) {
// g_lastError = res.error();
// return false;
// }
return true;
}
bool geode_get_last_error(char* buffer, size_t bufferSize) {
if (buffer && bufferSize >= g_lastError.size()) {
try {
std::copy(g_lastError.begin(), g_lastError.end(), buffer);
return true;
}
catch (...) {
}
}
return false;
}