Created
January 27, 2017 15:44
-
-
Save goertzenator/734120a16233abd0423504cf6761de4c to your computer and use it in GitHub Desktop.
erlang_nif-sys expansion under Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(prelude_import)] | |
#![no_std] | |
/*! | |
Low level Rust bindings to the [Erlang NIF API](http://www.erlang.org/doc/man/erl_nif.html). | |
# NIF Crate | |
A NIF module is built by creating a new crate that uses `erlang_nif-sys` as a dependency. | |
(more) | |
# NIF Functions | |
All NIF functions must have the following signature: | |
``` | |
#[macro_use] | |
extern crate erlang_nif_sys; | |
use erlang_nif_sys::*; | |
# fn main(){} //0 | |
fn my_nif(env: *mut ErlNifEnv, | |
argc: c_int, | |
args: *const ERL_NIF_TERM) -> ERL_NIF_TERM { | |
// ... | |
# unsafe{enif_make_badarg(env)} | |
} | |
``` | |
# NIF Module Initialization | |
## For the Impatient | |
``` | |
#[macro_use] | |
extern crate erlang_nif_sys; | |
use erlang_nif_sys::*; | |
nif_init!("my_nif_module",[ | |
("my_nif_fun1", 1, my_nif_fun1), | |
("my_dirty_fun2", 1, my_dirty_fun2, ERL_NIF_DIRTY_JOB_CPU_BOUND) | |
], | |
{load: my_load} | |
); | |
# fn main(){} //1 | |
# fn my_load(env: *mut ErlNifEnv, priv_data: *mut *mut c_void, load_info: ERL_NIF_TERM)-> c_int { 0 } | |
# fn my_nif_fun1(_: *mut ErlNifEnv,_: c_int,args: *const ERL_NIF_TERM) -> ERL_NIF_TERM {unsafe{*args}} | |
# fn my_dirty_fun2(_: *mut ErlNifEnv,_: c_int,args: *const ERL_NIF_TERM) -> ERL_NIF_TERM {unsafe{*args}} | |
``` | |
## Details | |
The `erlang_nif-sys` analog of [`ERL_NIF_INIT()`](http://www.erlang.org/doc/man/erl_nif_init.html) is `nif_init!` which has the following form: | |
`nif_init!(module_name, [nif_funcs], {options})` | |
`module_name` must be a string literal, for example `"mynifmodule"`. | |
`nif_funcs` declares all the exported NIF functions for this module. Each entry is declared as | |
`(name, arity, function, flags)` | |
`name` is a string literal indicating the name of the function as seen from Erlang code. | |
`arity` is an integer indicating how many parameter this function takes as seen from Erlang code. | |
`function` is the Rust implentation of the NIF and must be of the form | |
`Fn(env: *mut ErlNifEnv, argc: c_int, args: *const ERL_NIF_TERM) -> ERL_NIF_TERM`. This is usually a plain | |
Rust function, but closures are permitted. | |
`flags` is optional and allows you to specify if this NIF is to run on a dirty scheduler. See [dirty NIFs](http://www.erlang.org/doc/man/erl_nif.html#dirty_nifs) | |
in the Erlang docs. | |
The `options` are the NIF module intialization functions [`load`](http://www.erlang.org/doc/man/erl_nif.html#load), [`reload`](http://www.erlang.org/doc/man/erl_nif.html#reload), | |
[`upgrade`](http://www.erlang.org/doc/man/erl_nif.html#upgrade), and [`unload`](http://www.erlang.org/doc/man/erl_nif.html#unload). | |
Each is optional and is specified in struct-init style if present. If no options are needed, | |
the curly braces may be elided. Stub implementation of all these functions looks something like: | |
``` | |
#[macro_use] | |
extern crate erlang_nif_sys; | |
use erlang_nif_sys::*; | |
nif_init!("mymod", [], {load: load, reload: reload, upgrade: upgrade, unload: unload}); | |
fn load(env: *mut ErlNifEnv, | |
priv_data: *mut *mut c_void, | |
load_info: ERL_NIF_TERM)-> c_int { 0 } | |
fn reload(env: *mut ErlNifEnv, | |
priv_data: *mut *mut c_void, | |
load_info: ERL_NIF_TERM) -> c_int { 0 } | |
fn upgrade(env: *mut ErlNifEnv, | |
priv_data: *mut *mut c_void, | |
old_priv_data: *mut *mut c_void, | |
load_info: ERL_NIF_TERM) -> c_int { 0 } | |
fn unload(env: *mut ErlNifEnv, | |
priv_data: *mut c_void) {} | |
# fn main(){} //2 | |
``` | |
# Invoking NIF API | |
As with any Rust FFI call, NIF API calls must be wrapped in `unsafe` blocks. | |
Below is an example of invoking NIF APIs along with an approach for dealing with | |
the the `args` parameter. | |
``` | |
extern crate erlang_nif_sys; | |
use erlang_nif_sys::*; | |
use std::mem; | |
fn native_add(env: *mut ErlNifEnv, | |
argc: c_int, | |
args: *const ERL_NIF_TERM) -> ERL_NIF_TERM { | |
unsafe { | |
let mut a: c_int = mem::uninitialized(); | |
let mut b: c_int = mem::uninitialized(); | |
if argc == 2 && | |
0 != enif_get_int(env, *args, &mut a) && | |
0 != enif_get_int(env, *args.offset(1), &mut b) { | |
enif_make_int(env, a+b) | |
} | |
else { | |
enif_make_badarg(env) | |
} | |
} | |
} | |
# fn main(){} //3 | |
``` | |
*/ | |
#[prelude_import] | |
use std::prelude::v1::*; | |
#[macro_use] | |
extern crate std as std; | |
#[cfg(windows)] | |
extern crate unreachable; | |
#[cfg(windows)] | |
use unreachable::UncheckedOptionExt; | |
// unchecked unwrap used in generated Windows code | |
pub use std::os::raw::{c_int, c_void, c_uint, c_char, c_uchar, c_ulong, | |
c_long, c_double}; | |
#[allow(non_camel_case_types)] | |
pub type size_t = usize; | |
use std::option::Option; | |
#[allow(non_camel_case_types)] | |
pub type ERL_NIF_UINT = size_t; | |
#[allow(non_camel_case_types)] | |
pub type ERL_NIF_TERM = ERL_NIF_UINT; | |
//#[derive(Debug, Copy, Clone)] | |
//#[repr(C)] | |
//pub struct ERL_NIF_TERM(ERL_NIF_UINT); // Don't do this, 32 bin calling convention is different for structs and ints. | |
/// See [ErlNifEnv](http://www.erlang.org/doc/man/erl_nif.html#ErlNifEnv) in the Erlang docs. | |
#[allow(missing_copy_implementations)] | |
#[repr(C)] | |
pub struct ErlNifEnv { | |
dummy: c_int, | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
#[allow(missing_copy_implementations)] | |
impl ::std::fmt::Debug for ErlNifEnv { | |
fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { | |
match *self { | |
ErlNifEnv { dummy: ref __self_0_0 } => { | |
let mut builder = __arg_0.debug_struct("ErlNifEnv"); | |
let _ = builder.field("dummy", &&(*__self_0_0)); | |
builder.finish() | |
} | |
} | |
} | |
} | |
// #[allow(missing_copy_implementations)] | |
/// See [ErlNifFunc](http://www.erlang.org/doc/man/erl_nif.html#ErlNifFunc) in the Erlang docs. | |
#[repr(C)] | |
pub struct ErlNifFunc { | |
pub name: *const u8, | |
pub arity: c_uint, | |
pub function: unsafe extern "C" fn(env: *mut ErlNifEnv, argc: c_int, | |
argv: *const ERL_NIF_TERM) | |
-> ERL_NIF_TERM, | |
pub flags: c_uint, | |
} | |
// #[allow(missing_copy_implementations)] | |
#[doc(hidden)] | |
#[repr(C)] | |
pub struct ErlNifEntry { | |
pub major: c_int, | |
pub minor: c_int, | |
pub name: *const u8, | |
pub num_of_funcs: c_int, | |
pub funcs: *const ErlNifFunc, | |
pub load: Option<unsafe extern "C" fn(env: *mut ErlNifEnv, | |
priv_data: *mut *mut c_void, | |
load_info: ERL_NIF_TERM) -> c_int>, | |
pub reload: Option<unsafe extern "C" fn(env: *mut ErlNifEnv, | |
priv_data: *mut *mut c_void, | |
load_info: ERL_NIF_TERM) | |
-> c_int>, | |
pub upgrade: Option<unsafe extern "C" fn(env: *mut ErlNifEnv, | |
priv_data: *mut *mut c_void, | |
old_priv_data: *mut *mut c_void, | |
load_info: ERL_NIF_TERM) | |
-> c_int>, | |
pub unload: Option<unsafe extern "C" fn(env: *mut ErlNifEnv, | |
priv_data: *mut c_void) -> ()>, | |
pub vm_variant: *const u8, | |
pub options: c_uint, | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::fmt::Debug for ErlNifEntry { | |
fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { | |
match *self { | |
ErlNifEntry { | |
major: ref __self_0_0, | |
minor: ref __self_0_1, | |
name: ref __self_0_2, | |
num_of_funcs: ref __self_0_3, | |
funcs: ref __self_0_4, | |
load: ref __self_0_5, | |
reload: ref __self_0_6, | |
upgrade: ref __self_0_7, | |
unload: ref __self_0_8, | |
vm_variant: ref __self_0_9, | |
options: ref __self_0_10 } => { | |
let mut builder = __arg_0.debug_struct("ErlNifEntry"); | |
let _ = builder.field("major", &&(*__self_0_0)); | |
let _ = builder.field("minor", &&(*__self_0_1)); | |
let _ = builder.field("name", &&(*__self_0_2)); | |
let _ = builder.field("num_of_funcs", &&(*__self_0_3)); | |
let _ = builder.field("funcs", &&(*__self_0_4)); | |
let _ = builder.field("load", &&(*__self_0_5)); | |
let _ = builder.field("reload", &&(*__self_0_6)); | |
let _ = builder.field("upgrade", &&(*__self_0_7)); | |
let _ = builder.field("unload", &&(*__self_0_8)); | |
let _ = builder.field("vm_variant", &&(*__self_0_9)); | |
let _ = builder.field("options", &&(*__self_0_10)); | |
builder.finish() | |
} | |
} | |
} | |
} | |
pub const ERL_NIF_DIRTY_NIF_OPTION: c_uint = 1; | |
/// See [ErlNifBinary](http://www.erlang.org/doc/man/erl_nif.html#ErlNifBinary) in the Erlang docs. | |
#[allow(missing_copy_implementations)] | |
#[repr(C)] | |
pub struct ErlNifBinary { | |
pub size: size_t, | |
pub data: *mut u8, | |
bin_term: ERL_NIF_TERM, | |
ref_bin: *mut c_void, | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
#[allow(missing_copy_implementations)] | |
impl ::std::fmt::Debug for ErlNifBinary { | |
fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { | |
match *self { | |
ErlNifBinary { | |
size: ref __self_0_0, | |
data: ref __self_0_1, | |
bin_term: ref __self_0_2, | |
ref_bin: ref __self_0_3 } => { | |
let mut builder = __arg_0.debug_struct("ErlNifBinary"); | |
let _ = builder.field("size", &&(*__self_0_0)); | |
let _ = builder.field("data", &&(*__self_0_1)); | |
let _ = builder.field("bin_term", &&(*__self_0_2)); | |
let _ = builder.field("ref_bin", &&(*__self_0_3)); | |
builder.finish() | |
} | |
} | |
} | |
} | |
/// See [ErlNifResourceType](http://www.erlang.org/doc/man/erl_nif.html#ErlNifResourceType) in the Erlang docs. | |
#[allow(missing_copy_implementations)] | |
#[repr(C)] | |
pub struct ErlNifResourceType { | |
dummy: c_int, | |
} | |
/// See [ErlNifResourceDtor](http://www.erlang.org/doc/man/erl_nif.html#ErlNifResourceDtor) in the Erlang docs. | |
#[allow(missing_copy_implementations)] | |
pub type ErlNifResourceDtor = | |
unsafe extern "C" fn(arg1: *mut ErlNifEnv, arg2: *mut c_void) -> (); | |
/// See [ErlNifResourceFlags](http://www.erlang.org/doc/man/erl_nif.html#ErlNifResourceFlags) in the Erlang docs. | |
#[repr(C)] | |
#[rustc_copy_clone_marker] | |
pub enum ErlNifResourceFlags { | |
ERL_NIF_RT_CREATE = 1, | |
ERL_NIF_RT_TAKEOVER = 2, | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::fmt::Debug for ErlNifResourceFlags { | |
fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { | |
match (&*self,) { | |
(&ErlNifResourceFlags::ERL_NIF_RT_CREATE,) => { | |
let mut builder = __arg_0.debug_tuple("ERL_NIF_RT_CREATE"); | |
builder.finish() | |
} | |
(&ErlNifResourceFlags::ERL_NIF_RT_TAKEOVER,) => { | |
let mut builder = __arg_0.debug_tuple("ERL_NIF_RT_TAKEOVER"); | |
builder.finish() | |
} | |
} | |
} | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::marker::Copy for ErlNifResourceFlags { } | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::clone::Clone for ErlNifResourceFlags { | |
#[inline] | |
fn clone(&self) -> ErlNifResourceFlags { { *self } } | |
} | |
/// See [ErlNifCharEncoding](http://www.erlang.org/doc/man/erl_nif.html#ErlNifCharEncoding) in the Erlang docs. | |
#[repr(C)] | |
#[rustc_copy_clone_marker] | |
pub enum ErlNifCharEncoding { | |
ERL_NIF_LATIN1 = 1, | |
DUMMY = 999, // prevents "univariant enum" compile error | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::fmt::Debug for ErlNifCharEncoding { | |
fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { | |
match (&*self,) { | |
(&ErlNifCharEncoding::ERL_NIF_LATIN1,) => { | |
let mut builder = __arg_0.debug_tuple("ERL_NIF_LATIN1"); | |
builder.finish() | |
} | |
(&ErlNifCharEncoding::DUMMY,) => { | |
let mut builder = __arg_0.debug_tuple("DUMMY"); | |
builder.finish() | |
} | |
} | |
} | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::marker::Copy for ErlNifCharEncoding { } | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::clone::Clone for ErlNifCharEncoding { | |
#[inline] | |
fn clone(&self) -> ErlNifCharEncoding { { *self } } | |
} | |
/// See [ErlNifPid](http://www.erlang.org/doc/man/erl_nif.html#ErlNifPid) in the Erlang docs. | |
#[repr(C)] | |
#[rustc_copy_clone_marker] | |
pub struct ErlNifPid { | |
pid: ERL_NIF_TERM, | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::fmt::Debug for ErlNifPid { | |
fn fmt(&self, __arg_0: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { | |
match *self { | |
ErlNifPid { pid: ref __self_0_0 } => { | |
let mut builder = __arg_0.debug_struct("ErlNifPid"); | |
let _ = builder.field("pid", &&(*__self_0_0)); | |
builder.finish() | |
} | |
} | |
} | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::marker::Copy for ErlNifPid { } | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::clone::Clone for ErlNifPid { | |
#[inline] | |
fn clone(&self) -> ErlNifPid { | |
{ let _: ::std::clone::AssertParamIsClone<ERL_NIF_TERM>; *self } | |
} | |
} | |
/// See [enif_make_pid](http://erlang.org/doc/man/erl_nif.html#enif_make_pid) in the Erlang docs | |
pub unsafe fn enif_make_pid(_env: *mut ErlNifEnv, pid: &ErlNifPid) | |
-> ERL_NIF_TERM { | |
pid.pid | |
} | |
/// See [ErlNifSysInfo](http://www.erlang.org/doc/man/erl_nif.html#ErlNifSysInfo) in the Erlang docs. | |
#[allow(missing_copy_implementations)] | |
#[repr(C)] | |
pub struct ErlNifSysInfo { | |
pub driver_major_version: c_int, | |
pub driver_minor_version: c_int, | |
pub erts_version: *mut c_char, | |
pub otp_release: *mut c_char, | |
pub thread_support: c_int, | |
pub smp_support: c_int, | |
pub async_threads: c_int, | |
pub scheduler_threads: c_int, | |
pub nif_major_version: c_int, | |
pub nif_minor_version: c_int, | |
pub dirty_scheduler_support: c_int, | |
} | |
// /// See [ErlNifFunc](http://www.erlang.org/doc/man/erl_nif.html#ErlNifFunc) in the Erlang docs. | |
// #[derive(Copy, Clone)] | |
// #[repr(C)] | |
// pub enum ErlNifDirtyTaskFlags { | |
// ERL_NIF_DIRTY_JOB_CPU_BOUND = 1, | |
// ERL_NIF_DIRTY_JOB_IO_BOUND = 2, | |
// } | |
pub type ErlNifDirtyTaskFlags = c_uint; | |
pub const ERL_NIF_DIRTY_JOB_CPU_BOUND: ErlNifDirtyTaskFlags = 1; | |
pub const ERL_NIF_DIRTY_JOB_IO_BOUND: ErlNifDirtyTaskFlags = 2; | |
/// See [ErlNifMapIterator](http://www.erlang.org/doc/man/erl_nif.html#ErlNifMapIterator) in the Erlang docs. | |
#[allow(missing_copy_implementations)] | |
#[repr(C)] | |
pub struct ErlNifMapIterator { | |
map: ERL_NIF_TERM, | |
t_limit: ERL_NIF_UINT, | |
idx: ERL_NIF_UINT, | |
ks: *mut ERL_NIF_TERM, | |
vs: *mut ERL_NIF_TERM, | |
__spare__: [*mut c_void; 2], | |
} | |
/// See [ErlNifMapIteratorEntry](http://www.erlang.org/doc/man/erl_nif.html#ErlNifMapIteratorEntry) in the Erlang docs. | |
#[repr(C)] | |
#[rustc_copy_clone_marker] | |
pub enum ErlNifMapIteratorEntry { | |
ERL_NIF_MAP_ITERATOR_HEAD = 1, | |
ERL_NIF_MAP_ITERATOR_TAIL = 2, | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::marker::Copy for ErlNifMapIteratorEntry { } | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::clone::Clone for ErlNifMapIteratorEntry { | |
#[inline] | |
fn clone(&self) -> ErlNifMapIteratorEntry { { *self } } | |
} | |
/// See [ErlNifTime](http://www.erlang.org/doc/man/erl_nif.html#ErlNifTime) in the Erlang docs. | |
pub type ErlNifTime = i64; | |
/// Error return value for `enif_monotonic_time()`, `enif_time_offset()`, and `enif_convert_time_unit()`. | |
pub const ERL_NIF_TIME_ERROR: i64 = -9223372036854775808; | |
//const ERL_NIF_TIME_ERROR:i64 = i64::min_value(); "error: const fn's not yet stable" | |
/// See [ErlNifTimeUnit](http://www.erlang.org/doc/man/erl_nif.html#ErlNifTimeUnit) in the Erlang docs. | |
#[repr(C)] | |
#[rustc_copy_clone_marker] | |
pub enum ErlNifTimeUnit { | |
// values yanked from https://github.com/erlang/otp/blob/7cb403e4aa044fd2cc7702dbe8e2d0eea68e81f3/erts/emulator/beam/erl_drv_nif.h#L132 | |
ERL_NIF_SEC = 0, | |
ERL_NIF_MSEC = 1, | |
ERL_NIF_USEC = 2, | |
ERL_NIF_NSEC = 3, | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::marker::Copy for ErlNifTimeUnit { } | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::clone::Clone for ErlNifTimeUnit { | |
#[inline] | |
fn clone(&self) -> ErlNifTimeUnit { { *self } } | |
} | |
/// See [ErlNifUniqueInteger](http://erlang.org/doc/man/erl_nif.html#ErlNifUniqueInteger) in the Erlang docs. | |
pub type ErlNifUniqueInteger = c_int; | |
pub const ERL_NIF_UNIQUE_POSITIVE: ErlNifUniqueInteger = (1 << 0); | |
pub const ERL_NIF_UNIQUE_MONOTONIC: ErlNifUniqueInteger = (1 << 1); | |
// ref https://github.com/erlang/otp/blob/maint/erts/emulator/beam/erl_nif.h#L203 | |
// FIXME: Should actually be C enum, but repr(C) enums in Rust can't be used as bitfields. | |
// Fix if the right abstraction ever lands in Rust. | |
/// See [ErlNifPort](http://erlang.org/doc/man/erl_nif.html#ErlNifPort) in the Erlang docs. | |
#[repr(C)] | |
#[rustc_copy_clone_marker] | |
pub struct ErlNifPort { | |
port_id: ERL_NIF_TERM, // internal, may change | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::marker::Copy for ErlNifPort { } | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
impl ::std::clone::Clone for ErlNifPort { | |
#[inline] | |
fn clone(&self) -> ErlNifPort { | |
{ let _: ::std::clone::AssertParamIsClone<ERL_NIF_TERM>; *self } | |
} | |
} | |
// ref https://github.com/erlang/otp/blob/maint/erts/emulator/beam/erl_nif.h#L155 | |
/// See [ErlNifBinaryToTerm](http://erlang.org/doc/man/erl_nif.html#ErlNifBinaryToTerm) in the Erlang docs. | |
pub type ErlNifBinaryToTerm = c_int; | |
pub const ERL_NIF_BIN2TERM_SAFE: ErlNifBinaryToTerm = 536870912; | |
pub const ERL_NIF_THR_UNDEFINED: c_int = 0; | |
pub const ERL_NIF_THR_NORMAL_SCHEDULER: c_int = 1; | |
pub const ERL_NIF_THR_DIRTY_CPU_SCHEDULER: c_int = 2; | |
pub const ERL_NIF_THR_DIRTY_IO_SCHEDULER: c_int = 3; | |
// example of included content: | |
// extern "C" { | |
// pub fn enif_priv_data(arg1: *mut ErlNifEnv) -> *mut c_void; | |
// pub fn enif_alloc(size: size_t) -> *mut c_void; | |
// pub fn enif_free(ptr: *mut c_void); | |
// pub fn enif_is_atom(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int; | |
// pub fn enif_is_binary(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int; | |
// ... | |
//std::ptr::copy_nonoverlapping(callbacks, &WinDynNifCallbacks, std::mem::size_of<TWinDynNifCallbacks>()); | |
// add default options if elided | |
// strip trailing comma in funcs | |
// start closure | |
// initialize as much as possible statically | |
// get a safe mutable reference once to avoid repeated unsafe | |
// perform dynamic insertions | |
// return static entry reference | |
// end closure | |
// For legacy nif_init!() invocation, deprecated | |
// start closure | |
// get a safe mutable reference once to avoid repeated unsafe | |
// perform dynamic insertions | |
// return static entry reference | |
// end closure | |
//($entry:ident$($rest:tt)*) => ($($rest)*); | |
// Initializer tests | |
// shouldn't panic or crash | |
// optionals in different order as opt_some2 | |
// shouldn't panic or crash | |
// optionals in different order as opt_some2 | |
// shouldn't panic or crash | |
// <- trailing comma | |
// <- trailing comma | |
pub const ERL_NIF_ENTRY_OPTIONS: c_uint = ERL_NIF_DIRTY_NIF_OPTION; | |
pub const NIF_MAJOR_VERSION: c_int = 2; | |
pub const NIF_MINOR_VERSION: c_int = 11; | |
#[allow(dead_code)] | |
#[rustc_copy_clone_marker] | |
pub struct TWinDynNifCallbacks { | |
enif_priv_data: fn(arg1: *mut ErlNifEnv) -> *mut c_void, | |
enif_alloc: fn(size: size_t) -> *mut c_void, | |
enif_free: fn(ptr: *mut c_void), | |
enif_is_atom: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_is_binary: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_is_ref: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_inspect_binary: fn(arg1: *mut ErlNifEnv, bin_term: ERL_NIF_TERM, | |
bin: *mut ErlNifBinary) -> c_int, | |
enif_alloc_binary: fn(size: size_t, bin: *mut ErlNifBinary) -> c_int, | |
enif_realloc_binary: fn(bin: *mut ErlNifBinary, size: size_t) -> c_int, | |
enif_release_binary: fn(bin: *mut ErlNifBinary), | |
enif_get_int: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, ip: *mut c_int) | |
-> c_int, | |
enif_get_ulong: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_ulong) -> c_int, | |
enif_get_double: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
dp: *mut c_double) -> c_int, | |
enif_get_list_cell: fn(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
head: *mut ERL_NIF_TERM, tail: *mut ERL_NIF_TERM) | |
-> c_int, | |
enif_get_tuple: fn(env: *mut ErlNifEnv, tpl: ERL_NIF_TERM, | |
arity: *mut c_int, array: *mut *const ERL_NIF_TERM) | |
-> c_int, | |
enif_is_identical: fn(lhs: ERL_NIF_TERM, rhs: ERL_NIF_TERM) -> c_int, | |
enif_compare: fn(lhs: ERL_NIF_TERM, rhs: ERL_NIF_TERM) -> c_int, | |
enif_make_binary: fn(env: *mut ErlNifEnv, bin: *mut ErlNifBinary) | |
-> ERL_NIF_TERM, | |
enif_make_badarg: fn(env: *mut ErlNifEnv) -> ERL_NIF_TERM, | |
enif_make_int: fn(env: *mut ErlNifEnv, i: c_int) -> ERL_NIF_TERM, | |
enif_make_ulong: fn(env: *mut ErlNifEnv, i: c_ulong) -> ERL_NIF_TERM, | |
enif_make_double: fn(env: *mut ErlNifEnv, d: c_double) -> ERL_NIF_TERM, | |
enif_make_atom: fn(env: *mut ErlNifEnv, name: *const c_uchar) | |
-> ERL_NIF_TERM, | |
enif_make_existing_atom: fn(env: *mut ErlNifEnv, name: *const c_uchar, | |
atom: *mut ERL_NIF_TERM, | |
arg1: ErlNifCharEncoding) -> c_int, | |
dummy_enif_make_tuple: fn(), | |
dummy_enif_make_list: fn(), | |
enif_make_list_cell: fn(env: *mut ErlNifEnv, car: ERL_NIF_TERM, | |
cdr: ERL_NIF_TERM) -> ERL_NIF_TERM, | |
enif_make_string: fn(env: *mut ErlNifEnv, string: *const c_uchar, | |
arg1: ErlNifCharEncoding) -> ERL_NIF_TERM, | |
enif_make_ref: fn(env: *mut ErlNifEnv) -> ERL_NIF_TERM, | |
dummy_enif_mutex_create: fn(), | |
dummy_enif_mutex_destroy: fn(), | |
dummy_enif_mutex_trylock: fn(), | |
dummy_enif_mutex_lock: fn(), | |
dummy_enif_mutex_unlock: fn(), | |
dummy_enif_cond_create: fn(), | |
dummy_enif_cond_destroy: fn(), | |
dummy_enif_cond_signal: fn(), | |
dummy_enif_cond_broadcast: fn(), | |
dummy_enif_cond_wait: fn(), | |
dummy_enif_rwlock_create: fn(), | |
dummy_enif_rwlock_destroy: fn(), | |
dummy_enif_rwlock_tryrlock: fn(), | |
dummy_enif_rwlock_rlock: fn(), | |
dummy_enif_rwlock_runlock: fn(), | |
dummy_enif_rwlock_tryrwlock: fn(), | |
dummy_enif_rwlock_rwlock: fn(), | |
dummy_enif_rwlock_rwunlock: fn(), | |
dummy_enif_tsd_key_create: fn(), | |
dummy_enif_tsd_key_destroy: fn(), | |
dummy_enif_tsd_set: fn(), | |
dummy_enif_tsd_get: fn(), | |
dummy_enif_thread_opts_create: fn(), | |
dummy_enif_thread_opts_destroy: fn(), | |
dummy_enif_thread_create: fn(), | |
dummy_enif_thread_self: fn(), | |
dummy_enif_equal_tids: fn(), | |
dummy_enif_thread_exit: fn(), | |
dummy_enif_thread_join: fn(), | |
enif_realloc: fn(ptr: *mut c_void, size: size_t) -> *mut c_void, | |
enif_system_info: fn(sip: *mut ErlNifSysInfo, si_size: size_t), | |
dummy_enif_fprintf: fn(), | |
enif_inspect_iolist_as_binary: fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
bin: *mut ErlNifBinary) -> c_int, | |
enif_make_sub_binary: fn(arg1: *mut ErlNifEnv, bin_term: ERL_NIF_TERM, | |
pos: size_t, size: size_t) -> ERL_NIF_TERM, | |
enif_get_string: fn(arg1: *mut ErlNifEnv, list: ERL_NIF_TERM, | |
buf: *mut c_uchar, len: c_uint, | |
arg2: ErlNifCharEncoding) -> c_int, | |
enif_get_atom: fn(arg1: *mut ErlNifEnv, atom: ERL_NIF_TERM, | |
buf: *mut c_uchar, len: c_uint, | |
arg2: ErlNifCharEncoding) -> c_int, | |
enif_is_fun: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_is_pid: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_is_port: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_get_uint: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_uint) -> c_int, | |
enif_get_long: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_long) -> c_int, | |
enif_make_uint: fn(arg1: *mut ErlNifEnv, i: c_uint) -> ERL_NIF_TERM, | |
enif_make_long: fn(arg1: *mut ErlNifEnv, i: c_long) -> ERL_NIF_TERM, | |
enif_make_tuple_from_array: fn(arg1: *mut ErlNifEnv, | |
arr: *const ERL_NIF_TERM, cnt: c_uint) | |
-> ERL_NIF_TERM, | |
enif_make_list_from_array: fn(arg1: *mut ErlNifEnv, | |
arr: *const ERL_NIF_TERM, cnt: c_uint) | |
-> ERL_NIF_TERM, | |
enif_is_empty_list: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_open_resource_type: fn(arg1: *mut ErlNifEnv, | |
module_str: *const c_uchar, | |
name_str: *const c_uchar, | |
dtor: | |
Option<unsafe extern "C" fn(arg1: | |
*mut ErlNifEnv, | |
arg2: | |
*mut c_void)>, | |
flags: ErlNifResourceFlags, | |
tried: *mut ErlNifResourceFlags) | |
-> *const ErlNifResourceType, | |
enif_alloc_resource: fn(_type: *const ErlNifResourceType, size: size_t) | |
-> *mut c_void, | |
enif_release_resource: fn(obj: *const c_void), | |
enif_make_resource: fn(arg1: *mut ErlNifEnv, obj: *const c_void) | |
-> ERL_NIF_TERM, | |
enif_get_resource: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
_type: *const ErlNifResourceType, | |
objp: *mut *const c_void) -> c_int, | |
enif_sizeof_resource: fn(obj: *const c_void) -> size_t, | |
enif_make_new_binary: fn(arg1: *mut ErlNifEnv, size: size_t, | |
termp: *mut ERL_NIF_TERM) -> *mut c_uchar, | |
enif_is_list: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_is_tuple: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_get_atom_length: fn(arg1: *mut ErlNifEnv, atom: ERL_NIF_TERM, | |
len: *mut c_uint, arg2: ErlNifCharEncoding) | |
-> c_int, | |
enif_get_list_length: fn(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
len: *mut c_uint) -> c_int, | |
enif_make_atom_len: fn(env: *mut ErlNifEnv, name: *const c_uchar, | |
len: size_t) -> ERL_NIF_TERM, | |
enif_make_existing_atom_len: fn(env: *mut ErlNifEnv, name: *const c_uchar, | |
len: size_t, atom: *mut ERL_NIF_TERM, | |
arg1: ErlNifCharEncoding) -> c_int, | |
enif_make_string_len: fn(env: *mut ErlNifEnv, string: *const c_uchar, | |
len: size_t, arg1: ErlNifCharEncoding) | |
-> ERL_NIF_TERM, | |
enif_alloc_env: fn() -> *mut ErlNifEnv, | |
enif_free_env: fn(env: *mut ErlNifEnv), | |
enif_clear_env: fn(env: *mut ErlNifEnv), | |
enif_send: fn(env: *mut ErlNifEnv, to_pid: *const ErlNifPid, | |
msg_env: *mut ErlNifEnv, msg: ERL_NIF_TERM) -> c_int, | |
enif_make_copy: fn(dst_env: *mut ErlNifEnv, src_term: ERL_NIF_TERM) | |
-> ERL_NIF_TERM, | |
enif_self: fn(caller_env: *mut ErlNifEnv, pid: *mut ErlNifPid) | |
-> *mut ErlNifPid, | |
enif_get_local_pid: fn(env: *mut ErlNifEnv, arg1: ERL_NIF_TERM, | |
pid: *mut ErlNifPid) -> c_int, | |
enif_keep_resource: fn(obj: *const c_void), | |
enif_make_resource_binary: fn(arg1: *mut ErlNifEnv, obj: *const c_void, | |
data: *const c_void, size: size_t) | |
-> ERL_NIF_TERM, | |
enif_get_int64: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_longlong) -> c_int, | |
enif_get_uint64: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_ulonglong) -> c_int, | |
enif_make_int64: fn(env: *mut ErlNifEnv, i: c_longlong) -> ERL_NIF_TERM, | |
enif_make_uint64: fn(env: *mut ErlNifEnv, i: c_ulonglong) -> ERL_NIF_TERM, | |
enif_is_exception: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_make_reverse_list: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
list: *mut ERL_NIF_TERM) -> c_int, | |
enif_is_number: fn(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_dlopen: fn(lib: *const c_uchar, | |
err_handler: | |
Option<unsafe extern "C" fn(arg1: *mut c_void, | |
arg2: *const c_uchar)>, | |
err_arg: *mut c_void) -> *mut c_void, | |
enif_dlsym: fn(handle: *mut c_void, symbol: *const c_uchar, | |
err_handler: | |
Option<unsafe extern "C" fn(arg1: *mut c_void, | |
arg2: *const c_uchar)>, | |
err_arg: *mut c_void) -> *mut c_void, | |
enif_consume_timeslice: fn(arg1: *mut ErlNifEnv, percent: c_int) -> c_int, | |
enif_is_map: fn(env: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int, | |
enif_get_map_size: fn(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
size: *mut size_t) -> c_int, | |
enif_make_new_map: fn(env: *mut ErlNifEnv) -> ERL_NIF_TERM, | |
enif_make_map_put: fn(env: *mut ErlNifEnv, map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, value: ERL_NIF_TERM, | |
map_out: *mut ERL_NIF_TERM) -> c_int, | |
enif_get_map_value: fn(env: *mut ErlNifEnv, map: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, value: *mut ERL_NIF_TERM) | |
-> c_int, | |
enif_make_map_update: fn(env: *mut ErlNifEnv, map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, value: ERL_NIF_TERM, | |
map_out: *mut ERL_NIF_TERM) -> c_int, | |
enif_make_map_remove: fn(env: *mut ErlNifEnv, map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, map_out: *mut ERL_NIF_TERM) | |
-> c_int, | |
enif_map_iterator_create: fn(env: *mut ErlNifEnv, map: ERL_NIF_TERM, | |
iter: *mut ErlNifMapIterator, | |
entry: ErlNifMapIteratorEntry) -> c_int, | |
enif_map_iterator_destroy: fn(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator), | |
enif_map_iterator_is_head: fn(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) -> c_int, | |
enif_map_iterator_is_tail: fn(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) -> c_int, | |
enif_map_iterator_next: fn(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) -> c_int, | |
enif_map_iterator_prev: fn(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) -> c_int, | |
enif_map_iterator_get_pair: fn(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator, | |
key: *mut ERL_NIF_TERM, | |
value: *mut ERL_NIF_TERM) -> c_int, | |
enif_schedule_nif: fn(env: *mut ErlNifEnv, fun_name: *const c_uchar, | |
flags: c_int, | |
dtor: | |
Option<unsafe extern "C" fn(env: *mut ErlNifEnv, | |
argc: c_int, | |
argv: | |
*const ERL_NIF_TERM)>, | |
argc: c_int, argv: *const ERL_NIF_TERM) | |
-> ERL_NIF_TERM, | |
enif_has_pending_exception: fn(env: *mut ErlNifEnv, | |
reason: *mut ERL_NIF_TERM) -> c_int, | |
enif_raise_exception: fn(env: *mut ErlNifEnv, reason: ERL_NIF_TERM) | |
-> ERL_NIF_TERM, | |
enif_getenv: fn(key: *const c_uchar, value: *mut c_uchar, | |
value_size: *mut size_t) -> c_int, | |
enif_monotonic_time: fn(unit: ErlNifTimeUnit) -> ErlNifTime, | |
enif_time_offset: fn(unit: ErlNifTimeUnit) -> ErlNifTime, | |
enif_convert_time_unit: fn(time: ErlNifTime, from_unit: ErlNifTimeUnit, | |
to_unit: ErlNifTimeUnit) -> ErlNifTime, | |
enif_now_time: fn(env: *mut ErlNifEnv) -> ERL_NIF_TERM, | |
enif_cpu_time: fn(env: *mut ErlNifEnv) -> ERL_NIF_TERM, | |
enif_make_unique_integer: fn(env: *mut ErlNifEnv, | |
properties: ErlNifUniqueInteger) | |
-> ERL_NIF_TERM, | |
enif_is_current_process_alive: fn(env: *mut ErlNifEnv) -> c_int, | |
enif_is_process_alive: fn(env: *mut ErlNifEnv, pid: *const ErlNifPid) | |
-> c_int, | |
enif_is_port_alive: fn(env: *mut ErlNifEnv, port_id: *const ErlNifPort) | |
-> c_int, | |
enif_get_local_port: fn(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
port_id: *mut ErlNifPort) -> c_int, | |
enif_term_to_binary: fn(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
bin: *mut ErlNifBinary) -> c_int, | |
enif_binary_to_term: fn(env: *mut ErlNifEnv, data: *const c_uchar, | |
sz: usize, term: *mut ERL_NIF_TERM, | |
opts: ErlNifBinaryToTerm) -> usize, | |
enif_port_command: fn(env: *mut ErlNifEnv, to_port: *const ErlNifPort, | |
msg_env: *mut ErlNifEnv, msg: ERL_NIF_TERM) | |
-> c_int, | |
enif_thread_type: fn() -> c_int, | |
dummy_enif_snprintf: fn(), | |
} | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
#[allow(dead_code)] | |
impl ::std::marker::Copy for TWinDynNifCallbacks { } | |
#[automatically_derived] | |
#[allow(unused_qualifications)] | |
#[allow(dead_code)] | |
impl ::std::clone::Clone for TWinDynNifCallbacks { | |
#[inline] | |
fn clone(&self) -> TWinDynNifCallbacks { | |
{ | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv) | |
-> *mut c_void>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(size: size_t) | |
-> *mut c_void>; | |
let _: ::std::clone::AssertParamIsClone<fn(ptr: *mut c_void)>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
bin_term: | |
ERL_NIF_TERM, | |
bin: | |
*mut ErlNifBinary) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(size: size_t, | |
bin: | |
*mut ErlNifBinary) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(bin: | |
*mut ErlNifBinary, | |
size: size_t) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(bin: | |
*mut ErlNifBinary)>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
ip: *mut c_int) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
ip: *mut c_ulong) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
dp: *mut c_double) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
head: | |
*mut ERL_NIF_TERM, | |
tail: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
tpl: ERL_NIF_TERM, | |
arity: *mut c_int, | |
array: | |
*mut *const ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(lhs: ERL_NIF_TERM, | |
rhs: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(lhs: ERL_NIF_TERM, | |
rhs: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
bin: | |
*mut ErlNifBinary) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
i: c_int) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
i: c_ulong) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
d: c_double) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
name: *const c_uchar) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
name: *const c_uchar, | |
atom: | |
*mut ERL_NIF_TERM, | |
arg1: | |
ErlNifCharEncoding) | |
-> c_int>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
car: ERL_NIF_TERM, | |
cdr: ERL_NIF_TERM) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
string: | |
*const c_uchar, | |
arg1: | |
ErlNifCharEncoding) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv) | |
-> ERL_NIF_TERM>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(ptr: *mut c_void, | |
size: size_t) | |
-> *mut c_void>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(sip: | |
*mut ErlNifSysInfo, | |
si_size: size_t)>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
bin: | |
*mut ErlNifBinary) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
bin_term: | |
ERL_NIF_TERM, | |
pos: size_t, | |
size: size_t) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
list: ERL_NIF_TERM, | |
buf: *mut c_uchar, | |
len: c_uint, | |
arg2: | |
ErlNifCharEncoding) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
atom: ERL_NIF_TERM, | |
buf: *mut c_uchar, | |
len: c_uint, | |
arg2: | |
ErlNifCharEncoding) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
ip: *mut c_uint) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
ip: *mut c_long) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
i: c_uint) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
i: c_long) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
arr: | |
*const ERL_NIF_TERM, | |
cnt: c_uint) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
arr: | |
*const ERL_NIF_TERM, | |
cnt: c_uint) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
module_str: | |
*const c_uchar, | |
name_str: | |
*const c_uchar, | |
dtor: | |
Option<unsafe extern "C" fn(arg1: | |
*mut ErlNifEnv, | |
arg2: | |
*mut c_void)>, | |
flags: | |
ErlNifResourceFlags, | |
tried: | |
*mut ErlNifResourceFlags) | |
-> | |
*const ErlNifResourceType>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(_type: | |
*const ErlNifResourceType, | |
size: size_t) | |
-> *mut c_void>; | |
let _: ::std::clone::AssertParamIsClone<fn(obj: *const c_void)>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
obj: *const c_void) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
_type: | |
*const ErlNifResourceType, | |
objp: | |
*mut *const c_void) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(obj: *const c_void) | |
-> size_t>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
size: size_t, | |
termp: | |
*mut ERL_NIF_TERM) | |
-> *mut c_uchar>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
atom: ERL_NIF_TERM, | |
len: *mut c_uint, | |
arg2: | |
ErlNifCharEncoding) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
len: *mut c_uint) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
name: *const c_uchar, | |
len: size_t) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
name: *const c_uchar, | |
len: size_t, | |
atom: | |
*mut ERL_NIF_TERM, | |
arg1: | |
ErlNifCharEncoding) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
string: | |
*const c_uchar, | |
len: size_t, | |
arg1: | |
ErlNifCharEncoding) | |
-> ERL_NIF_TERM>; | |
let _: ::std::clone::AssertParamIsClone<fn() -> *mut ErlNifEnv>; | |
let _: ::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv)>; | |
let _: ::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv)>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
to_pid: | |
*const ErlNifPid, | |
msg_env: | |
*mut ErlNifEnv, | |
msg: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(dst_env: | |
*mut ErlNifEnv, | |
src_term: | |
ERL_NIF_TERM) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(caller_env: | |
*mut ErlNifEnv, | |
pid: *mut ErlNifPid) | |
-> *mut ErlNifPid>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
arg1: ERL_NIF_TERM, | |
pid: *mut ErlNifPid) | |
-> c_int>; | |
let _: ::std::clone::AssertParamIsClone<fn(obj: *const c_void)>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
obj: *const c_void, | |
data: *const c_void, | |
size: size_t) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
ip: *mut c_longlong) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
ip: *mut c_ulonglong) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
i: c_longlong) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
i: c_ulonglong) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
list: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(lib: *const c_uchar, | |
err_handler: | |
Option<unsafe extern "C" fn(arg1: | |
*mut c_void, | |
arg2: | |
*const c_uchar)>, | |
err_arg: *mut c_void) | |
-> *mut c_void>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(handle: *mut c_void, | |
symbol: | |
*const c_uchar, | |
err_handler: | |
Option<unsafe extern "C" fn(arg1: | |
*mut c_void, | |
arg2: | |
*const c_uchar)>, | |
err_arg: *mut c_void) | |
-> *mut c_void>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(arg1: *mut ErlNifEnv, | |
percent: c_int) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
term: ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
size: *mut size_t) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, | |
value: ERL_NIF_TERM, | |
map_out: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
map: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, | |
value: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, | |
value: ERL_NIF_TERM, | |
map_out: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, | |
map_out: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
map: ERL_NIF_TERM, | |
iter: | |
*mut ErlNifMapIterator, | |
entry: | |
ErlNifMapIteratorEntry) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
iter: | |
*mut ErlNifMapIterator)>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
iter: | |
*mut ErlNifMapIterator) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
iter: | |
*mut ErlNifMapIterator) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
iter: | |
*mut ErlNifMapIterator) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
iter: | |
*mut ErlNifMapIterator) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
iter: | |
*mut ErlNifMapIterator, | |
key: | |
*mut ERL_NIF_TERM, | |
value: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
fun_name: | |
*const c_uchar, | |
flags: c_int, | |
dtor: | |
Option<unsafe extern "C" fn(env: | |
*mut ErlNifEnv, | |
argc: | |
c_int, | |
argv: | |
*const ERL_NIF_TERM)>, | |
argc: c_int, | |
argv: | |
*const ERL_NIF_TERM) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
reason: | |
*mut ERL_NIF_TERM) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
reason: ERL_NIF_TERM) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(key: *const c_uchar, | |
value: *mut c_uchar, | |
value_size: | |
*mut size_t) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(unit: ErlNifTimeUnit) | |
-> ErlNifTime>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(unit: ErlNifTimeUnit) | |
-> ErlNifTime>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(time: ErlNifTime, | |
from_unit: | |
ErlNifTimeUnit, | |
to_unit: | |
ErlNifTimeUnit) | |
-> ErlNifTime>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
properties: | |
ErlNifUniqueInteger) | |
-> ERL_NIF_TERM>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
pid: *const ErlNifPid) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
port_id: | |
*const ErlNifPort) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
port_id: | |
*mut ErlNifPort) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
bin: | |
*mut ErlNifBinary) | |
-> c_int>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
data: *const c_uchar, | |
sz: usize, | |
term: | |
*mut ERL_NIF_TERM, | |
opts: | |
ErlNifBinaryToTerm) | |
-> usize>; | |
let _: | |
::std::clone::AssertParamIsClone<fn(env: *mut ErlNifEnv, | |
to_port: | |
*const ErlNifPort, | |
msg_env: | |
*mut ErlNifEnv, | |
msg: ERL_NIF_TERM) | |
-> c_int>; | |
let _: ::std::clone::AssertParamIsClone<fn() -> c_int>; | |
let _: ::std::clone::AssertParamIsClone<fn()>; | |
*self | |
} | |
} | |
} | |
pub static mut WIN_DYN_NIF_CALLBACKS: Option<TWinDynNifCallbacks> = None; | |
/// See [enif_priv_data](http://www.erlang.org/doc/man/erl_nif.html#enif_priv_data) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_priv_data(arg1: *mut ErlNifEnv) -> *mut c_void { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_priv_data)(arg1) | |
} | |
/// See [enif_alloc](http://www.erlang.org/doc/man/erl_nif.html#enif_alloc) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_alloc(size: size_t) -> *mut c_void { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_alloc)(size) | |
} | |
/// See [enif_free](http://www.erlang.org/doc/man/erl_nif.html#enif_free) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_free(ptr: *mut c_void) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_free)(ptr) | |
} | |
/// See [enif_is_atom](http://www.erlang.org/doc/man/erl_nif.html#enif_is_atom) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_atom(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_atom)(arg1, term) | |
} | |
/// See [enif_is_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_is_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_binary(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_binary)(arg1, term) | |
} | |
/// See [enif_is_ref](http://www.erlang.org/doc/man/erl_nif.html#enif_is_ref) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_ref(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_ref)(arg1, term) | |
} | |
/// See [enif_inspect_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_inspect_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_inspect_binary(arg1: *mut ErlNifEnv, | |
bin_term: ERL_NIF_TERM, | |
bin: *mut ErlNifBinary) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_inspect_binary)(arg1, | |
bin_term, | |
bin) | |
} | |
/// See [enif_alloc_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_alloc_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_alloc_binary(size: size_t, bin: *mut ErlNifBinary) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_alloc_binary)(size, bin) | |
} | |
/// See [enif_realloc_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_realloc_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_realloc_binary(bin: *mut ErlNifBinary, size: size_t) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_realloc_binary)(bin, size) | |
} | |
/// See [enif_release_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_release_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_release_binary(bin: *mut ErlNifBinary) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_release_binary)(bin) | |
} | |
/// See [enif_get_int](http://www.erlang.org/doc/man/erl_nif.html#enif_get_int) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_int(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_int) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_int)(arg1, term, ip) | |
} | |
/// See [enif_get_ulong](http://www.erlang.org/doc/man/erl_nif.html#enif_get_ulong) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_ulong(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_ulong) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_ulong)(arg1, term, ip) | |
} | |
/// See [enif_get_double](http://www.erlang.org/doc/man/erl_nif.html#enif_get_double) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_double(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
dp: *mut c_double) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_double)(arg1, term, dp) | |
} | |
/// See [enif_get_list_cell](http://www.erlang.org/doc/man/erl_nif.html#enif_get_list_cell) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_list_cell(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
head: *mut ERL_NIF_TERM, | |
tail: *mut ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_list_cell)(env, term, | |
head, tail) | |
} | |
/// See [enif_get_tuple](http://www.erlang.org/doc/man/erl_nif.html#enif_get_tuple) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_tuple(env: *mut ErlNifEnv, tpl: ERL_NIF_TERM, | |
arity: *mut c_int, | |
array: *mut *const ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_tuple)(env, tpl, arity, | |
array) | |
} | |
/// See [enif_is_identical](http://www.erlang.org/doc/man/erl_nif.html#enif_is_identical) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_identical(lhs: ERL_NIF_TERM, rhs: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_identical)(lhs, rhs) | |
} | |
/// See [enif_compare](http://www.erlang.org/doc/man/erl_nif.html#enif_compare) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_compare(lhs: ERL_NIF_TERM, rhs: ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_compare)(lhs, rhs) | |
} | |
/// See [enif_make_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_make_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_binary(env: *mut ErlNifEnv, bin: *mut ErlNifBinary) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_binary)(env, bin) | |
} | |
/// See [enif_make_badarg](http://www.erlang.org/doc/man/erl_nif.html#enif_make_badarg) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_badarg(env: *mut ErlNifEnv) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_badarg)(env) | |
} | |
/// See [enif_make_int](http://www.erlang.org/doc/man/erl_nif.html#enif_make_int) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_int(env: *mut ErlNifEnv, i: c_int) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_int)(env, i) | |
} | |
/// See [enif_make_ulong](http://www.erlang.org/doc/man/erl_nif.html#enif_make_ulong) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_ulong(env: *mut ErlNifEnv, i: c_ulong) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_ulong)(env, i) | |
} | |
/// See [enif_make_double](http://www.erlang.org/doc/man/erl_nif.html#enif_make_double) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_double(env: *mut ErlNifEnv, d: c_double) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_double)(env, d) | |
} | |
/// See [enif_make_atom](http://www.erlang.org/doc/man/erl_nif.html#enif_make_atom) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_atom(env: *mut ErlNifEnv, name: *const c_uchar) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_atom)(env, name) | |
} | |
/// See [enif_make_existing_atom](http://www.erlang.org/doc/man/erl_nif.html#enif_make_existing_atom) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_existing_atom(env: *mut ErlNifEnv, | |
name: *const c_uchar, | |
atom: *mut ERL_NIF_TERM, | |
arg1: ErlNifCharEncoding) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_existing_atom)(env, | |
name, | |
atom, | |
arg1) | |
} | |
/// See [enif_make_list_cell](http://www.erlang.org/doc/man/erl_nif.html#enif_make_list_cell) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_list_cell(env: *mut ErlNifEnv, car: ERL_NIF_TERM, | |
cdr: ERL_NIF_TERM) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_list_cell)(env, car, | |
cdr) | |
} | |
/// See [enif_make_string](http://www.erlang.org/doc/man/erl_nif.html#enif_make_string) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_string(env: *mut ErlNifEnv, string: *const c_uchar, | |
arg1: ErlNifCharEncoding) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_string)(env, string, | |
arg1) | |
} | |
/// See [enif_make_ref](http://www.erlang.org/doc/man/erl_nif.html#enif_make_ref) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_ref(env: *mut ErlNifEnv) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_ref)(env) | |
} | |
/// See [enif_realloc](http://www.erlang.org/doc/man/erl_nif.html#enif_realloc) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_realloc(ptr: *mut c_void, size: size_t) -> *mut c_void { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_realloc)(ptr, size) | |
} | |
/// See [enif_system_info](http://www.erlang.org/doc/man/erl_nif.html#enif_system_info) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_system_info(sip: *mut ErlNifSysInfo, si_size: size_t) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_system_info)(sip, si_size) | |
} | |
/// See [enif_inspect_iolist_as_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_inspect_iolist_as_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_inspect_iolist_as_binary(arg1: *mut ErlNifEnv, | |
term: ERL_NIF_TERM, | |
bin: *mut ErlNifBinary) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_inspect_iolist_as_binary)(arg1, | |
term, | |
bin) | |
} | |
/// See [enif_make_sub_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_make_sub_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_sub_binary(arg1: *mut ErlNifEnv, | |
bin_term: ERL_NIF_TERM, pos: size_t, | |
size: size_t) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_sub_binary)(arg1, | |
bin_term, | |
pos, size) | |
} | |
/// See [enif_get_string](http://www.erlang.org/doc/man/erl_nif.html#enif_get_string) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_string(arg1: *mut ErlNifEnv, list: ERL_NIF_TERM, | |
buf: *mut c_uchar, len: c_uint, | |
arg2: ErlNifCharEncoding) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_string)(arg1, list, | |
buf, len, arg2) | |
} | |
/// See [enif_get_atom](http://www.erlang.org/doc/man/erl_nif.html#enif_get_atom) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_atom(arg1: *mut ErlNifEnv, atom: ERL_NIF_TERM, | |
buf: *mut c_uchar, len: c_uint, | |
arg2: ErlNifCharEncoding) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_atom)(arg1, atom, buf, | |
len, arg2) | |
} | |
/// See [enif_is_fun](http://www.erlang.org/doc/man/erl_nif.html#enif_is_fun) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_fun(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_fun)(arg1, term) | |
} | |
/// See [enif_is_pid](http://www.erlang.org/doc/man/erl_nif.html#enif_is_pid) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_pid(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_pid)(arg1, term) | |
} | |
/// See [enif_is_port](http://www.erlang.org/doc/man/erl_nif.html#enif_is_port) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_port(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_port)(arg1, term) | |
} | |
/// See [enif_get_uint](http://www.erlang.org/doc/man/erl_nif.html#enif_get_uint) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_uint(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_uint) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_uint)(arg1, term, ip) | |
} | |
/// See [enif_get_long](http://www.erlang.org/doc/man/erl_nif.html#enif_get_long) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_long(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_long) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_long)(arg1, term, ip) | |
} | |
/// See [enif_make_uint](http://www.erlang.org/doc/man/erl_nif.html#enif_make_uint) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_uint(arg1: *mut ErlNifEnv, i: c_uint) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_uint)(arg1, i) | |
} | |
/// See [enif_make_long](http://www.erlang.org/doc/man/erl_nif.html#enif_make_long) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_long(arg1: *mut ErlNifEnv, i: c_long) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_long)(arg1, i) | |
} | |
/// See [enif_make_tuple_from_array](http://www.erlang.org/doc/man/erl_nif.html#enif_make_tuple_from_array) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_tuple_from_array(arg1: *mut ErlNifEnv, | |
arr: *const ERL_NIF_TERM, | |
cnt: c_uint) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_tuple_from_array)(arg1, | |
arr, | |
cnt) | |
} | |
/// See [enif_make_list_from_array](http://www.erlang.org/doc/man/erl_nif.html#enif_make_list_from_array) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_list_from_array(arg1: *mut ErlNifEnv, | |
arr: *const ERL_NIF_TERM, cnt: c_uint) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_list_from_array)(arg1, | |
arr, | |
cnt) | |
} | |
/// See [enif_is_empty_list](http://www.erlang.org/doc/man/erl_nif.html#enif_is_empty_list) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_empty_list(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_empty_list)(arg1, term) | |
} | |
/// See [enif_open_resource_type](http://www.erlang.org/doc/man/erl_nif.html#enif_open_resource_type) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_open_resource_type(arg1: *mut ErlNifEnv, | |
module_str: *const c_uchar, | |
name_str: *const c_uchar, | |
dtor: | |
Option<unsafe extern "C" fn(arg1: | |
*mut ErlNifEnv, | |
arg2: | |
*mut c_void)>, | |
flags: ErlNifResourceFlags, | |
tried: *mut ErlNifResourceFlags) | |
-> *const ErlNifResourceType { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_open_resource_type)(arg1, | |
module_str, | |
name_str, | |
dtor, | |
flags, | |
tried) | |
} | |
/// See [enif_alloc_resource](http://www.erlang.org/doc/man/erl_nif.html#enif_alloc_resource) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_alloc_resource(_type: *const ErlNifResourceType, | |
size: size_t) -> *mut c_void { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_alloc_resource)(_type, | |
size) | |
} | |
/// See [enif_release_resource](http://www.erlang.org/doc/man/erl_nif.html#enif_release_resource) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_release_resource(obj: *const c_void) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_release_resource)(obj) | |
} | |
/// See [enif_make_resource](http://www.erlang.org/doc/man/erl_nif.html#enif_make_resource) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_resource(arg1: *mut ErlNifEnv, obj: *const c_void) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_resource)(arg1, obj) | |
} | |
/// See [enif_get_resource](http://www.erlang.org/doc/man/erl_nif.html#enif_get_resource) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_resource(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
_type: *const ErlNifResourceType, | |
objp: *mut *const c_void) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_resource)(arg1, term, | |
_type, objp) | |
} | |
/// See [enif_sizeof_resource](http://www.erlang.org/doc/man/erl_nif.html#enif_sizeof_resource) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_sizeof_resource(obj: *const c_void) -> size_t { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_sizeof_resource)(obj) | |
} | |
/// See [enif_make_new_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_make_new_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_new_binary(arg1: *mut ErlNifEnv, size: size_t, | |
termp: *mut ERL_NIF_TERM) -> *mut c_uchar { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_new_binary)(arg1, | |
size, | |
termp) | |
} | |
/// See [enif_is_list](http://www.erlang.org/doc/man/erl_nif.html#enif_is_list) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_list(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_list)(arg1, term) | |
} | |
/// See [enif_is_tuple](http://www.erlang.org/doc/man/erl_nif.html#enif_is_tuple) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_tuple(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_tuple)(arg1, term) | |
} | |
/// See [enif_get_atom_length](http://www.erlang.org/doc/man/erl_nif.html#enif_get_atom_length) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_atom_length(arg1: *mut ErlNifEnv, atom: ERL_NIF_TERM, | |
len: *mut c_uint, arg2: ErlNifCharEncoding) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_atom_length)(arg1, | |
atom, len, | |
arg2) | |
} | |
/// See [enif_get_list_length](http://www.erlang.org/doc/man/erl_nif.html#enif_get_list_length) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_list_length(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
len: *mut c_uint) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_list_length)(env, term, | |
len) | |
} | |
/// See [enif_make_atom_len](http://www.erlang.org/doc/man/erl_nif.html#enif_make_atom_len) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_atom_len(env: *mut ErlNifEnv, name: *const c_uchar, | |
len: size_t) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_atom_len)(env, name, | |
len) | |
} | |
/// See [enif_make_existing_atom_len](http://www.erlang.org/doc/man/erl_nif.html#enif_make_existing_atom_len) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_existing_atom_len(env: *mut ErlNifEnv, | |
name: *const c_uchar, len: size_t, | |
atom: *mut ERL_NIF_TERM, | |
arg1: ErlNifCharEncoding) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_existing_atom_len)(env, | |
name, | |
len, | |
atom, | |
arg1) | |
} | |
/// See [enif_make_string_len](http://www.erlang.org/doc/man/erl_nif.html#enif_make_string_len) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_string_len(env: *mut ErlNifEnv, | |
string: *const c_uchar, len: size_t, | |
arg1: ErlNifCharEncoding) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_string_len)(env, | |
string, | |
len, arg1) | |
} | |
/// See [enif_alloc_env](http://www.erlang.org/doc/man/erl_nif.html#enif_alloc_env) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_alloc_env() -> *mut ErlNifEnv { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_alloc_env)() | |
} | |
/// See [enif_free_env](http://www.erlang.org/doc/man/erl_nif.html#enif_free_env) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_free_env(env: *mut ErlNifEnv) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_free_env)(env) | |
} | |
/// See [enif_clear_env](http://www.erlang.org/doc/man/erl_nif.html#enif_clear_env) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_clear_env(env: *mut ErlNifEnv) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_clear_env)(env) | |
} | |
/// See [enif_send](http://www.erlang.org/doc/man/erl_nif.html#enif_send) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_send(env: *mut ErlNifEnv, to_pid: *const ErlNifPid, | |
msg_env: *mut ErlNifEnv, msg: ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_send)(env, to_pid, msg_env, | |
msg) | |
} | |
/// See [enif_make_copy](http://www.erlang.org/doc/man/erl_nif.html#enif_make_copy) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_copy(dst_env: *mut ErlNifEnv, src_term: ERL_NIF_TERM) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_copy)(dst_env, | |
src_term) | |
} | |
/// See [enif_self](http://www.erlang.org/doc/man/erl_nif.html#enif_self) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_self(caller_env: *mut ErlNifEnv, pid: *mut ErlNifPid) | |
-> *mut ErlNifPid { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_self)(caller_env, pid) | |
} | |
/// See [enif_get_local_pid](http://www.erlang.org/doc/man/erl_nif.html#enif_get_local_pid) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_local_pid(env: *mut ErlNifEnv, arg1: ERL_NIF_TERM, | |
pid: *mut ErlNifPid) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_local_pid)(env, arg1, | |
pid) | |
} | |
/// See [enif_keep_resource](http://www.erlang.org/doc/man/erl_nif.html#enif_keep_resource) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_keep_resource(obj: *const c_void) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_keep_resource)(obj) | |
} | |
/// See [enif_make_resource_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_make_resource_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_resource_binary(arg1: *mut ErlNifEnv, | |
obj: *const c_void, | |
data: *const c_void, size: size_t) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_resource_binary)(arg1, | |
obj, | |
data, | |
size) | |
} | |
/// See [enif_get_int64](http://www.erlang.org/doc/man/erl_nif.html#enif_get_int64) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_int64(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_longlong) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_int64)(arg1, term, ip) | |
} | |
/// See [enif_get_uint64](http://www.erlang.org/doc/man/erl_nif.html#enif_get_uint64) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_uint64(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
ip: *mut c_ulonglong) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_uint64)(arg1, term, ip) | |
} | |
/// See [enif_make_int64](http://www.erlang.org/doc/man/erl_nif.html#enif_make_int64) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_int64(env: *mut ErlNifEnv, i: c_longlong) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_int64)(env, i) | |
} | |
/// See [enif_make_uint64](http://www.erlang.org/doc/man/erl_nif.html#enif_make_uint64) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_uint64(env: *mut ErlNifEnv, i: c_ulonglong) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_uint64)(env, i) | |
} | |
/// See [enif_is_exception](http://www.erlang.org/doc/man/erl_nif.html#enif_is_exception) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_exception(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_exception)(arg1, term) | |
} | |
/// See [enif_make_reverse_list](http://www.erlang.org/doc/man/erl_nif.html#enif_make_reverse_list) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_reverse_list(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
list: *mut ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_reverse_list)(arg1, | |
term, | |
list) | |
} | |
/// See [enif_is_number](http://www.erlang.org/doc/man/erl_nif.html#enif_is_number) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_number(arg1: *mut ErlNifEnv, term: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_number)(arg1, term) | |
} | |
/// See [enif_dlopen](http://www.erlang.org/doc/man/erl_nif.html#enif_dlopen) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_dlopen(lib: *const c_uchar, | |
err_handler: | |
Option<unsafe extern "C" fn(arg1: *mut c_void, | |
arg2: | |
*const c_uchar)>, | |
err_arg: *mut c_void) -> *mut c_void { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_dlopen)(lib, err_handler, | |
err_arg) | |
} | |
/// See [enif_dlsym](http://www.erlang.org/doc/man/erl_nif.html#enif_dlsym) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_dlsym(handle: *mut c_void, symbol: *const c_uchar, | |
err_handler: | |
Option<unsafe extern "C" fn(arg1: *mut c_void, | |
arg2: | |
*const c_uchar)>, | |
err_arg: *mut c_void) -> *mut c_void { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_dlsym)(handle, symbol, | |
err_handler, | |
err_arg) | |
} | |
/// See [enif_consume_timeslice](http://www.erlang.org/doc/man/erl_nif.html#enif_consume_timeslice) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_consume_timeslice(arg1: *mut ErlNifEnv, percent: c_int) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_consume_timeslice)(arg1, | |
percent) | |
} | |
/// See [enif_is_map](http://www.erlang.org/doc/man/erl_nif.html#enif_is_map) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_map(env: *mut ErlNifEnv, term: ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_map)(env, term) | |
} | |
/// See [enif_get_map_size](http://www.erlang.org/doc/man/erl_nif.html#enif_get_map_size) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_map_size(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
size: *mut size_t) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_map_size)(env, term, | |
size) | |
} | |
/// See [enif_make_new_map](http://www.erlang.org/doc/man/erl_nif.html#enif_make_new_map) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_new_map(env: *mut ErlNifEnv) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_new_map)(env) | |
} | |
/// See [enif_make_map_put](http://www.erlang.org/doc/man/erl_nif.html#enif_make_map_put) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_map_put(env: *mut ErlNifEnv, map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, value: ERL_NIF_TERM, | |
map_out: *mut ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_map_put)(env, map_in, | |
key, value, | |
map_out) | |
} | |
/// See [enif_get_map_value](http://www.erlang.org/doc/man/erl_nif.html#enif_get_map_value) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_map_value(env: *mut ErlNifEnv, map: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, value: *mut ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_map_value)(env, map, | |
key, value) | |
} | |
/// See [enif_make_map_update](http://www.erlang.org/doc/man/erl_nif.html#enif_make_map_update) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_map_update(env: *mut ErlNifEnv, map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, value: ERL_NIF_TERM, | |
map_out: *mut ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_map_update)(env, | |
map_in, | |
key, | |
value, | |
map_out) | |
} | |
/// See [enif_make_map_remove](http://www.erlang.org/doc/man/erl_nif.html#enif_make_map_remove) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_map_remove(env: *mut ErlNifEnv, map_in: ERL_NIF_TERM, | |
key: ERL_NIF_TERM, | |
map_out: *mut ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_map_remove)(env, | |
map_in, | |
key, | |
map_out) | |
} | |
/// See [enif_map_iterator_create](http://www.erlang.org/doc/man/erl_nif.html#enif_map_iterator_create) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_map_iterator_create(env: *mut ErlNifEnv, map: ERL_NIF_TERM, | |
iter: *mut ErlNifMapIterator, | |
entry: ErlNifMapIteratorEntry) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_map_iterator_create)(env, | |
map, | |
iter, | |
entry) | |
} | |
/// See [enif_map_iterator_destroy](http://www.erlang.org/doc/man/erl_nif.html#enif_map_iterator_destroy) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_map_iterator_destroy(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_map_iterator_destroy)(env, | |
iter) | |
} | |
/// See [enif_map_iterator_is_head](http://www.erlang.org/doc/man/erl_nif.html#enif_map_iterator_is_head) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_map_iterator_is_head(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_map_iterator_is_head)(env, | |
iter) | |
} | |
/// See [enif_map_iterator_is_tail](http://www.erlang.org/doc/man/erl_nif.html#enif_map_iterator_is_tail) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_map_iterator_is_tail(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_map_iterator_is_tail)(env, | |
iter) | |
} | |
/// See [enif_map_iterator_next](http://www.erlang.org/doc/man/erl_nif.html#enif_map_iterator_next) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_map_iterator_next(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_map_iterator_next)(env, | |
iter) | |
} | |
/// See [enif_map_iterator_prev](http://www.erlang.org/doc/man/erl_nif.html#enif_map_iterator_prev) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_map_iterator_prev(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_map_iterator_prev)(env, | |
iter) | |
} | |
/// See [enif_map_iterator_get_pair](http://www.erlang.org/doc/man/erl_nif.html#enif_map_iterator_get_pair) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_map_iterator_get_pair(env: *mut ErlNifEnv, | |
iter: *mut ErlNifMapIterator, | |
key: *mut ERL_NIF_TERM, | |
value: *mut ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_map_iterator_get_pair)(env, | |
iter, | |
key, | |
value) | |
} | |
/// See [enif_schedule_nif](http://www.erlang.org/doc/man/erl_nif.html#enif_schedule_nif) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_schedule_nif(env: *mut ErlNifEnv, fun_name: *const c_uchar, | |
flags: c_int, | |
dtor: | |
Option<unsafe extern "C" fn(env: | |
*mut ErlNifEnv, | |
argc: c_int, | |
argv: | |
*const ERL_NIF_TERM)>, | |
argc: c_int, argv: *const ERL_NIF_TERM) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_schedule_nif)(env, | |
fun_name, | |
flags, dtor, | |
argc, argv) | |
} | |
/// See [enif_has_pending_exception](http://www.erlang.org/doc/man/erl_nif.html#enif_has_pending_exception) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_has_pending_exception(env: *mut ErlNifEnv, | |
reason: *mut ERL_NIF_TERM) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_has_pending_exception)(env, | |
reason) | |
} | |
/// See [enif_raise_exception](http://www.erlang.org/doc/man/erl_nif.html#enif_raise_exception) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_raise_exception(env: *mut ErlNifEnv, reason: ERL_NIF_TERM) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_raise_exception)(env, | |
reason) | |
} | |
/// See [enif_getenv](http://www.erlang.org/doc/man/erl_nif.html#enif_getenv) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_getenv(key: *const c_uchar, value: *mut c_uchar, | |
value_size: *mut size_t) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_getenv)(key, value, | |
value_size) | |
} | |
/// See [enif_monotonic_time](http://www.erlang.org/doc/man/erl_nif.html#enif_monotonic_time) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_monotonic_time(unit: ErlNifTimeUnit) -> ErlNifTime { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_monotonic_time)(unit) | |
} | |
/// See [enif_time_offset](http://www.erlang.org/doc/man/erl_nif.html#enif_time_offset) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_time_offset(unit: ErlNifTimeUnit) -> ErlNifTime { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_time_offset)(unit) | |
} | |
/// See [enif_convert_time_unit](http://www.erlang.org/doc/man/erl_nif.html#enif_convert_time_unit) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_convert_time_unit(time: ErlNifTime, | |
from_unit: ErlNifTimeUnit, | |
to_unit: ErlNifTimeUnit) -> ErlNifTime { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_convert_time_unit)(time, | |
from_unit, | |
to_unit) | |
} | |
/// See [enif_now_time](http://www.erlang.org/doc/man/erl_nif.html#enif_now_time) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_now_time(env: *mut ErlNifEnv) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_now_time)(env) | |
} | |
/// See [enif_cpu_time](http://www.erlang.org/doc/man/erl_nif.html#enif_cpu_time) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_cpu_time(env: *mut ErlNifEnv) -> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_cpu_time)(env) | |
} | |
/// See [enif_make_unique_integer](http://www.erlang.org/doc/man/erl_nif.html#enif_make_unique_integer) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_make_unique_integer(env: *mut ErlNifEnv, | |
properties: ErlNifUniqueInteger) | |
-> ERL_NIF_TERM { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_make_unique_integer)(env, | |
properties) | |
} | |
/// See [enif_is_current_process_alive](http://www.erlang.org/doc/man/erl_nif.html#enif_is_current_process_alive) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_current_process_alive(env: *mut ErlNifEnv) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_current_process_alive)(env) | |
} | |
/// See [enif_is_process_alive](http://www.erlang.org/doc/man/erl_nif.html#enif_is_process_alive) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_process_alive(env: *mut ErlNifEnv, | |
pid: *const ErlNifPid) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_process_alive)(env, pid) | |
} | |
/// See [enif_is_port_alive](http://www.erlang.org/doc/man/erl_nif.html#enif_is_port_alive) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_is_port_alive(env: *mut ErlNifEnv, | |
port_id: *const ErlNifPort) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_is_port_alive)(env, | |
port_id) | |
} | |
/// See [enif_get_local_port](http://www.erlang.org/doc/man/erl_nif.html#enif_get_local_port) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_get_local_port(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
port_id: *mut ErlNifPort) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_get_local_port)(env, term, | |
port_id) | |
} | |
/// See [enif_term_to_binary](http://www.erlang.org/doc/man/erl_nif.html#enif_term_to_binary) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_term_to_binary(env: *mut ErlNifEnv, term: ERL_NIF_TERM, | |
bin: *mut ErlNifBinary) -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_term_to_binary)(env, term, | |
bin) | |
} | |
/// See [enif_binary_to_term](http://www.erlang.org/doc/man/erl_nif.html#enif_binary_to_term) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_binary_to_term(env: *mut ErlNifEnv, data: *const c_uchar, | |
sz: usize, term: *mut ERL_NIF_TERM, | |
opts: ErlNifBinaryToTerm) -> usize { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_binary_to_term)(env, data, | |
sz, term, | |
opts) | |
} | |
/// See [enif_port_command](http://www.erlang.org/doc/man/erl_nif.html#enif_port_command) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_port_command(env: *mut ErlNifEnv, | |
to_port: *const ErlNifPort, | |
msg_env: *mut ErlNifEnv, msg: ERL_NIF_TERM) | |
-> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_port_command)(env, to_port, | |
msg_env, msg) | |
} | |
/// See [enif_thread_type](http://www.erlang.org/doc/man/erl_nif.html#enif_thread_type) in the Erlang docs. | |
#[inline] | |
pub unsafe fn enif_thread_type() -> c_int { | |
(WIN_DYN_NIF_CALLBACKS.unchecked_unwrap().enif_thread_type)() | |
} | |
use std::os::raw::{c_ulonglong, c_longlong}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment