delete the unfinished C api

This commit is contained in:
HJfod 2022-11-25 00:02:48 +02:00
parent adf8295a41
commit fd42ab0457
3 changed files with 0 additions and 66 deletions
loader
include/Geode
loader
platform
src/load

View file

@ -1,19 +0,0 @@
#pragma once
#include <Geode/platform/cplatform.h>
#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
void GEODE_C_DLL geode_mod_log(void* mod, char const* message);
bool GEODE_C_DLL geode_mod_add_hook(void* mod, void* address, void* detour);
bool GEODE_C_DLL geode_get_last_error(char* buffer, size_t bufferSize);
#ifdef __cplusplus
}
#endif

View file

@ -1,8 +1,5 @@
#pragma once
#define GEODE_C_DLL
#define GEODE_C_API
#ifdef _MSC_VER
#pragma warning(disable : 4099) // type first seen as class
#pragma warning(default : 4067)
@ -20,16 +17,6 @@
#define GEODE_CALL __stdcall
#define GEODE_PLATFORM_EXTENSION ".dll"
#define GEODE_PLATFORM_SHORT_IDENTIFIER "win"
#ifdef GEODE_EXPORTING
#undef GEODE_C_DLL
#define GEODE_C_DLL __declspec(dllexport)
#else
#undef GEODE_C_DLL
#define GEODE_C_DLL __declspec(dllimport)
#endif
#undef GEODE_C_API
#define GEODE_C_API __declspec(dllexport) __stdcall
#else
#define GEODE_WINDOWS(...)
#endif

View file

@ -1,34 +0,0 @@
#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;
}