diff --git a/Cargo.toml b/Cargo.toml index 89d90575..e54f39f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nng-sys" -version = "1.3.1-rc.1" +version = "1.4.0-rc.0" authors = ["Nathan Kent ", "Jake W "] description = "Bindings to NNG (Nanomsg-Next-Generation) aka Nanomsg2" diff --git a/README.md b/README.md index 4ca32d98..4e148160 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,10 @@ Rust FFI bindings to [NNG](https://github.com/nanomsg/nng): Version of this crate tracks NNG: `-rc.` (e.g. `1.1.1-rc.2`). -To use the __latest crate__ for the most recent __stable version of NNG__ (1.3.x), in `Cargo.toml`: +To use the __latest crate__ for the most recent __stable version of NNG__ (1.4.x), in `Cargo.toml`: ```toml [dependencies] -nng-sys = "1.3.0-rc" +nng-sys = "1.4.0-rc" ``` Requirements: @@ -42,13 +42,13 @@ Requirements: _Example_) Re-generate FFI bindings with bindgen: ```toml [dependencies] -nng-sys = { version = "1.3.0-rc", features = ["build-bindgen"] } +nng-sys = { version = "1.4.0-rc", features = ["build-bindgen"] } ``` _Example_) Disable stats and use Ninja cmake generator: ```toml [dependencies.nng-sys] -version = "1.3.0-rc" +version = "1.4.0-rc" default-features = false features = ["cmake-ninja"] ``` diff --git a/build.rs b/build.rs index e00c6561..a537a8a9 100644 --- a/build.rs +++ b/build.rs @@ -102,6 +102,7 @@ fn build_bindgen() { .constified_enum("nng_pipe_ev") .use_core() .parse_callbacks(Box::new(BindgenCallbacks::default())) + .size_t_is_usize(true) // Layout tests are non-portable; 64-bit tests are "wrong" size on 32-bit and always fail. // Don't output tests if we're regenerating `src/bindings.rs` (shared by all platforms when bindgen not used) .layout_tests(!cfg!(feature = "source-update-bindings")); @@ -155,6 +156,9 @@ impl bindgen::callbacks::ParseCallbacks for BindgenCallbacks { // We want to exclude it so it doesn't need to be included for `match` to be exhaustive. if original_variant_name == "NNG_PIPE_EV_NUM" { Some(bindgen::callbacks::EnumVariantCustomBehavior::Hide) + // NNG abstract sockets are only supported on Linux and non-portable + } else if original_variant_name == "NNG_AF_ABSTRACT" { + Some(bindgen::callbacks::EnumVariantCustomBehavior::Hide) } else { None } diff --git a/nng b/nng index bd76f554..d020adda 160000 --- a/nng +++ b/nng @@ -1 +1 @@ -Subproject commit bd76f55485580f49c0d7fa2289de4f2bcdfd8a4c +Subproject commit d020adda8f0348d094790618703b8341a26007a3 diff --git a/scripts/build.ps1 b/scripts/build.ps1 old mode 100644 new mode 100755 diff --git a/src/bindings.rs b/src/bindings.rs index af84eeca..14cb5a88 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -1,13 +1,15 @@ -/* automatically generated by rust-bindgen 0.54.1 */ +/* automatically generated by rust-bindgen */ pub const NNG_MAJOR_VERSION: u32 = 1; -pub const NNG_MINOR_VERSION: u32 = 3; -pub const NNG_PATCH_VERSION: u32 = 1; +pub const NNG_MINOR_VERSION: u32 = 4; +pub const NNG_PATCH_VERSION: u32 = 0; pub const NNG_RELEASE_SUFFIX: &'static [u8; 1usize] = b"\0"; pub const NNG_MAXADDRLEN: u32 = 128; pub const NNG_DURATION_INFINITE: i32 = -1; pub const NNG_DURATION_DEFAULT: i32 = -2; pub const NNG_DURATION_ZERO: u32 = 0; +pub const NNG_FLAG_ALLOC: u32 = 1; +pub const NNG_FLAG_NONBLOCK: u32 = 2; pub const NNG_OPT_SOCKNAME: &'static [u8; 12usize] = b"socket-name\0"; pub const NNG_OPT_RAW: &'static [u8; 4usize] = b"raw\0"; pub const NNG_OPT_PROTO: &'static [u8; 9usize] = b"protocol\0"; @@ -50,6 +52,8 @@ pub const NNG_OPT_WS_REQUEST_URI: &'static [u8; 15usize] = b"ws:request-uri\0"; pub const NNG_OPT_WS_SENDMAXFRAME: &'static [u8; 15usize] = b"ws:txframe-max\0"; pub const NNG_OPT_WS_RECVMAXFRAME: &'static [u8; 15usize] = b"ws:rxframe-max\0"; pub const NNG_OPT_WS_PROTOCOL: &'static [u8; 12usize] = b"ws:protocol\0"; +pub const NNG_OPT_WS_SEND_TEXT: &'static [u8; 13usize] = b"ws:send-text\0"; +pub const NNG_OPT_WS_RECV_TEXT: &'static [u8; 13usize] = b"ws:recv-text\0"; pub const NNG_OPT_PAIR1_POLY: &'static [u8; 18usize] = b"pair1:polyamorous\0"; pub const NNG_PAIR1_SELF: u32 = 17; pub const NNG_PAIR1_PEER: u32 = 17; @@ -92,7 +96,11 @@ pub const NNG_OPT_ZT_ORBIT: &'static [u8; 9usize] = b"zt:orbit\0"; pub const NNG_OPT_ZT_DEORBIT: &'static [u8; 11usize] = b"zt:deorbit\0"; pub const NNG_OPT_ZT_ADD_LOCAL_ADDR: &'static [u8; 18usize] = b"zt:add-local-addr\0"; pub const NNG_OPT_ZT_CLEAR_LOCAL_ADDRS: &'static [u8; 21usize] = b"zt:clear-local-addrs\0"; -pub type size_t = ::std::os::raw::c_ulong; +pub type __uint8_t = ::std::os::raw::c_uchar; +pub type __uint16_t = ::std::os::raw::c_ushort; +pub type __int32_t = ::std::os::raw::c_int; +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __uint64_t = ::std::os::raw::c_ulong; #[repr(C)] #[repr(align(4))] #[derive(Debug, Default, Copy, Clone)] @@ -166,16 +174,14 @@ impl Default for nng_sockaddr_path { unsafe { ::core::mem::zeroed() } } } -pub type nng_sockaddr_ipc = nng_sockaddr_path; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct nng_sockaddr_in6 { pub sa_family: u16, pub sa_port: u16, pub sa_addr: [u8; 16usize], + pub sa_scope: u32, } -pub type nng_sockaddr_udp6 = nng_sockaddr_in6; -pub type nng_sockaddr_tcp6 = nng_sockaddr_in6; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct nng_sockaddr_in { @@ -191,8 +197,30 @@ pub struct nng_sockaddr_zt { pub sa_nodeid: u64, pub sa_port: u32, } -pub type nng_sockaddr_udp = nng_sockaddr_in; -pub type nng_sockaddr_tcp = nng_sockaddr_in; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct nng_sockaddr_abstract { + pub sa_family: u16, + pub sa_len: u16, + pub sa_name: [u8; 107usize], +} +impl Default for nng_sockaddr_abstract { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct nng_sockaddr_storage { + pub sa_family: u16, + pub sa_pad: [u16; 64usize], +} +impl Default for nng_sockaddr_storage { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +pub type nng_sockaddr_ipc = nng_sockaddr_path; #[repr(C)] #[derive(Copy, Clone)] pub union nng_sockaddr { @@ -202,6 +230,8 @@ pub union nng_sockaddr { pub s_in6: nng_sockaddr_in6, pub s_in: nng_sockaddr_in, pub s_zt: nng_sockaddr_zt, + pub s_abstract: nng_sockaddr_abstract, + pub s_storage: nng_sockaddr_storage, _bindgen_union_align: [u64; 17usize], } impl Default for nng_sockaddr { @@ -223,7 +253,7 @@ pub enum nng_sockaddr_family { #[derive(Debug, Copy, Clone)] pub struct nng_iov { pub iov_buf: *mut ::core::ffi::c_void, - pub iov_len: size_t, + pub iov_len: usize, } impl Default for nng_iov { fn default() -> Self { @@ -239,129 +269,12 @@ extern "C" { extern "C" { pub fn nng_socket_id(arg1: nng_socket) -> ::std::os::raw::c_int; } -extern "C" { - pub fn nng_closeall(); -} -extern "C" { - pub fn nng_setopt( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *const ::core::ffi::c_void, - arg4: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_setopt_bool( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: bool, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_setopt_int( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_setopt_ms( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: nng_duration, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_setopt_size( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_setopt_uint64( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: u64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_setopt_string( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_setopt_ptr( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt_bool( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut bool, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt_int( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt_ms( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt_size( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt_uint64( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt_ptr( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_getopt_string( - arg1: nng_socket, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} extern "C" { pub fn nng_socket_set( arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *const ::core::ffi::c_void, - arg4: size_t, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { @@ -382,7 +295,7 @@ extern "C" { pub fn nng_socket_set_size( arg1: nng_socket, arg2: *const ::std::os::raw::c_char, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { @@ -425,7 +338,7 @@ extern "C" { arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { @@ -446,7 +359,7 @@ extern "C" { pub fn nng_socket_get_size( arg1: nng_socket, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { @@ -552,1760 +465,1880 @@ extern "C" { pub fn nng_listener_id(arg1: nng_listener) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt( + pub fn nng_dialer_set( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *const ::core::ffi::c_void, - arg4: size_t, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt_bool( + pub fn nng_dialer_set_bool( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt_int( + pub fn nng_dialer_set_int( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt_ms( + pub fn nng_dialer_set_size( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: nng_duration, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt_size( + pub fn nng_dialer_set_uint64( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: size_t, + arg3: u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt_uint64( + pub fn nng_dialer_set_string( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: u64, + arg3: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt_ptr( + pub fn nng_dialer_set_ptr( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_setopt_string( + pub fn nng_dialer_set_ms( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *const ::std::os::raw::c_char, + arg3: nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt( + pub fn nng_dialer_set_addr( + arg1: nng_dialer, + arg2: *const ::std::os::raw::c_char, + arg3: *const nng_sockaddr, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_dialer_get( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_bool( + pub fn nng_dialer_get_bool( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_int( + pub fn nng_dialer_get_int( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_ms( + pub fn nng_dialer_get_size( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_size( + pub fn nng_dialer_get_uint64( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: *mut u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_sockaddr( + pub fn nng_dialer_get_string( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, + arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_uint64( + pub fn nng_dialer_get_ptr( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + arg3: *mut *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_ptr( + pub fn nng_dialer_get_ms( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::core::ffi::c_void, + arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_getopt_string( + pub fn nng_dialer_get_addr( arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, + arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set( - arg1: nng_dialer, + pub fn nng_listener_set( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *const ::core::ffi::c_void, - arg4: size_t, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_bool( - arg1: nng_dialer, + pub fn nng_listener_set_bool( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_int( - arg1: nng_dialer, + pub fn nng_listener_set_int( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_size( - arg1: nng_dialer, + pub fn nng_listener_set_size( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_uint64( - arg1: nng_dialer, + pub fn nng_listener_set_uint64( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_string( - arg1: nng_dialer, + pub fn nng_listener_set_string( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_ptr( - arg1: nng_dialer, + pub fn nng_listener_set_ptr( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_ms( - arg1: nng_dialer, + pub fn nng_listener_set_ms( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_set_addr( - arg1: nng_dialer, + pub fn nng_listener_set_addr( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *const nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get( - arg1: nng_dialer, + pub fn nng_listener_get( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_bool( - arg1: nng_dialer, + pub fn nng_listener_get_bool( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_int( - arg1: nng_dialer, + pub fn nng_listener_get_int( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_size( - arg1: nng_dialer, + pub fn nng_listener_get_size( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_uint64( - arg1: nng_dialer, + pub fn nng_listener_get_uint64( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_string( - arg1: nng_dialer, + pub fn nng_listener_get_string( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_ptr( - arg1: nng_dialer, + pub fn nng_listener_get_ptr( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_ms( - arg1: nng_dialer, + pub fn nng_listener_get_ms( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_dialer_get_addr( - arg1: nng_dialer, + pub fn nng_listener_get_addr( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_setopt( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *const ::core::ffi::c_void, - arg4: size_t, + pub fn nng_strerror(arg1: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; +} +extern "C" { + pub fn nng_send( + arg1: nng_socket, + arg2: *mut ::core::ffi::c_void, + arg3: usize, + arg4: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_setopt_bool( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: bool, + pub fn nng_recv( + arg1: nng_socket, + arg2: *mut ::core::ffi::c_void, + arg3: *mut usize, + arg4: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_setopt_int( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, + pub fn nng_sendmsg( + arg1: nng_socket, + arg2: *mut nng_msg, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_setopt_ms( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: nng_duration, + pub fn nng_recvmsg( + arg1: nng_socket, + arg2: *mut *mut nng_msg, + arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_setopt_size( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_send_aio(arg1: nng_socket, arg2: *mut nng_aio); } extern "C" { - pub fn nng_listener_setopt_uint64( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: u64, - ) -> ::std::os::raw::c_int; + pub fn nng_recv_aio(arg1: nng_socket, arg2: *mut nng_aio); } extern "C" { - pub fn nng_listener_setopt_ptr( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; + pub fn nng_ctx_open(arg1: *mut nng_ctx, arg2: nng_socket) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_setopt_string( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + pub fn nng_ctx_close(arg1: nng_ctx) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt( - arg1: nng_listener, + pub fn nng_ctx_id(arg1: nng_ctx) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_ctx_recv(arg1: nng_ctx, arg2: *mut nng_aio); +} +extern "C" { + pub fn nng_ctx_send(arg1: nng_ctx, arg2: *mut nng_aio); +} +extern "C" { + pub fn nng_ctx_get( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_bool( - arg1: nng_listener, + pub fn nng_ctx_get_bool( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_int( - arg1: nng_listener, + pub fn nng_ctx_get_int( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_ms( - arg1: nng_listener, + pub fn nng_ctx_get_size( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_size( - arg1: nng_listener, + pub fn nng_ctx_get_uint64( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: *mut u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_sockaddr( - arg1: nng_listener, + pub fn nng_ctx_get_string( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, + arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_uint64( - arg1: nng_listener, + pub fn nng_ctx_get_ptr( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + arg3: *mut *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_ptr( - arg1: nng_listener, + pub fn nng_ctx_get_ms( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::core::ffi::c_void, + arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_getopt_string( - arg1: nng_listener, + pub fn nng_ctx_get_addr( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, + arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set( - arg1: nng_listener, + pub fn nng_ctx_set( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: *const ::core::ffi::c_void, - arg4: size_t, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_bool( - arg1: nng_listener, + pub fn nng_ctx_set_bool( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_int( - arg1: nng_listener, + pub fn nng_ctx_set_int( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_size( - arg1: nng_listener, + pub fn nng_ctx_set_size( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_uint64( - arg1: nng_listener, + pub fn nng_ctx_set_uint64( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_string( - arg1: nng_listener, + pub fn nng_ctx_set_string( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_ptr( - arg1: nng_listener, + pub fn nng_ctx_set_ptr( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_ms( - arg1: nng_listener, + pub fn nng_ctx_set_ms( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_set_addr( - arg1: nng_listener, + pub fn nng_ctx_set_addr( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, arg3: *const nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_get( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_alloc(arg1: usize) -> *mut ::core::ffi::c_void; } extern "C" { - pub fn nng_listener_get_bool( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut bool, - ) -> ::std::os::raw::c_int; + pub fn nng_free(arg1: *mut ::core::ffi::c_void, arg2: usize); } extern "C" { - pub fn nng_listener_get_int( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_strdup(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn nng_listener_get_size( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_strfree(arg1: *mut ::std::os::raw::c_char); } extern "C" { - pub fn nng_listener_get_uint64( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + pub fn nng_aio_alloc( + arg1: *mut *mut nng_aio, + arg2: ::core::option::Option, + arg3: *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_listener_get_string( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_free(arg1: *mut nng_aio); } extern "C" { - pub fn nng_listener_get_ptr( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_reap(arg1: *mut nng_aio); } extern "C" { - pub fn nng_listener_get_ms( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_stop(arg1: *mut nng_aio); } extern "C" { - pub fn nng_listener_get_addr( - arg1: nng_listener, - arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_result(arg1: *mut nng_aio) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_strerror(arg1: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char; + pub fn nng_aio_count(arg1: *mut nng_aio) -> usize; } extern "C" { - pub fn nng_send( - arg1: nng_socket, - arg2: *mut ::core::ffi::c_void, - arg3: size_t, - arg4: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_cancel(arg1: *mut nng_aio); } extern "C" { - pub fn nng_recv( - arg1: nng_socket, - arg2: *mut ::core::ffi::c_void, - arg3: *mut size_t, - arg4: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_abort(arg1: *mut nng_aio, arg2: ::std::os::raw::c_int); } extern "C" { - pub fn nng_sendmsg( - arg1: nng_socket, - arg2: *mut nng_msg, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_wait(arg1: *mut nng_aio); } extern "C" { - pub fn nng_recvmsg( - arg1: nng_socket, - arg2: *mut *mut nng_msg, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_set_msg(arg1: *mut nng_aio, arg2: *mut nng_msg); } extern "C" { - pub fn nng_send_aio(arg1: nng_socket, arg2: *mut nng_aio); + pub fn nng_aio_get_msg(arg1: *mut nng_aio) -> *mut nng_msg; } extern "C" { - pub fn nng_recv_aio(arg1: nng_socket, arg2: *mut nng_aio); + pub fn nng_aio_set_input( + arg1: *mut nng_aio, + arg2: ::std::os::raw::c_uint, + arg3: *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_open(arg1: *mut nng_ctx, arg2: nng_socket) -> ::std::os::raw::c_int; + pub fn nng_aio_get_input( + arg1: *mut nng_aio, + arg2: ::std::os::raw::c_uint, + ) -> *mut ::core::ffi::c_void; } extern "C" { - pub fn nng_ctx_close(arg1: nng_ctx) -> ::std::os::raw::c_int; + pub fn nng_aio_set_output( + arg1: *mut nng_aio, + arg2: ::std::os::raw::c_uint, + arg3: *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_id(arg1: nng_ctx) -> ::std::os::raw::c_int; + pub fn nng_aio_get_output( + arg1: *mut nng_aio, + arg2: ::std::os::raw::c_uint, + ) -> *mut ::core::ffi::c_void; } extern "C" { - pub fn nng_ctx_recv(arg1: nng_ctx, arg2: *mut nng_aio); + pub fn nng_aio_set_timeout(arg1: *mut nng_aio, arg2: nng_duration); } extern "C" { - pub fn nng_ctx_send(arg1: nng_ctx, arg2: *mut nng_aio); -} -extern "C" { - pub fn nng_ctx_getopt( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_ctx_getopt_bool( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut bool, + pub fn nng_aio_set_iov( + arg1: *mut nng_aio, + arg2: ::std::os::raw::c_uint, + arg3: *const nng_iov, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_getopt_int( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_begin(arg1: *mut nng_aio) -> bool; } extern "C" { - pub fn nng_ctx_getopt_ms( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_finish(arg1: *mut nng_aio, arg2: ::std::os::raw::c_int); } +pub type nng_aio_cancelfn = ::core::option::Option< + unsafe extern "C" fn( + arg1: *mut nng_aio, + arg2: *mut ::core::ffi::c_void, + arg3: ::std::os::raw::c_int, + ), +>; extern "C" { - pub fn nng_ctx_getopt_size( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_aio_defer( + arg1: *mut nng_aio, + arg2: nng_aio_cancelfn, + arg3: *mut ::core::ffi::c_void, + ); } extern "C" { - pub fn nng_ctx_setopt( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *const ::core::ffi::c_void, - arg4: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_sleep_aio(arg1: nng_duration, arg2: *mut nng_aio); } extern "C" { - pub fn nng_ctx_setopt_bool( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: bool, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_alloc(arg1: *mut *mut nng_msg, arg2: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_setopt_int( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_free(arg1: *mut nng_msg); } extern "C" { - pub fn nng_ctx_setopt_ms( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: nng_duration, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_realloc(arg1: *mut nng_msg, arg2: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_setopt_size( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header(arg1: *mut nng_msg) -> *mut ::core::ffi::c_void; } extern "C" { - pub fn nng_ctx_get( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_len(arg1: *const nng_msg) -> usize; } extern "C" { - pub fn nng_ctx_get_bool( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut bool, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_body(arg1: *mut nng_msg) -> *mut ::core::ffi::c_void; } extern "C" { - pub fn nng_ctx_get_int( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_len(arg1: *const nng_msg) -> usize; } extern "C" { - pub fn nng_ctx_get_size( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + pub fn nng_msg_append( + arg1: *mut nng_msg, + arg2: *const ::core::ffi::c_void, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_get_uint64( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + pub fn nng_msg_insert( + arg1: *mut nng_msg, + arg2: *const ::core::ffi::c_void, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_get_string( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_trim(arg1: *mut nng_msg, arg2: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_get_ptr( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_chop(arg1: *mut nng_msg, arg2: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_get_ms( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, + pub fn nng_msg_header_append( + arg1: *mut nng_msg, + arg2: *const ::core::ffi::c_void, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_get_addr( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, + pub fn nng_msg_header_insert( + arg1: *mut nng_msg, + arg2: *const ::core::ffi::c_void, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *const ::core::ffi::c_void, - arg4: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_trim(arg1: *mut nng_msg, arg2: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_bool( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: bool, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_chop(arg1: *mut nng_msg, arg2: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_int( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_append_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_size( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_append_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_uint64( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: u64, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_append_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_string( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_insert_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_ptr( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_insert_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_ms( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: nng_duration, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_insert_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_ctx_set_addr( - arg1: nng_ctx, - arg2: *const ::std::os::raw::c_char, - arg3: *const nng_sockaddr, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_chop_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_alloc(arg1: size_t) -> *mut ::core::ffi::c_void; + pub fn nng_msg_header_chop_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_free(arg1: *mut ::core::ffi::c_void, arg2: size_t); + pub fn nng_msg_header_chop_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_strdup(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + pub fn nng_msg_header_trim_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_strfree(arg1: *mut ::std::os::raw::c_char); + pub fn nng_msg_header_trim_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_alloc( - arg1: *mut *mut nng_aio, - arg2: ::core::option::Option, - arg3: *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_trim_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_free(arg1: *mut nng_aio); + pub fn nng_msg_append_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_stop(arg1: *mut nng_aio); + pub fn nng_msg_append_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_result(arg1: *mut nng_aio) -> ::std::os::raw::c_int; + pub fn nng_msg_append_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_count(arg1: *mut nng_aio) -> size_t; + pub fn nng_msg_insert_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_cancel(arg1: *mut nng_aio); + pub fn nng_msg_insert_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_abort(arg1: *mut nng_aio, arg2: ::std::os::raw::c_int); + pub fn nng_msg_insert_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_wait(arg1: *mut nng_aio); + pub fn nng_msg_chop_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_set_msg(arg1: *mut nng_aio, arg2: *mut nng_msg); + pub fn nng_msg_chop_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_get_msg(arg1: *mut nng_aio) -> *mut nng_msg; + pub fn nng_msg_chop_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_set_input( - arg1: *mut nng_aio, - arg2: ::std::os::raw::c_uint, - arg3: *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_trim_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_get_input( - arg1: *mut nng_aio, - arg2: ::std::os::raw::c_uint, - ) -> *mut ::core::ffi::c_void; + pub fn nng_msg_trim_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_set_output( - arg1: *mut nng_aio, - arg2: ::std::os::raw::c_uint, - arg3: *mut ::core::ffi::c_void, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_trim_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_get_output( - arg1: *mut nng_aio, - arg2: ::std::os::raw::c_uint, - ) -> *mut ::core::ffi::c_void; + pub fn nng_msg_dup(arg1: *mut *mut nng_msg, arg2: *const nng_msg) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_aio_set_timeout(arg1: *mut nng_aio, arg2: nng_duration); + pub fn nng_msg_clear(arg1: *mut nng_msg); } extern "C" { - pub fn nng_aio_set_iov( - arg1: *mut nng_aio, - arg2: ::std::os::raw::c_uint, - arg3: *const nng_iov, - ) -> ::std::os::raw::c_int; + pub fn nng_msg_header_clear(arg1: *mut nng_msg); } extern "C" { - pub fn nng_aio_begin(arg1: *mut nng_aio) -> bool; + pub fn nng_msg_set_pipe(arg1: *mut nng_msg, arg2: nng_pipe); } extern "C" { - pub fn nng_aio_finish(arg1: *mut nng_aio, arg2: ::std::os::raw::c_int); + pub fn nng_msg_get_pipe(arg1: *const nng_msg) -> nng_pipe; } -pub type nng_aio_cancelfn = ::core::option::Option< - unsafe extern "C" fn( - arg1: *mut nng_aio, - arg2: *mut ::core::ffi::c_void, - arg3: ::std::os::raw::c_int, - ), ->; extern "C" { - pub fn nng_aio_defer( - arg1: *mut nng_aio, - arg2: nng_aio_cancelfn, + pub fn nng_pipe_get( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - ); -} -extern "C" { - pub fn nng_sleep_aio(arg1: nng_duration, arg2: *mut nng_aio); + arg4: *mut usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_alloc(arg1: *mut *mut nng_msg, arg2: size_t) -> ::std::os::raw::c_int; + pub fn nng_pipe_get_bool( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut bool, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_free(arg1: *mut nng_msg); + pub fn nng_pipe_get_int( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_realloc(arg1: *mut nng_msg, arg2: size_t) -> ::std::os::raw::c_int; + pub fn nng_pipe_get_ms( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_duration, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_header(arg1: *mut nng_msg) -> *mut ::core::ffi::c_void; + pub fn nng_pipe_get_size( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_header_len(arg1: *const nng_msg) -> size_t; + pub fn nng_pipe_get_uint64( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut u64, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_body(arg1: *mut nng_msg) -> *mut ::core::ffi::c_void; + pub fn nng_pipe_get_string( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_len(arg1: *const nng_msg) -> size_t; + pub fn nng_pipe_get_ptr( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_append( - arg1: *mut nng_msg, - arg2: *const ::core::ffi::c_void, - arg3: size_t, + pub fn nng_pipe_get_addr( + arg1: nng_pipe, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_insert( - arg1: *mut nng_msg, - arg2: *const ::core::ffi::c_void, - arg3: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_pipe_close(arg1: nng_pipe) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_trim(arg1: *mut nng_msg, arg2: size_t) -> ::std::os::raw::c_int; + pub fn nng_pipe_id(arg1: nng_pipe) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_chop(arg1: *mut nng_msg, arg2: size_t) -> ::std::os::raw::c_int; + pub fn nng_pipe_socket(arg1: nng_pipe) -> nng_socket; } extern "C" { - pub fn nng_msg_header_append( - arg1: *mut nng_msg, - arg2: *const ::core::ffi::c_void, - arg3: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_pipe_dialer(arg1: nng_pipe) -> nng_dialer; } extern "C" { - pub fn nng_msg_header_insert( - arg1: *mut nng_msg, - arg2: *const ::core::ffi::c_void, - arg3: size_t, - ) -> ::std::os::raw::c_int; + pub fn nng_pipe_listener(arg1: nng_pipe) -> nng_listener; } extern "C" { - pub fn nng_msg_header_trim(arg1: *mut nng_msg, arg2: size_t) -> ::std::os::raw::c_int; + pub fn nng_stats_get(arg1: *mut *mut nng_stat) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_header_chop(arg1: *mut nng_msg, arg2: size_t) -> ::std::os::raw::c_int; + pub fn nng_stats_free(arg1: *mut nng_stat); } extern "C" { - pub fn nng_msg_header_append_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; + pub fn nng_stats_dump(arg1: *mut nng_stat); } extern "C" { - pub fn nng_msg_header_append_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; + pub fn nng_stat_next(arg1: *mut nng_stat) -> *mut nng_stat; } extern "C" { - pub fn nng_msg_header_append_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; + pub fn nng_stat_child(arg1: *mut nng_stat) -> *mut nng_stat; } extern "C" { - pub fn nng_msg_header_insert_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; + pub fn nng_stat_name(arg1: *mut nng_stat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn nng_msg_header_insert_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; + pub fn nng_stat_type(arg1: *mut nng_stat) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_header_insert_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; + pub fn nng_stat_find(arg1: *mut nng_stat, arg2: *const ::std::os::raw::c_char) + -> *mut nng_stat; } extern "C" { - pub fn nng_msg_header_chop_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; + pub fn nng_stat_find_socket(arg1: *mut nng_stat, arg2: nng_socket) -> *mut nng_stat; } extern "C" { - pub fn nng_msg_header_chop_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; + pub fn nng_stat_find_dialer(arg1: *mut nng_stat, arg2: nng_dialer) -> *mut nng_stat; } extern "C" { - pub fn nng_msg_header_chop_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; + pub fn nng_stat_find_listener(arg1: *mut nng_stat, arg2: nng_listener) -> *mut nng_stat; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum nng_stat_type_enum { + NNG_STAT_SCOPE = 0, + NNG_STAT_LEVEL = 1, + NNG_STAT_COUNTER = 2, + NNG_STAT_STRING = 3, + NNG_STAT_BOOLEAN = 4, + NNG_STAT_ID = 5, } extern "C" { - pub fn nng_msg_header_trim_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; + pub fn nng_stat_unit(arg1: *mut nng_stat) -> ::std::os::raw::c_int; +} +#[repr(u32)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum nng_unit_enum { + NNG_UNIT_NONE = 0, + NNG_UNIT_BYTES = 1, + NNG_UNIT_MESSAGES = 2, + NNG_UNIT_MILLIS = 3, + NNG_UNIT_EVENTS = 4, } extern "C" { - pub fn nng_msg_header_trim_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; + pub fn nng_stat_value(arg1: *mut nng_stat) -> u64; } extern "C" { - pub fn nng_msg_header_trim_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; + pub fn nng_stat_bool(arg1: *mut nng_stat) -> bool; } extern "C" { - pub fn nng_msg_append_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; + pub fn nng_stat_string(arg1: *mut nng_stat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn nng_msg_append_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; + pub fn nng_stat_desc(arg1: *mut nng_stat) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn nng_msg_append_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; + pub fn nng_stat_timestamp(arg1: *mut nng_stat) -> u64; +} +extern "C" { + pub fn nng_device(arg1: nng_socket, arg2: nng_socket) -> ::std::os::raw::c_int; +} +pub const NNG_EINTR: nng_errno_enum = 1; +pub const NNG_ENOMEM: nng_errno_enum = 2; +pub const NNG_EINVAL: nng_errno_enum = 3; +pub const NNG_EBUSY: nng_errno_enum = 4; +pub const NNG_ETIMEDOUT: nng_errno_enum = 5; +pub const NNG_ECONNREFUSED: nng_errno_enum = 6; +pub const NNG_ECLOSED: nng_errno_enum = 7; +pub const NNG_EAGAIN: nng_errno_enum = 8; +pub const NNG_ENOTSUP: nng_errno_enum = 9; +pub const NNG_EADDRINUSE: nng_errno_enum = 10; +pub const NNG_ESTATE: nng_errno_enum = 11; +pub const NNG_ENOENT: nng_errno_enum = 12; +pub const NNG_EPROTO: nng_errno_enum = 13; +pub const NNG_EUNREACHABLE: nng_errno_enum = 14; +pub const NNG_EADDRINVAL: nng_errno_enum = 15; +pub const NNG_EPERM: nng_errno_enum = 16; +pub const NNG_EMSGSIZE: nng_errno_enum = 17; +pub const NNG_ECONNABORTED: nng_errno_enum = 18; +pub const NNG_ECONNRESET: nng_errno_enum = 19; +pub const NNG_ECANCELED: nng_errno_enum = 20; +pub const NNG_ENOFILES: nng_errno_enum = 21; +pub const NNG_ENOSPC: nng_errno_enum = 22; +pub const NNG_EEXIST: nng_errno_enum = 23; +pub const NNG_EREADONLY: nng_errno_enum = 24; +pub const NNG_EWRITEONLY: nng_errno_enum = 25; +pub const NNG_ECRYPTO: nng_errno_enum = 26; +pub const NNG_EPEERAUTH: nng_errno_enum = 27; +pub const NNG_ENOARG: nng_errno_enum = 28; +pub const NNG_EAMBIGUOUS: nng_errno_enum = 29; +pub const NNG_EBADTYPE: nng_errno_enum = 30; +pub const NNG_ECONNSHUT: nng_errno_enum = 31; +pub const NNG_EINTERNAL: nng_errno_enum = 1000; +pub const NNG_ESYSERR: nng_errno_enum = 268435456; +pub const NNG_ETRANERR: nng_errno_enum = 536870912; +pub type nng_errno_enum = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nng_url { + pub u_rawurl: *mut ::std::os::raw::c_char, + pub u_scheme: *mut ::std::os::raw::c_char, + pub u_userinfo: *mut ::std::os::raw::c_char, + pub u_host: *mut ::std::os::raw::c_char, + pub u_hostname: *mut ::std::os::raw::c_char, + pub u_port: *mut ::std::os::raw::c_char, + pub u_path: *mut ::std::os::raw::c_char, + pub u_query: *mut ::std::os::raw::c_char, + pub u_fragment: *mut ::std::os::raw::c_char, + pub u_requri: *mut ::std::os::raw::c_char, +} +impl Default for nng_url { + fn default() -> Self { + unsafe { ::core::mem::zeroed() } + } +} +extern "C" { + pub fn nng_url_parse( + arg1: *mut *mut nng_url, + arg2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_url_free(arg1: *mut nng_url); +} +extern "C" { + pub fn nng_url_clone(arg1: *mut *mut nng_url, arg2: *const nng_url) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_version() -> *const ::std::os::raw::c_char; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nng_stream { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nng_stream_dialer { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct nng_stream_listener { + _unused: [u8; 0], +} +extern "C" { + pub fn nng_stream_free(arg1: *mut nng_stream); +} +extern "C" { + pub fn nng_stream_close(arg1: *mut nng_stream); +} +extern "C" { + pub fn nng_stream_send(arg1: *mut nng_stream, arg2: *mut nng_aio); +} +extern "C" { + pub fn nng_stream_recv(arg1: *mut nng_stream, arg2: *mut nng_aio); +} +extern "C" { + pub fn nng_stream_get( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::core::ffi::c_void, + arg4: *mut usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_bool( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut bool, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_int( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_ms( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_duration, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_size( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_uint64( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut u64, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_string( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_ptr( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_stream_get_addr( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_sockaddr, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_insert_u16(arg1: *mut nng_msg, arg2: u16) -> ::std::os::raw::c_int; + pub fn nng_stream_set( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::core::ffi::c_void, + arg4: usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_insert_u32(arg1: *mut nng_msg, arg2: u32) -> ::std::os::raw::c_int; + pub fn nng_stream_set_bool( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: bool, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_insert_u64(arg1: *mut nng_msg, arg2: u64) -> ::std::os::raw::c_int; + pub fn nng_stream_set_int( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_chop_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; + pub fn nng_stream_set_ms( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: nng_duration, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_chop_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; + pub fn nng_stream_set_size( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_chop_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; + pub fn nng_stream_set_uint64( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: u64, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_trim_u16(arg1: *mut nng_msg, arg2: *mut u16) -> ::std::os::raw::c_int; + pub fn nng_stream_set_string( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_trim_u32(arg1: *mut nng_msg, arg2: *mut u32) -> ::std::os::raw::c_int; + pub fn nng_stream_set_ptr( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_trim_u64(arg1: *mut nng_msg, arg2: *mut u64) -> ::std::os::raw::c_int; + pub fn nng_stream_set_addr( + arg1: *mut nng_stream, + arg2: *const ::std::os::raw::c_char, + arg3: *const nng_sockaddr, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_dup(arg1: *mut *mut nng_msg, arg2: *const nng_msg) -> ::std::os::raw::c_int; + pub fn nng_stream_dialer_alloc( + arg1: *mut *mut nng_stream_dialer, + arg2: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_clear(arg1: *mut nng_msg); + pub fn nng_stream_dialer_alloc_url( + arg1: *mut *mut nng_stream_dialer, + arg2: *const nng_url, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_msg_header_clear(arg1: *mut nng_msg); + pub fn nng_stream_dialer_free(arg1: *mut nng_stream_dialer); } extern "C" { - pub fn nng_msg_set_pipe(arg1: *mut nng_msg, arg2: nng_pipe); + pub fn nng_stream_dialer_close(arg1: *mut nng_stream_dialer); } extern "C" { - pub fn nng_msg_get_pipe(arg1: *const nng_msg) -> nng_pipe; + pub fn nng_stream_dialer_dial(arg1: *mut nng_stream_dialer, arg2: *mut nng_aio); } extern "C" { - pub fn nng_msg_getopt( - arg1: *mut nng_msg, - arg2: ::std::os::raw::c_int, - arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + pub fn nng_stream_dialer_set( + arg1: *mut nng_stream_dialer, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::core::ffi::c_void, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt( - arg1: nng_pipe, + pub fn nng_stream_dialer_get( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_bool( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_bool( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_int( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_int( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_ms( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_ms( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_size( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_size( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_sockaddr( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_uint64( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, + arg3: *mut u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_uint64( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_string( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_ptr( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_ptr( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_getopt_string( - arg1: nng_pipe, + pub fn nng_stream_dialer_get_addr( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, + arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_bool( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg3: bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_bool( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_int( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut bool, + arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_int( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_ms( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut ::std::os::raw::c_int, + arg3: nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_ms( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_size( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_size( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_uint64( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_uint64( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_string( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + arg3: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_string( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_ptr( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, + arg3: *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_ptr( - arg1: nng_pipe, + pub fn nng_stream_dialer_set_addr( + arg1: *mut nng_stream_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::core::ffi::c_void, + arg3: *const nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_get_addr( - arg1: nng_pipe, + pub fn nng_stream_listener_alloc( + arg1: *mut *mut nng_stream_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_pipe_close(arg1: nng_pipe) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_pipe_id(arg1: nng_pipe) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_pipe_socket(arg1: nng_pipe) -> nng_socket; -} -extern "C" { - pub fn nng_pipe_dialer(arg1: nng_pipe) -> nng_dialer; -} -extern "C" { - pub fn nng_pipe_listener(arg1: nng_pipe) -> nng_listener; -} -pub const NNG_FLAG_ALLOC: nng_flag_enum = 1; -pub const NNG_FLAG_NONBLOCK: nng_flag_enum = 2; -pub type nng_flag_enum = u32; -extern "C" { - pub fn nng_stats_get(arg1: *mut *mut nng_stat) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_stats_free(arg1: *mut nng_stat); + pub fn nng_stream_listener_alloc_url( + arg1: *mut *mut nng_stream_listener, + arg2: *const nng_url, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stats_dump(arg1: *mut nng_stat); + pub fn nng_stream_listener_free(arg1: *mut nng_stream_listener); } extern "C" { - pub fn nng_stat_next(arg1: *mut nng_stat) -> *mut nng_stat; + pub fn nng_stream_listener_close(arg1: *mut nng_stream_listener); } extern "C" { - pub fn nng_stat_child(arg1: *mut nng_stat) -> *mut nng_stat; + pub fn nng_stream_listener_listen(arg1: *mut nng_stream_listener) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_name(arg1: *mut nng_stat) -> *const ::std::os::raw::c_char; + pub fn nng_stream_listener_accept(arg1: *mut nng_stream_listener, arg2: *mut nng_aio); } extern "C" { - pub fn nng_stat_type(arg1: *mut nng_stat) -> ::std::os::raw::c_int; + pub fn nng_stream_listener_set( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::core::ffi::c_void, + arg4: usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_find(arg1: *mut nng_stat, arg2: *const ::std::os::raw::c_char) - -> *mut nng_stat; + pub fn nng_stream_listener_get( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::core::ffi::c_void, + arg4: *mut usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_find_socket(arg1: *mut nng_stat, arg2: nng_socket) -> *mut nng_stat; + pub fn nng_stream_listener_get_bool( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut bool, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_find_dialer(arg1: *mut nng_stat, arg2: nng_dialer) -> *mut nng_stat; + pub fn nng_stream_listener_get_int( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_find_listener(arg1: *mut nng_stat, arg2: nng_listener) -> *mut nng_stat; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum nng_stat_type_enum { - NNG_STAT_SCOPE = 0, - NNG_STAT_LEVEL = 1, - NNG_STAT_COUNTER = 2, - NNG_STAT_STRING = 3, - NNG_STAT_BOOLEAN = 4, - NNG_STAT_ID = 5, + pub fn nng_stream_listener_get_ms( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_duration, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_unit(arg1: *mut nng_stat) -> ::std::os::raw::c_int; -} -#[repr(u32)] -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub enum nng_unit_enum { - NNG_UNIT_NONE = 0, - NNG_UNIT_BYTES = 1, - NNG_UNIT_MESSAGES = 2, - NNG_UNIT_MILLIS = 3, - NNG_UNIT_EVENTS = 4, + pub fn nng_stream_listener_get_size( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_value(arg1: *mut nng_stat) -> u64; + pub fn nng_stream_listener_get_uint64( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut u64, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_string(arg1: *mut nng_stat) -> *const ::std::os::raw::c_char; + pub fn nng_stream_listener_get_string( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_desc(arg1: *mut nng_stat) -> *const ::std::os::raw::c_char; + pub fn nng_stream_listener_get_ptr( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stat_timestamp(arg1: *mut nng_stat) -> u64; + pub fn nng_stream_listener_get_addr( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_sockaddr, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_device(arg1: nng_socket, arg2: nng_socket) -> ::std::os::raw::c_int; -} -pub const NNG_EINTR: nng_errno_enum = 1; -pub const NNG_ENOMEM: nng_errno_enum = 2; -pub const NNG_EINVAL: nng_errno_enum = 3; -pub const NNG_EBUSY: nng_errno_enum = 4; -pub const NNG_ETIMEDOUT: nng_errno_enum = 5; -pub const NNG_ECONNREFUSED: nng_errno_enum = 6; -pub const NNG_ECLOSED: nng_errno_enum = 7; -pub const NNG_EAGAIN: nng_errno_enum = 8; -pub const NNG_ENOTSUP: nng_errno_enum = 9; -pub const NNG_EADDRINUSE: nng_errno_enum = 10; -pub const NNG_ESTATE: nng_errno_enum = 11; -pub const NNG_ENOENT: nng_errno_enum = 12; -pub const NNG_EPROTO: nng_errno_enum = 13; -pub const NNG_EUNREACHABLE: nng_errno_enum = 14; -pub const NNG_EADDRINVAL: nng_errno_enum = 15; -pub const NNG_EPERM: nng_errno_enum = 16; -pub const NNG_EMSGSIZE: nng_errno_enum = 17; -pub const NNG_ECONNABORTED: nng_errno_enum = 18; -pub const NNG_ECONNRESET: nng_errno_enum = 19; -pub const NNG_ECANCELED: nng_errno_enum = 20; -pub const NNG_ENOFILES: nng_errno_enum = 21; -pub const NNG_ENOSPC: nng_errno_enum = 22; -pub const NNG_EEXIST: nng_errno_enum = 23; -pub const NNG_EREADONLY: nng_errno_enum = 24; -pub const NNG_EWRITEONLY: nng_errno_enum = 25; -pub const NNG_ECRYPTO: nng_errno_enum = 26; -pub const NNG_EPEERAUTH: nng_errno_enum = 27; -pub const NNG_ENOARG: nng_errno_enum = 28; -pub const NNG_EAMBIGUOUS: nng_errno_enum = 29; -pub const NNG_EBADTYPE: nng_errno_enum = 30; -pub const NNG_ECONNSHUT: nng_errno_enum = 31; -pub const NNG_EINTERNAL: nng_errno_enum = 1000; -pub const NNG_ESYSERR: nng_errno_enum = 268435456; -pub const NNG_ETRANERR: nng_errno_enum = 536870912; -pub type nng_errno_enum = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct nng_url { - pub u_rawurl: *mut ::std::os::raw::c_char, - pub u_scheme: *mut ::std::os::raw::c_char, - pub u_userinfo: *mut ::std::os::raw::c_char, - pub u_host: *mut ::std::os::raw::c_char, - pub u_hostname: *mut ::std::os::raw::c_char, - pub u_port: *mut ::std::os::raw::c_char, - pub u_path: *mut ::std::os::raw::c_char, - pub u_query: *mut ::std::os::raw::c_char, - pub u_fragment: *mut ::std::os::raw::c_char, - pub u_requri: *mut ::std::os::raw::c_char, -} -impl Default for nng_url { - fn default() -> Self { - unsafe { ::core::mem::zeroed() } - } + pub fn nng_stream_listener_set_bool( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: bool, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_url_parse( - arg1: *mut *mut nng_url, + pub fn nng_stream_listener_set_int( + arg1: *mut nng_stream_listener, arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_url_free(arg1: *mut nng_url); + pub fn nng_stream_listener_set_ms( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: nng_duration, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_url_clone(arg1: *mut *mut nng_url, arg2: *const nng_url) -> ::std::os::raw::c_int; + pub fn nng_stream_listener_set_size( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_version() -> *const ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct nng_stream { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct nng_stream_dialer { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct nng_stream_listener { - _unused: [u8; 0], + pub fn nng_stream_listener_set_uint64( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: u64, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_free(arg1: *mut nng_stream); + pub fn nng_stream_listener_set_string( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_close(arg1: *mut nng_stream); + pub fn nng_stream_listener_set_ptr( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_send(arg1: *mut nng_stream, arg2: *mut nng_aio); + pub fn nng_stream_listener_set_addr( + arg1: *mut nng_stream_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *const nng_sockaddr, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_recv(arg1: *mut nng_stream, arg2: *mut nng_aio); + pub fn nng_msg_getopt( + arg1: *mut nng_msg, + arg2: ::std::os::raw::c_int, + arg3: *mut ::core::ffi::c_void, + arg4: *mut usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get( - arg1: *mut nng_stream, + pub fn nng_getopt( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get_bool( - arg1: *mut nng_stream, + pub fn nng_getopt_bool( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get_int( - arg1: *mut nng_stream, + pub fn nng_getopt_int( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get_ms( - arg1: *mut nng_stream, + pub fn nng_getopt_ms( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get_size( - arg1: *mut nng_stream, + pub fn nng_getopt_size( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get_uint64( - arg1: *mut nng_stream, + pub fn nng_getopt_uint64( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get_string( - arg1: *mut nng_stream, - arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nng_stream_get_ptr( - arg1: *mut nng_stream, + pub fn nng_getopt_ptr( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_get_addr( - arg1: *mut nng_stream, + pub fn nng_getopt_string( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, + arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set( - arg1: *mut nng_stream, + pub fn nng_setopt( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *const ::core::ffi::c_void, - arg4: size_t, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_bool( - arg1: *mut nng_stream, + pub fn nng_setopt_bool( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_int( - arg1: *mut nng_stream, + pub fn nng_setopt_int( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_ms( - arg1: *mut nng_stream, + pub fn nng_setopt_ms( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_size( - arg1: *mut nng_stream, + pub fn nng_setopt_size( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_uint64( - arg1: *mut nng_stream, + pub fn nng_setopt_uint64( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_string( - arg1: *mut nng_stream, + pub fn nng_setopt_string( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_ptr( - arg1: *mut nng_stream, + pub fn nng_setopt_ptr( + arg1: nng_socket, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_set_addr( - arg1: *mut nng_stream, + pub fn nng_ctx_getopt( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *const nng_sockaddr, + arg3: *mut ::core::ffi::c_void, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_alloc( - arg1: *mut *mut nng_stream_dialer, + pub fn nng_ctx_getopt_bool( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, + arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_alloc_url( - arg1: *mut *mut nng_stream_dialer, - arg2: *const nng_url, + pub fn nng_ctx_getopt_int( + arg1: nng_ctx, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_ctx_getopt_ms( + arg1: nng_ctx, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_duration, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_ctx_getopt_size( + arg1: nng_ctx, + arg2: *const ::std::os::raw::c_char, + arg3: *mut usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_ctx_setopt( + arg1: nng_ctx, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::core::ffi::c_void, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_free(arg1: *mut nng_stream_dialer); + pub fn nng_ctx_setopt_bool( + arg1: nng_ctx, + arg2: *const ::std::os::raw::c_char, + arg3: bool, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_close(arg1: *mut nng_stream_dialer); + pub fn nng_ctx_setopt_int( + arg1: nng_ctx, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_dial(arg1: *mut nng_stream_dialer, arg2: *mut nng_aio); + pub fn nng_ctx_setopt_ms( + arg1: nng_ctx, + arg2: *const ::std::os::raw::c_char, + arg3: nng_duration, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set( - arg1: *mut nng_stream_dialer, + pub fn nng_ctx_setopt_size( + arg1: nng_ctx, arg2: *const ::std::os::raw::c_char, - arg3: *const ::core::ffi::c_void, - arg4: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_bool( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_bool( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_int( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_int( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_ms( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_ms( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_size( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_size( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_uint64( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_sockaddr( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_string( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_uint64( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, + arg3: *mut u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_ptr( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_ptr( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *mut *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_get_addr( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_getopt_string( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, + arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_bool( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_setopt( + arg1: nng_dialer, + arg2: *const ::std::os::raw::c_char, + arg3: *const ::core::ffi::c_void, + arg4: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_dialer_setopt_bool( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_int( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_setopt_int( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_ms( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_setopt_ms( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_size( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_setopt_size( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, - arg3: size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_uint64( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_setopt_uint64( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_string( - arg1: *mut nng_stream_dialer, + pub fn nng_dialer_setopt_ptr( + arg1: nng_dialer, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn nng_dialer_setopt_string( + arg1: nng_dialer, arg2: *const ::std::os::raw::c_char, arg3: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_ptr( - arg1: *mut nng_stream_dialer, + pub fn nng_listener_getopt( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, arg3: *mut ::core::ffi::c_void, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_dialer_set_addr( - arg1: *mut nng_stream_dialer, + pub fn nng_listener_getopt_bool( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *const nng_sockaddr, + arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_alloc( - arg1: *mut *mut nng_stream_listener, + pub fn nng_listener_getopt_int( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_alloc_url( - arg1: *mut *mut nng_stream_listener, - arg2: *const nng_url, + pub fn nng_listener_getopt_ms( + arg1: nng_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_free(arg1: *mut nng_stream_listener); + pub fn nng_listener_getopt_size( + arg1: nng_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_close(arg1: *mut nng_stream_listener); + pub fn nng_listener_getopt_sockaddr( + arg1: nng_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut nng_sockaddr, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_listen(arg1: *mut nng_stream_listener) -> ::std::os::raw::c_int; + pub fn nng_listener_getopt_uint64( + arg1: nng_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut u64, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_accept(arg1: *mut nng_stream_listener, arg2: *mut nng_aio); + pub fn nng_listener_getopt_ptr( + arg1: nng_listener, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::core::ffi::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set( - arg1: *mut nng_stream_listener, + pub fn nng_listener_getopt_string( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *const ::core::ffi::c_void, - arg4: size_t, + arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, - arg4: *mut size_t, + arg3: *const ::core::ffi::c_void, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_bool( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt_bool( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut bool, + arg3: bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_int( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt_int( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_ms( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt_ms( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_duration, + arg3: nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_size( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt_size( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut size_t, + arg3: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_uint64( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt_uint64( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut u64, + arg3: u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_string( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt_ptr( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::std::os::raw::c_char, + arg3: *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_ptr( - arg1: *mut nng_stream_listener, + pub fn nng_listener_setopt_string( + arg1: nng_listener, arg2: *const ::std::os::raw::c_char, - arg3: *mut *mut ::core::ffi::c_void, + arg3: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_get_addr( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: *mut nng_sockaddr, + arg3: *mut ::core::ffi::c_void, + arg4: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_bool( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_bool( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: bool, + arg3: *mut bool, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_int( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_int( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_ms( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_ms( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: nng_duration, + arg3: *mut nng_duration, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_size( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_size( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: size_t, + arg3: *mut usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_uint64( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_sockaddr( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: u64, + arg3: *mut nng_sockaddr, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_string( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_uint64( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: *const ::std::os::raw::c_char, + arg3: *mut u64, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_ptr( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_ptr( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: *mut ::core::ffi::c_void, + arg3: *mut *mut ::core::ffi::c_void, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn nng_stream_listener_set_addr( - arg1: *mut nng_stream_listener, + pub fn nng_pipe_getopt_string( + arg1: nng_pipe, arg2: *const ::std::os::raw::c_char, - arg3: *const nng_sockaddr, + arg3: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } +extern "C" { + pub fn nng_closeall(); +} extern "C" { pub fn nng_bus0_open(arg1: *mut nng_socket) -> ::std::os::raw::c_int; }