chore(c-api) Move cbindgen:ignore from functions/types to modules.

This patch removes the amount of `cbindgen:ignore` instructions by
moving this instruction onto the parent module.
This commit is contained in:
Ivan Enderlin
2020-10-02 09:51:48 +02:00
parent 1a45756cad
commit ae1a50b5d7
24 changed files with 18 additions and 163 deletions

View File

@@ -8,7 +8,6 @@ use std::ptr::NonNull;
use std::sync::Arc;
use wasmer::{Function, Instance, RuntimeError, Store, Val};
/// cbindgen:ignore
#[allow(non_camel_case_types)]
pub struct wasm_func_t {
pub(crate) inner: Function,
@@ -16,12 +15,10 @@ pub struct wasm_func_t {
pub(crate) instance: Option<Arc<Instance>>,
}
/// cbindgen:ignore
#[allow(non_camel_case_types)]
pub type wasm_func_callback_t =
unsafe extern "C" fn(args: *const wasm_val_t, results: *mut wasm_val_t) -> *mut wasm_trap_t;
/// cbindgen:ignore
#[allow(non_camel_case_types)]
pub type wasm_func_callback_with_env_t = unsafe extern "C" fn(
*mut c_void,
@@ -29,11 +26,9 @@ pub type wasm_func_callback_with_env_t = unsafe extern "C" fn(
results: *mut wasm_val_t,
) -> *mut wasm_trap_t;
/// cbindgen:ignore
#[allow(non_camel_case_types)]
pub type wasm_env_finalizer_t = unsafe extern "C" fn(c_void);
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_func_new(
store: Option<NonNull<wasm_store_t>>,
@@ -80,7 +75,6 @@ pub unsafe extern "C" fn wasm_func_new(
}))
}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_func_new_with_env(
store: Option<NonNull<wasm_store_t>>,
@@ -127,11 +121,9 @@ pub unsafe extern "C" fn wasm_func_new_with_env(
}))
}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_func_delete(_func: Option<Box<wasm_func_t>>) {}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_func_call(
func: &wasm_func_t,
@@ -156,13 +148,11 @@ pub unsafe extern "C" fn wasm_func_call(
}
}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_func_param_arity(func: &wasm_func_t) -> usize {
func.inner.ty().params().len()
}
/// cbindgen:ignore
#[no_mangle]
pub unsafe extern "C" fn wasm_func_result_arity(func: &wasm_func_t) -> usize {
func.inner.ty().results().len()