Ejemplo n.º 1
0
void fileAllocate(WrenVM* vm)
{
  // Store the file descriptor in the foreign data, so that we can get to it
  // in the finalizer.
  int* fd = (int*)wrenSetSlotNewForeign(vm, 0, 0, sizeof(int));
  *fd = (int)wrenGetSlotDouble(vm, 1);
}
Ejemplo n.º 2
0
static void foreignClassAllocate(WrenVM* vm)
{
  wrenSetSlotNewForeign(vm, 0, 0, 4);
}
static void counterAllocate(WrenVM* vm)
{
  double* counter = (double*)wrenSetSlotNewForeign(vm, 0, 0, sizeof(double));
  *counter = wrenGetSlotDouble(vm, 1);
}