Files
wren/test/api/handle.c
2016-05-20 20:55:28 -07:00

25 lines
476 B
C

#include <string.h>
#include "handle.h"
static WrenHandle* handle;
static void setValue(WrenVM* vm)
{
handle = wrenGetSlotHandle(vm, 1);
}
static void getValue(WrenVM* vm)
{
wrenSetSlotHandle(vm, 0, handle);
wrenReleaseHandle(vm, handle);
}
WrenForeignMethodFn handleBindMethod(const char* signature)
{
if (strcmp(signature, "static Handle.value=(_)") == 0) return setValue;
if (strcmp(signature, "static Handle.value") == 0) return getValue;
return NULL;
}