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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user