aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-07-11 20:47:51 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:07 -0500
commit6eb1fa15a06ab7de08e33add1540a45b83c5f0d8 (patch)
tree86d3cfedbf2ff76878eba6d14dc7fc259d1cbf46 /src/world.c
parentd1ba721d37af61f2b529faaa16bd20ba1e161b06 (diff)
downloadserd-6eb1fa15a06ab7de08e33add1540a45b83c5f0d8.tar.gz
serd-6eb1fa15a06ab7de08e33add1540a45b83c5f0d8.tar.bz2
serd-6eb1fa15a06ab7de08e33add1540a45b83c5f0d8.zip
Add SerdWorld for shared library state
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/world.c b/src/world.c
new file mode 100644
index 00000000..eef70a14
--- /dev/null
+++ b/src/world.c
@@ -0,0 +1,29 @@
+// Copyright 2011-2022 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#include "world.h"
+
+#include "serd/world.h"
+
+#include <stdlib.h>
+
+SerdWorld*
+serd_world_new(void)
+{
+ return (SerdWorld*)calloc(1, sizeof(SerdWorld));
+}
+
+void
+serd_world_free(SerdWorld* const world)
+{
+ free(world);
+}
+
+void
+serd_world_set_error_func(SerdWorld* world,
+ SerdErrorFunc error_func,
+ void* handle)
+{
+ world->error_func = error_func;
+ world->error_handle = handle;
+}