aboutsummaryrefslogtreecommitdiff
path: root/api.c
diff options
context:
space:
mode:
Diffstat (limited to 'api.c')
-rw-r--r--api.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/api.c b/api.c
new file mode 100644
index 0000000..af7bb5e
--- /dev/null
+++ b/api.c
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: ISC
+// SPDX-FileCopyrightText: 2024 Matthew Wozniak <me@woz.blue>
+
+#define NO_EXTERNS
+#include "api.h"
+#undef NO_EXTERNS
+#include "os.h"
+#include "log.h"
+
+struct engserver *engserver;
+
+void api_init() {
+ void *engine_dll = os_dlopen("engine");
+ createinterface_func engine_factory =
+ (createinterface_func)os_dlsym(engine_dll, "CreateInterface");
+ if (!engine_factory) die("couldn't get engine factory");
+ engserver = engine_factory(INTERFACEVERSION_VENGINESERVER, NULL);
+ if (!engserver) die("couldn't get IVEngineServer from engine");
+}
+
+// vi: sw=4 ts=4 noet tw=80 cc=80