Wrap dlopen/dlsym

This commit is contained in:
2026-07-04 15:33:40 +10:00
parent b4cbced5f5
commit 3204613c6f
5 changed files with 97 additions and 0 deletions

View File

@@ -7,6 +7,14 @@
#include <stdbool.h>
#include <uthash.h>
#ifdef _WIN32
// TODO: check if this works
#include <minwindef.h>
#define PATH_MAX MAX_PATH
#else
#include <limits.h>
#endif
//
// TYPES
//
@@ -352,6 +360,11 @@ struct GroundExecutionResult {
} as;
};
struct GroundOpenSharedObjects {
char path[PATH_MAX];
void* handle;
UT_hash_handle hh;
};
//
// INTERFACE
@@ -522,6 +535,12 @@ struct _Ground {
char* (*BytecodeValue)(GroundBytecodeValue* value);
} Stringify;
struct {
struct GroundOpenSharedObjects* objects;
void* (*openSharedObject)(char* id);
void* (*getFunction)(void* handle, char* id);
} FFI;
};
extern struct _Ground Ground;