summaryrefslogtreecommitdiff
path: root/modules/test_module.c
blob: ead7b91265e9ca44cd363bcb3503495866e62596 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include "../lisp_api.h"

value *hello_fun(env *e, value *args) {
	printf("Hello from dynamically loaded module!\n");
	return make_nil();
}

module_export *module_init() {
	static module_export exports[2];

	exports[0].name = "hello";
	exports[0].v    = make_builtin(&hello_fun);

	exports[1].name = NULL;
	exports[1].v    = NULL;

	return exports;
}