diff options
-rw-r--r-- | src/scripting/bindings.c | 8 | ||||
-rw-r--r-- | src/scripting/bindings.h | 6 | ||||
-rw-r--r-- | src/scripting/bindings/viewport.c | 6 |
3 files changed, 8 insertions, 12 deletions
diff --git a/src/scripting/bindings.c b/src/scripting/bindings.c index 7e45146..4efe584 100644 --- a/src/scripting/bindings.c +++ b/src/scripting/bindings.c @@ -16,17 +16,15 @@ * <http://www.gnu.org/licenses/>. */ -#define _SCRIPTING_BINDINGS_C_ - #include <stdlib.h> #include "ffi.h" #include "bindings.h" -struct ffi_namespace *top_ns; - void bindings_init(void) { + struct ffi_namespace *top_ns; + top_ns = ffi_add_namespace(NULL, "bouken"); - bindings_viewport_init(); + bindings_viewport_init(top_ns); } diff --git a/src/scripting/bindings.h b/src/scripting/bindings.h index 4ad7386..725580b 100644 --- a/src/scripting/bindings.h +++ b/src/scripting/bindings.h @@ -19,11 +19,9 @@ #ifndef _SCRIPTING_BINDINGS_H_ #define _SCRIPTING_BINDINGS_H_ -#ifndef _SCRIPTING_BINDINGS_C_ -extern struct ffi_namespace *top_ns; -#endif +#include "ffi.h" void bindings_init(void); -void bindings_viewport_init(void); +void bindings_viewport_init(struct ffi_namespace *top_ns); #endif diff --git a/src/scripting/bindings/viewport.c b/src/scripting/bindings/viewport.c index 8fcc041..7e23d7d 100644 --- a/src/scripting/bindings/viewport.c +++ b/src/scripting/bindings/viewport.c @@ -21,8 +21,6 @@ #include "../ffi.h" #include "../bindings.h" -static struct ffi_namespace *ns; - static void binding_set_size(struct ffi_function *fn) { @@ -36,8 +34,10 @@ binding_set_size(struct ffi_function *fn) } void -bindings_viewport_init(void) +bindings_viewport_init(struct ffi_namespace *top_ns) { + struct ffi_namespace *ns; + ns = ffi_add_namespace(top_ns, "viewport"); ffi_add_function(ns, "set_size", binding_set_size); } |