Commit edde641e authored by Kunshan Wang's avatar Kunshan Wang
Browse files

API-GEN: WIP: Implementing C->Rust conversions...

Now arrays, handles and primitive values can be converted to the
appropriate Rust values.

TODO: Need to forward each function to the concrete api_impl methods,
and convert the return values back to C types. Stubs should be
generated to ease the implementation of high-level methods.
parent ed8e3905
......@@ -6,3 +6,18 @@ mod api_c;
mod api_bridge;
mod api_impl;
/// This is for testing. In the productional setting, replace them with the definitions from
/// `src/ast/src/ir.rs` and `src/ast/src/bundle.rs`
mod deps {
// should import from ast/src/ir.rs
pub type WPID = usize;
pub type MuID = usize;
pub type MuName = String;
pub type CName = MuName;
pub struct APIMuValue {
// stub
}
}
use std::ptr;
use std::os::raw::*;
use std::ffi::CString;
use std::slice;
use super::api_c::*;
use super::api_impl::*;
use super::deps::*;
// GEN:BEGIN:Fillers
// GEN:END:Fillers
// hand-written functions
// The following functions "from_*" convert low-level types to high-level types.
// Get the pointer to the high-level struct.
//
// The return value is a pointer. Usually the API function body do not change the ownership of the
// self parameter, so `&mut` should suffice. However, some API functions (such as
// `MuCtx.close_context`) will free the resources, it is probably better to call the methods on
// (*ptr) directly (such as `(*pmuctx).close_context()`), and offload the decision to the concrete
// implementation.
//
// Assume the pointer is the header. For the sake of "implementation neutrality", the header
// defined in api_c.rs is encoded as *mut c_void rather than *mut MuVM or other concrete pointers.
// But it doesn't matter, because the header is only ever read in these three functions.
fn from_MuVM_ptr(ptr: *mut CMuVM) -> *mut MuVM {
assert!(!ptr.is_null());
unsafe {
(*ptr).header as *mut MuVM
}
}
fn from_MuCtx_ptr(ptr: *mut CMuCtx) -> *mut MuCtx {
assert!(!ptr.is_null());
unsafe {
(*ptr).header as *mut MuCtx
}
}
fn from_MuIRBuilder_ptr(ptr: *mut CMuIRBuilder) -> *mut MuIRBuilder {
assert!(!ptr.is_null());
unsafe {
(*ptr).header as *mut MuIRBuilder
}
}
fn from_MuName(cname: CMuName) -> MuName {
from_MuCString(cname)
}
fn from_MuCString(cstring: CMuCString) -> String {
assert!(!cstring.is_null());
let ffi_cstring = unsafe {
CString::from_raw(cstring)
};
ffi_cstring.into_string().unwrap()
}
fn from_MuCString_optional(cstring: CMuCString) -> Option<String> {
if cstring.is_null() {
None
} else {
Some(from_MuCString(cstring))
}
}
fn from_MuID(cmuid: CMuID) -> MuID {
assert!(cmuid != 0);
cmuid as MuID // just zero extend
}
fn from_MuID_optional(cmuid: CMuID) -> Option<MuID> {
if cmuid == 0 {
None
} else {
Some(from_MuID(cmuid))
}
}
fn from_MuBool(cbool: CMuBool) -> bool {
cbool != 0
}
// APIMuValue is immutable when used.
fn from_handle<'a>(cmuvalue: CMuValue) -> &'a APIMuValue {
assert!(!cmuvalue.is_null());
unsafe {
&*(cmuvalue as *const APIMuValue)
}
}
fn from_handle_optional<'a>(cmuvalue: CMuValue) -> Option<&'a APIMuValue> {
if cmuvalue.is_null() {
None
} else {
Some(from_handle(cmuvalue))
}
}
// The following functions "from_*_array" converts from C-level arrays to Rust-level slices.
fn from_array_direct<'a, T>(ptr: *const T, len: usize) -> &'a [T] {
if ptr.is_null() {
unsafe {
slice::from_raw_parts(ptr::null(), len)
}
} else {
unsafe {
slice::from_raw_parts(ptr, len)
}
}
}
fn from_char_array<'a>(ptr: *const c_char, len: usize) -> &'a [c_char] {
from_array_direct(ptr, len)
}
fn from_uint64_t_array<'a>(ptr: *const u64, len: usize) -> &'a [u64] {
from_array_direct(ptr, len)
}
fn from_MuID_array<'a>(ptr: *const CMuID, len: usize) -> &'a [CMuID] {
from_array_direct(ptr, len)
}
fn from_MuFlag_array<'a>(ptr: *const CMuFlag, len: usize) -> &'a [CMuFlag] {
from_array_direct(ptr, len)
}
/// Convert into a Vec of handle refs. It is not certain whether refs are represented in the same
/// way as raw pointers. So this function will convert each element. This function is only called
/// by `new_thread_nor`. As always, thread creation dominates the time.
fn from_handle_array<'a>(ptr: *const CMuValue, len: usize) -> Vec<&'a APIMuValue> {
let slc = from_array_direct(ptr, len);
slc.iter().map(|&e| {
assert!(!e.is_null());
unsafe { &*(e as *const APIMuValue) }
}).collect::<Vec<_>>()
}
fn from_MuCString_array<'a>(ptr: *const CMuCString, len: usize) -> Vec<String> {
let slc = from_array_direct(ptr, len);
slc.iter().map(|&e| from_MuCString(e)).collect::<Vec<_>>()
}
// GEN:BEGIN:Forwarders
fn _forwarder__MuVM__new_context(mvm: *mut CMuVM)-> *mut CMuCtx {
......@@ -24,8 +163,8 @@ fn _forwarder__MuVM__name_of(mvm: *mut CMuVM, id: CMuID)-> CMuName {
fn _forwarder__MuVM__set_trap_handler(mvm: *mut CMuVM, trap_handler: CMuTrapHandler, userdata: CMuCPtr) {
let mut _arg_mvm = from_MuVM_ptr(mvm);
let mut _arg_trap_handler = from_MuTrapHandler(trap_handler);
let mut _arg_userdata = from_MuCPtr(userdata);
let mut _arg_trap_handler = trap_handler;
let mut _arg_userdata = userdata;
panic!("not implemented")
}
......@@ -60,162 +199,162 @@ fn _forwarder__MuCtx__load_hail(ctx: *mut CMuCtx, buf: *mut c_char, sz: CMuArray
fn _forwarder__MuCtx__handle_from_sint8(ctx: *mut CMuCtx, num: i8, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_int8_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_uint8(ctx: *mut CMuCtx, num: u8, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_uint8_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_sint16(ctx: *mut CMuCtx, num: i16, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_int16_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_uint16(ctx: *mut CMuCtx, num: u16, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_uint16_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_sint32(ctx: *mut CMuCtx, num: i32, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_int32_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_uint32(ctx: *mut CMuCtx, num: u32, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_uint32_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_sint64(ctx: *mut CMuCtx, num: i64, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_int64_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_uint64(ctx: *mut CMuCtx, num: u64, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_uint64_t(num);
let mut _arg_len = from_int(len);
let mut _arg_num = num;
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_uint64s(ctx: *mut CMuCtx, nums: *mut u64, nnums: CMuArraySize, len: c_int)-> CMuIntValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_nums = from_uint64_t_array(nums, nnums);
let mut _arg_len = from_int(len);
let mut _arg_len = len;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_float(ctx: *mut CMuCtx, num: f32)-> CMuFloatValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_float(num);
let mut _arg_num = num;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_double(ctx: *mut CMuCtx, num: f64)-> CMuDoubleValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_num = from_double(num);
let mut _arg_num = num;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_ptr(ctx: *mut CMuCtx, mu_type: CMuID, ptr: CMuCPtr)-> CMuUPtrValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_mu_type = from_MuID(mu_type);
let mut _arg_ptr = from_MuCPtr(ptr);
let mut _arg_ptr = ptr;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_from_fp(ctx: *mut CMuCtx, mu_type: CMuID, fp: CMuCFP)-> CMuUFPValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_mu_type = from_MuID(mu_type);
let mut _arg_fp = from_MuCFP(fp);
let mut _arg_fp = fp;
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_sint8(ctx: *mut CMuCtx, opnd: CMuIntValue)-> i8 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_uint8(ctx: *mut CMuCtx, opnd: CMuIntValue)-> u8 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_sint16(ctx: *mut CMuCtx, opnd: CMuIntValue)-> i16 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_uint16(ctx: *mut CMuCtx, opnd: CMuIntValue)-> u16 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_sint32(ctx: *mut CMuCtx, opnd: CMuIntValue)-> i32 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_uint32(ctx: *mut CMuCtx, opnd: CMuIntValue)-> u32 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_sint64(ctx: *mut CMuCtx, opnd: CMuIntValue)-> i64 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_uint64(ctx: *mut CMuCtx, opnd: CMuIntValue)-> u64 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIntValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_float(ctx: *mut CMuCtx, opnd: CMuFloatValue)-> f32 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuFloatValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_double(ctx: *mut CMuCtx, opnd: CMuDoubleValue)-> f64 {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuDoubleValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_ptr(ctx: *mut CMuCtx, opnd: CMuUPtrValue)-> CMuCPtr {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuUPtrValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__handle_to_fp(ctx: *mut CMuCtx, opnd: CMuUFPValue)-> CMuCFP {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuUFPValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
......@@ -245,51 +384,51 @@ fn _forwarder__MuCtx__handle_from_expose(ctx: *mut CMuCtx, id: CMuID)-> CMuValue
fn _forwarder__MuCtx__delete_value(ctx: *mut CMuCtx, opnd: CMuValue) {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__ref_eq(ctx: *mut CMuCtx, lhs: CMuGenRefValue, rhs: CMuGenRefValue)-> CMuBool {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_lhs = from_MuGenRefValue(lhs);
let mut _arg_rhs = from_MuGenRefValue(rhs);
let mut _arg_lhs = from_handle(lhs);
let mut _arg_rhs = from_handle(rhs);
panic!("not implemented")
}
fn _forwarder__MuCtx__ref_ult(ctx: *mut CMuCtx, lhs: CMuIRefValue, rhs: CMuIRefValue)-> CMuBool {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_lhs = from_MuIRefValue(lhs);
let mut _arg_rhs = from_MuIRefValue(rhs);
let mut _arg_lhs = from_handle(lhs);
let mut _arg_rhs = from_handle(rhs);
panic!("not implemented")
}
fn _forwarder__MuCtx__extract_value(ctx: *mut CMuCtx, str: CMuStructValue, index: c_int)-> CMuValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_str = from_MuStructValue(str);
let mut _arg_index = from_int(index);
let mut _arg_str = from_handle(str);
let mut _arg_index = index;
panic!("not implemented")
}
fn _forwarder__MuCtx__insert_value(ctx: *mut CMuCtx, str: CMuStructValue, index: c_int, newval: CMuValue)-> CMuStructValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_str = from_MuStructValue(str);
let mut _arg_index = from_int(index);
let mut _arg_newval = from_MuValue(newval);
let mut _arg_str = from_handle(str);
let mut _arg_index = index;
let mut _arg_newval = from_handle(newval);
panic!("not implemented")
}
fn _forwarder__MuCtx__extract_element(ctx: *mut CMuCtx, str: CMuSeqValue, index: CMuIntValue)-> CMuValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_str = from_MuSeqValue(str);
let mut _arg_index = from_MuIntValue(index);
let mut _arg_str = from_handle(str);
let mut _arg_index = from_handle(index);
panic!("not implemented")
}
fn _forwarder__MuCtx__insert_element(ctx: *mut CMuCtx, str: CMuSeqValue, index: CMuIntValue, newval: CMuValue)-> CMuSeqValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_str = from_MuSeqValue(str);
let mut _arg_index = from_MuIntValue(index);
let mut _arg_newval = from_MuValue(newval);
let mut _arg_str = from_handle(str);
let mut _arg_index = from_handle(index);
let mut _arg_newval = from_handle(newval);
panic!("not implemented")
}
......@@ -302,298 +441,298 @@ fn _forwarder__MuCtx__new_fixed(ctx: *mut CMuCtx, mu_type: CMuID)-> CMuRefValue
fn _forwarder__MuCtx__new_hybrid(ctx: *mut CMuCtx, mu_type: CMuID, length: CMuIntValue)-> CMuRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_mu_type = from_MuID(mu_type);
let mut _arg_length = from_MuIntValue(length);
let mut _arg_length = from_handle(length);
panic!("not implemented")
}
fn _forwarder__MuCtx__refcast(ctx: *mut CMuCtx, opnd: CMuGenRefValue, new_type: CMuID)-> CMuGenRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuGenRefValue(opnd);
let mut _arg_opnd = from_handle(opnd);
let mut _arg_new_type = from_MuID(new_type);
panic!("not implemented")
}
fn _forwarder__MuCtx__get_iref(ctx: *mut CMuCtx, opnd: CMuRefValue)-> CMuIRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuRefValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__get_field_iref(ctx: *mut CMuCtx, opnd: CMuIRefValue, field: c_int)-> CMuIRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIRefValue(opnd);
let mut _arg_field = from_int(field);
let mut _arg_opnd = from_handle(opnd);
let mut _arg_field = field;
panic!("not implemented")
}
fn _forwarder__MuCtx__get_elem_iref(ctx: *mut CMuCtx, opnd: CMuIRefValue, index: CMuIntValue)-> CMuIRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIRefValue(opnd);
let mut _arg_index = from_MuIntValue(index);
let mut _arg_opnd = from_handle(opnd);
let mut _arg_index = from_handle(index);
panic!("not implemented")
}
fn _forwarder__MuCtx__shift_iref(ctx: *mut CMuCtx, opnd: CMuIRefValue, offset: CMuIntValue)-> CMuIRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIRefValue(opnd);
let mut _arg_offset = from_MuIntValue(offset);
let mut _arg_opnd = from_handle(opnd);
let mut _arg_offset = from_handle(offset);
panic!("not implemented")
}
fn _forwarder__MuCtx__get_var_part_iref(ctx: *mut CMuCtx, opnd: CMuIRefValue)-> CMuIRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_opnd = from_MuIRefValue(opnd);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__load(ctx: *mut CMuCtx, ord: CMuMemOrd, loc: CMuIRefValue)-> CMuValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_ord = from_MuMemOrd(ord);
let mut _arg_loc = from_MuIRefValue(loc);
let mut _arg_ord = ord;
let mut _arg_loc = from_handle(loc);
panic!("not implemented")
}
fn _forwarder__MuCtx__store(ctx: *mut CMuCtx, ord: CMuMemOrd, loc: CMuIRefValue, newval: CMuValue) {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_ord = from_MuMemOrd(ord);
let mut _arg_loc = from_MuIRefValue(loc);
let mut _arg_newval = from_MuValue(newval);
let mut _arg_ord = ord;
let mut _arg_loc = from_handle(loc);
let mut _arg_newval = from_handle(newval);
panic!("not implemented")
}
fn _forwarder__MuCtx__cmpxchg(ctx: *mut CMuCtx, ord_succ: CMuMemOrd, ord_fail: CMuMemOrd, weak: CMuBool, loc: CMuIRefValue, expected: CMuValue, desired: CMuValue, is_succ: *mut CMuBool)-> CMuValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_ord_succ = from_MuMemOrd(ord_succ);
let mut _arg_ord_fail = from_MuMemOrd(ord_fail);
let mut _arg_ord_succ = ord_succ;
let mut _arg_ord_fail = ord_fail;
let mut _arg_weak = from_MuBool(weak);
let mut _arg_loc = from_MuIRefValue(loc);
let mut _arg_expected = from_MuValue(expected);
let mut _arg_desired = from_MuValue(desired);
let mut _arg_is_succ = from_MuBool_ptr(is_succ);
let mut _arg_loc = from_handle(loc);
let mut _arg_expected = from_handle(expected);
let mut _arg_desired = from_handle(desired);
let mut _arg_is_succ = is_succ;
panic!("not implemented")
}
fn _forwarder__MuCtx__atomicrmw(ctx: *mut CMuCtx, ord: CMuMemOrd, op: CMuAtomicRMWOptr, loc: CMuIRefValue, opnd: CMuValue)-> CMuValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_ord = from_MuMemOrd(ord);
let mut _arg_op = from_MuAtomicRMWOptr(op);
let mut _arg_loc = from_MuIRefValue(loc);
let mut _arg_opnd = from_MuValue(opnd);
let mut _arg_ord = ord;
let mut _arg_op = op;
let mut _arg_loc = from_handle(loc);
let mut _arg_opnd = from_handle(opnd);
panic!("not implemented")
}
fn _forwarder__MuCtx__fence(ctx: *mut CMuCtx, ord: CMuMemOrd) {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_ord = from_MuMemOrd(ord);
let mut _arg_ord = ord;
panic!("not implemented")
}
fn _forwarder__MuCtx__new_stack(ctx: *mut CMuCtx, func: CMuFuncRefValue)-> CMuStackRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_func = from_MuFuncRefValue(func);
let mut _arg_func = from_handle(func);
panic!("not implemented")
}
fn _forwarder__MuCtx__new_thread_nor(ctx: *mut CMuCtx, stack: CMuStackRefValue, threadlocal: CMuRefValue, vals: *mut CMuValue, nvals: CMuArraySize)-> CMuThreadRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_stack = from_MuStackRefValue(stack);
let mut _arg_threadlocal = from_ptr_optional(threadlocal);
let mut _arg_vals = from_ptr_array(vals, nvals);
let mut _arg_stack = from_handle(stack);
let mut _arg_threadlocal = from_handle_optional(threadlocal);
let mut _arg_vals = from_handle_array(vals, nvals);
panic!("not implemented")
}
fn _forwarder__MuCtx__new_thread_exc(ctx: *mut CMuCtx, stack: CMuStackRefValue, threadlocal: CMuRefValue, exc: CMuRefValue)-> CMuThreadRefValue {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_stack = from_MuStackRefValue(stack);
let mut _arg_threadlocal = from_ptr_optional(threadlocal);
let mut _arg_exc = from_MuRefValue(exc);
let mut _arg_stack = from_handle(stack);
let mut _arg_threadlocal = from_handle_optional(threadlocal);
let mut _arg_exc = from_handle(exc);
panic!("not implemented")
}
fn _forwarder__MuCtx__kill_stack(ctx: *mut CMuCtx, stack: CMuStackRefValue) {
let mut _arg_ctx = from_MuCtx_ptr(ctx);
let mut _arg_stack = from_MuStackRefValue(stack);
let mut _arg_stack = from_handle(stack);
panic!("not implemented")
}
fn _forwarder__MuCtx__set_threadlocal(ctx: *mut CMuCtx, thread: CMuThreadRefValue, threadlocal: CMuRefValue) {
let mut _arg_ctx = from_MuCtx_ptr(ctx);