refactor: rename list C API functions and remove Slot suffix for consistency

- Rename wrenGetSlotListSize to wrenGetListCount and wrenGetSlotListValue to wrenGetListElement
- Change wrenGetListElement to move element directly to another slot instead of returning WrenValue
- Update all test bindings and calls to match new API signatures
This commit is contained in:
Bob Nystrom
2016-07-28 15:06:36 +00:00
parent 21a0eef834
commit 5f8794fdc2
4 changed files with 37 additions and 38 deletions
+7 -6
View File
@@ -359,12 +359,6 @@ double wrenGetSlotDouble(WrenVM* vm, int slot);
// foreign class.
void* wrenGetSlotForeign(WrenVM* vm, int slot);
// Returns the size of the list stored in [slot].
int wrenGetSlotListSize(WrenVM* vm, int slot);
// Reads a value from the list in [slot].
WrenValue* wrenGetSlotListValue(WrenVM* vm, int slot, int index);
// Reads a string from [slot].
//
// The memory for the returned string is owned by Wren. You can inspect it
@@ -431,6 +425,13 @@ void wrenSetSlotString(WrenVM* vm, int slot, const char* text);
// This does not release the handle for the value.
void wrenSetSlotHandle(WrenVM* vm, int slot, WrenHandle* handle);
// Returns the number of elements in the list stored in [slot].
int wrenGetListCount(WrenVM* vm, int slot);
// Reads element [index] from the list in [listSlot] and stores it in
// [elementSlot].
void wrenGetListElement(WrenVM* vm, int listSlot, int index, int elementSlot);
// Takes the value stored at [elementSlot] and inserts it into the list stored
// at [listSlot] at [index].
//