aboutsummaryrefslogtreecommitdiff
path: root/api.c
blob: af7bb5eaba446d49f9b674effd72c941daa09442 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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