refactor: consolidate per-test subdirectories into flat test/api structure with merged returns and value files

This commit is contained in:
Bob Nystrom
2015-08-13 16:09:27 +00:00
parent f9f8b55b29
commit 7551fa8c9b
18 changed files with 72 additions and 103 deletions
+24
View File
@@ -0,0 +1,24 @@
#include <string.h>
#include "value.h"
static WrenValue* value;
static void setValue(WrenVM* vm)
{
value = wrenGetArgumentValue(vm, 1);
}
static void getValue(WrenVM* vm)
{
wrenReturnValue(vm, value);
wrenReleaseValue(vm, value);
}
WrenForeignMethodFn valueBindForeign(const char* signature)
{
if (strcmp(signature, "static Api.value=(_)") == 0) return setValue;
if (strcmp(signature, "static Api.value") == 0) return getValue;
return NULL;
}