feat: add wrenGetArgumentBool function to retrieve boolean foreign call arguments

Implement the wrenGetArgumentBool function in wren_vm.c, which retrieves a boolean value from the foreign call argument slot at the given index. The function includes assertions for valid call context, non-negative index, and argument bounds. Also add the corresponding declaration to the public wren.h header to expose the new API for foreign method implementations.
This commit is contained in:
Harry Lawrence
2015-01-19 14:40:37 +00:00
parent a74797f333
commit 672fdb51f1
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -129,6 +129,8 @@ double wrenGetArgumentDouble(WrenVM* vm, int index);
// function returns, since the garbage collector may reclaim it.
const char* wrenGetArgumentString(WrenVM* vm, int index);
bool wrenGetArgumentBool(WrenVM* vm, int index);
// Provides a numeric return value for a foreign call. This must only be called
// within a function provided to [wrenDefineMethod]. Once this is called, the
// foreign call is done, and no more arguments can be read or return calls made.