Wrap more c functions.
This commit is contained in:
parent
df52fe0fba
commit
751667769c
2 changed files with 11 additions and 0 deletions
|
@ -188,6 +188,11 @@ namespace wren {
|
|||
return {data, length};
|
||||
}
|
||||
|
||||
void* VM::slot_foreign (int slot_num) {
|
||||
assert(SlotType::Foreign == slot_type(slot_num));
|
||||
return wrenGetSlotForeign(m_local->wvm, slot_num);
|
||||
}
|
||||
|
||||
void VM::set_slot_string (int slot_num, const char* value) {
|
||||
wrenSetSlotString(m_local->wvm, slot_num, value);
|
||||
}
|
||||
|
@ -208,6 +213,10 @@ namespace wren {
|
|||
wrenSetSlotBytes(m_local->wvm, slot_num, bytes, length);
|
||||
}
|
||||
|
||||
void* VM::set_slot_new_foreign (int slot_num, int class_slot, std::size_t size) {
|
||||
return wrenSetSlotNewForeign(m_local->wvm, slot_num, class_slot, size);
|
||||
}
|
||||
|
||||
void VM::ensure_slots (int num_slots) {
|
||||
wrenEnsureSlots(m_local->wvm, num_slots);
|
||||
}
|
||||
|
|
|
@ -68,12 +68,14 @@ namespace wren {
|
|||
void set_slot_bool (int slot_num, bool value);
|
||||
void set_slot_null (int slot_num);
|
||||
void set_slot_bytes (int slot_num, const char* bytes, std::size_t length);
|
||||
void* set_slot_new_foreign (int slot_num, int class_slot, std::size_t size);
|
||||
|
||||
//slot getters
|
||||
const char* slot_string (int slot_num);
|
||||
double slot_double (int slot_num);
|
||||
bool slot_bool (int slot_num);
|
||||
std::pair<const char*, int> slot_bytes (int slot_num);
|
||||
void* slot_foreign (int slot_num);
|
||||
|
||||
private:
|
||||
struct LocalData;
|
||||
|
|
Loading…
Reference in a new issue