summaryrefslogtreecommitdiffstats
path: root/src/scripting/ffi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripting/ffi.c')
-rw-r--r--src/scripting/ffi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/scripting/ffi.c b/src/scripting/ffi.c
index 9632893..6457f73 100644
--- a/src/scripting/ffi.c
+++ b/src/scripting/ffi.c
@@ -42,7 +42,7 @@ static int call_arg_index;
static void ffi_register_functions_in_namespace(lua_State *l,
struct ffi_namespace *parent);
-void
+struct ffi_namespace *
ffi_add_namespace(struct ffi_namespace *parent, const char *name)
{
struct ffi_namespace *new_ns;
@@ -54,7 +54,7 @@ ffi_add_namespace(struct ffi_namespace *parent, const char *name)
new_ns = malloc(sizeof(*new_ns));
if (new_ns == NULL) {
err(1, "Failed to allocate FFI namespace \"%s\"", name);
- return;
+ return NULL;
}
new_ns->name = strdup(name);
new_ns->ns_head = NULL;
@@ -69,6 +69,8 @@ ffi_add_namespace(struct ffi_namespace *parent, const char *name)
parent->ns_tail->next = new_ns;
}
parent->ns_tail = new_ns;
+
+ return new_ns;
}
void