Skip to content

Instantly share code, notes, and snippets.

@jan-schreib
Created May 26, 2020 12:07
Show Gist options
  • Save jan-schreib/7b01c42fa52abdb41ded301560ee878f to your computer and use it in GitHub Desktop.
Save jan-schreib/7b01c42fa52abdb41ded301560ee878f to your computer and use it in GitHub Desktop.
libmosquitte libgen bindings
/* automatically generated by rust-bindgen */
pub const false_: u32 = 0;
pub const true_: u32 = 1;
pub const __bool_true_false_are_defined: u32 = 1;
pub const __ISO_C_VISIBLE: u32 = 2011;
pub const __XPG_VISIBLE: u32 = 700;
pub const __POSIX_VISIBLE: u32 = 200809;
pub const __BSD_VISIBLE: u32 = 1;
pub const _STACKALIGNBYTES: u32 = 15;
pub const _MAX_PAGE_SHIFT: u32 = 12;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT64_MIN: i64 = -9223372036854775808;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const INT64_MAX: u64 = 9223372036854775807;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const UINT64_MAX: i32 = -1;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST64_MIN: i64 = -9223372036854775808;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const INT_LEAST64_MAX: u64 = 9223372036854775807;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const UINT_LEAST64_MAX: i32 = -1;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const UINTPTR_MAX: i32 = -1;
pub const INTMAX_MIN: i64 = -9223372036854775808;
pub const INTMAX_MAX: u64 = 9223372036854775807;
pub const UINTMAX_MAX: i32 = -1;
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WCHAR_MIN: i32 = -2147483648;
pub const WCHAR_MAX: u32 = 2147483647;
pub const WINT_MIN: i32 = -2147483648;
pub const WINT_MAX: u32 = 2147483647;
pub const LIBMOSQUITTO_MAJOR: u32 = 1;
pub const LIBMOSQUITTO_MINOR: u32 = 6;
pub const LIBMOSQUITTO_REVISION: u32 = 9;
pub const LIBMOSQUITTO_VERSION_NUMBER: u32 = 1006009;
pub const MOSQ_LOG_NONE: u32 = 0;
pub const MOSQ_LOG_INFO: u32 = 1;
pub const MOSQ_LOG_NOTICE: u32 = 2;
pub const MOSQ_LOG_WARNING: u32 = 4;
pub const MOSQ_LOG_ERR: u32 = 8;
pub const MOSQ_LOG_DEBUG: u32 = 16;
pub const MOSQ_LOG_SUBSCRIBE: u32 = 32;
pub const MOSQ_LOG_UNSUBSCRIBE: u32 = 64;
pub const MOSQ_LOG_WEBSOCKETS: u32 = 128;
pub const MOSQ_LOG_INTERNAL: u32 = 2147483648;
pub const MOSQ_LOG_ALL: u32 = 4294967295;
pub const MOSQ_MQTT_ID_MAX_LENGTH: u32 = 23;
pub const MQTT_PROTOCOL_V31: u32 = 3;
pub const MQTT_PROTOCOL_V311: u32 = 4;
pub const MQTT_PROTOCOL_V5: u32 = 5;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
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 __int64_t = ::std::os::raw::c_longlong;
pub type __uint64_t = ::std::os::raw::c_ulonglong;
pub type __int_least8_t = __int8_t;
pub type __uint_least8_t = __uint8_t;
pub type __int_least16_t = __int16_t;
pub type __uint_least16_t = __uint16_t;
pub type __int_least32_t = __int32_t;
pub type __uint_least32_t = __uint32_t;
pub type __int_least64_t = __int64_t;
pub type __uint_least64_t = __uint64_t;
pub type __int_fast8_t = __int32_t;
pub type __uint_fast8_t = __uint32_t;
pub type __int_fast16_t = __int32_t;
pub type __uint_fast16_t = __uint32_t;
pub type __int_fast32_t = __int32_t;
pub type __uint_fast32_t = __uint32_t;
pub type __int_fast64_t = __int64_t;
pub type __uint_fast64_t = __uint64_t;
pub type __intptr_t = ::std::os::raw::c_long;
pub type __uintptr_t = ::std::os::raw::c_ulong;
pub type __intmax_t = __int64_t;
pub type __uintmax_t = __uint64_t;
pub type __register_t = ::std::os::raw::c_long;
pub type __vaddr_t = ::std::os::raw::c_ulong;
pub type __paddr_t = ::std::os::raw::c_ulong;
pub type __vsize_t = ::std::os::raw::c_ulong;
pub type __psize_t = ::std::os::raw::c_ulong;
pub type __double_t = f64;
pub type __float_t = f32;
pub type __ptrdiff_t = ::std::os::raw::c_long;
pub type __size_t = ::std::os::raw::c_ulong;
pub type __ssize_t = ::std::os::raw::c_long;
pub type __va_list = __builtin_va_list;
pub type __wchar_t = ::std::os::raw::c_int;
pub type __wint_t = ::std::os::raw::c_int;
pub type __rune_t = ::std::os::raw::c_int;
pub type __wctrans_t = *mut ::std::os::raw::c_void;
pub type __wctype_t = *mut ::std::os::raw::c_void;
pub type __blkcnt_t = __int64_t;
pub type __blksize_t = __int32_t;
pub type __clock_t = __int64_t;
pub type __clockid_t = __int32_t;
pub type __cpuid_t = ::std::os::raw::c_ulong;
pub type __dev_t = __int32_t;
pub type __fixpt_t = __uint32_t;
pub type __fsblkcnt_t = __uint64_t;
pub type __fsfilcnt_t = __uint64_t;
pub type __gid_t = __uint32_t;
pub type __id_t = __uint32_t;
pub type __in_addr_t = __uint32_t;
pub type __in_port_t = __uint16_t;
pub type __ino_t = __uint64_t;
pub type __key_t = ::std::os::raw::c_long;
pub type __mode_t = __uint32_t;
pub type __nlink_t = __uint32_t;
pub type __off_t = __int64_t;
pub type __pid_t = __int32_t;
pub type __rlim_t = __uint64_t;
pub type __sa_family_t = __uint8_t;
pub type __segsz_t = __int32_t;
pub type __socklen_t = __uint32_t;
pub type __suseconds_t = ::std::os::raw::c_long;
pub type __swblk_t = __int32_t;
pub type __time_t = __int64_t;
pub type __timer_t = __int32_t;
pub type __uid_t = __uint32_t;
pub type __useconds_t = __uint32_t;
#[repr(C)]
#[derive(Copy, Clone)]
pub union __mbstate_t {
pub __mbstate8: [::std::os::raw::c_char; 128usize],
pub __mbstateL: __int64_t,
_bindgen_union_align: [u64; 16usize],
}
#[test]
fn bindgen_test_layout___mbstate_t() {
assert_eq!(
::std::mem::size_of::<__mbstate_t>(),
128usize,
concat!("Size of: ", stringify!(__mbstate_t))
);
assert_eq!(
::std::mem::align_of::<__mbstate_t>(),
8usize,
concat!("Alignment of ", stringify!(__mbstate_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__mbstate8 as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__mbstate_t),
"::",
stringify!(__mbstate8)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__mbstate_t>())).__mbstateL as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__mbstate_t),
"::",
stringify!(__mbstateL)
)
);
}
pub type size_t = __size_t;
pub type wchar_t = __wchar_t;
pub type wint_t = __wint_t;
pub type mbstate_t = __mbstate_t;
#[repr(C)]
#[repr(align(16))]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
pub __max_align_ll: ::std::os::raw::c_longlong,
pub __bindgen_padding_0: u64,
pub __max_align_ld: u128,
}
#[test]
fn bindgen_test_layout_max_align_t() {
assert_eq!(
::std::mem::size_of::<max_align_t>(),
32usize,
concat!("Size of: ", stringify!(max_align_t))
);
assert_eq!(
::std::mem::align_of::<max_align_t>(),
16usize,
concat!("Alignment of ", stringify!(max_align_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<max_align_t>())).__max_align_ll as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(max_align_t),
"::",
stringify!(__max_align_ll)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<max_align_t>())).__max_align_ld as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(max_align_t),
"::",
stringify!(__max_align_ld)
)
);
}
pub type int_least8_t = __int_least8_t;
pub type uint_least8_t = __uint_least8_t;
pub type int_least16_t = __int_least16_t;
pub type uint_least16_t = __uint_least16_t;
pub type int_least32_t = __int_least32_t;
pub type uint_least32_t = __uint_least32_t;
pub type int_least64_t = __int_least64_t;
pub type uint_least64_t = __uint_least64_t;
pub type int_fast8_t = __int_fast8_t;
pub type uint_fast8_t = __uint_fast8_t;
pub type int_fast16_t = __int_fast16_t;
pub type uint_fast16_t = __uint_fast16_t;
pub type int_fast32_t = __int_fast32_t;
pub type uint_fast32_t = __uint_fast32_t;
pub type int_fast64_t = __int_fast64_t;
pub type uint_fast64_t = __uint_fast64_t;
pub type intmax_t = __intmax_t;
pub type uintmax_t = __uintmax_t;
pub const mosq_err_t_MOSQ_ERR_AUTH_CONTINUE: mosq_err_t = -4;
pub const mosq_err_t_MOSQ_ERR_NO_SUBSCRIBERS: mosq_err_t = -3;
pub const mosq_err_t_MOSQ_ERR_SUB_EXISTS: mosq_err_t = -2;
pub const mosq_err_t_MOSQ_ERR_CONN_PENDING: mosq_err_t = -1;
pub const mosq_err_t_MOSQ_ERR_SUCCESS: mosq_err_t = 0;
pub const mosq_err_t_MOSQ_ERR_NOMEM: mosq_err_t = 1;
pub const mosq_err_t_MOSQ_ERR_PROTOCOL: mosq_err_t = 2;
pub const mosq_err_t_MOSQ_ERR_INVAL: mosq_err_t = 3;
pub const mosq_err_t_MOSQ_ERR_NO_CONN: mosq_err_t = 4;
pub const mosq_err_t_MOSQ_ERR_CONN_REFUSED: mosq_err_t = 5;
pub const mosq_err_t_MOSQ_ERR_NOT_FOUND: mosq_err_t = 6;
pub const mosq_err_t_MOSQ_ERR_CONN_LOST: mosq_err_t = 7;
pub const mosq_err_t_MOSQ_ERR_TLS: mosq_err_t = 8;
pub const mosq_err_t_MOSQ_ERR_PAYLOAD_SIZE: mosq_err_t = 9;
pub const mosq_err_t_MOSQ_ERR_NOT_SUPPORTED: mosq_err_t = 10;
pub const mosq_err_t_MOSQ_ERR_AUTH: mosq_err_t = 11;
pub const mosq_err_t_MOSQ_ERR_ACL_DENIED: mosq_err_t = 12;
pub const mosq_err_t_MOSQ_ERR_UNKNOWN: mosq_err_t = 13;
pub const mosq_err_t_MOSQ_ERR_ERRNO: mosq_err_t = 14;
pub const mosq_err_t_MOSQ_ERR_EAI: mosq_err_t = 15;
pub const mosq_err_t_MOSQ_ERR_PROXY: mosq_err_t = 16;
pub const mosq_err_t_MOSQ_ERR_PLUGIN_DEFER: mosq_err_t = 17;
pub const mosq_err_t_MOSQ_ERR_MALFORMED_UTF8: mosq_err_t = 18;
pub const mosq_err_t_MOSQ_ERR_KEEPALIVE: mosq_err_t = 19;
pub const mosq_err_t_MOSQ_ERR_LOOKUP: mosq_err_t = 20;
pub const mosq_err_t_MOSQ_ERR_MALFORMED_PACKET: mosq_err_t = 21;
pub const mosq_err_t_MOSQ_ERR_DUPLICATE_PROPERTY: mosq_err_t = 22;
pub const mosq_err_t_MOSQ_ERR_TLS_HANDSHAKE: mosq_err_t = 23;
pub const mosq_err_t_MOSQ_ERR_QOS_NOT_SUPPORTED: mosq_err_t = 24;
pub const mosq_err_t_MOSQ_ERR_OVERSIZE_PACKET: mosq_err_t = 25;
pub const mosq_err_t_MOSQ_ERR_OCSP: mosq_err_t = 26;
pub type mosq_err_t = i32;
pub const mosq_opt_t_MOSQ_OPT_PROTOCOL_VERSION: mosq_opt_t = 1;
pub const mosq_opt_t_MOSQ_OPT_SSL_CTX: mosq_opt_t = 2;
pub const mosq_opt_t_MOSQ_OPT_SSL_CTX_WITH_DEFAULTS: mosq_opt_t = 3;
pub const mosq_opt_t_MOSQ_OPT_RECEIVE_MAXIMUM: mosq_opt_t = 4;
pub const mosq_opt_t_MOSQ_OPT_SEND_MAXIMUM: mosq_opt_t = 5;
pub const mosq_opt_t_MOSQ_OPT_TLS_KEYFORM: mosq_opt_t = 6;
pub const mosq_opt_t_MOSQ_OPT_TLS_ENGINE: mosq_opt_t = 7;
pub const mosq_opt_t_MOSQ_OPT_TLS_ENGINE_KPASS_SHA1: mosq_opt_t = 8;
pub const mosq_opt_t_MOSQ_OPT_TLS_OCSP_REQUIRED: mosq_opt_t = 9;
pub const mosq_opt_t_MOSQ_OPT_TLS_ALPN: mosq_opt_t = 10;
pub type mosq_opt_t = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mosquitto_message {
pub mid: ::std::os::raw::c_int,
pub topic: *mut ::std::os::raw::c_char,
pub payload: *mut ::std::os::raw::c_void,
pub payloadlen: ::std::os::raw::c_int,
pub qos: ::std::os::raw::c_int,
pub retain: bool,
}
#[test]
fn bindgen_test_layout_mosquitto_message() {
assert_eq!(
::std::mem::size_of::<mosquitto_message>(),
40usize,
concat!("Size of: ", stringify!(mosquitto_message))
);
assert_eq!(
::std::mem::align_of::<mosquitto_message>(),
8usize,
concat!("Alignment of ", stringify!(mosquitto_message))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<mosquitto_message>())).mid as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(mosquitto_message),
"::",
stringify!(mid)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<mosquitto_message>())).topic as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(mosquitto_message),
"::",
stringify!(topic)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<mosquitto_message>())).payload as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(mosquitto_message),
"::",
stringify!(payload)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<mosquitto_message>())).payloadlen as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(mosquitto_message),
"::",
stringify!(payloadlen)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<mosquitto_message>())).qos as *const _ as usize },
28usize,
concat!(
"Offset of field: ",
stringify!(mosquitto_message),
"::",
stringify!(qos)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<mosquitto_message>())).retain as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(mosquitto_message),
"::",
stringify!(retain)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mosquitto {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mqtt5__property {
_unused: [u8; 0],
}
pub type mosquitto_property = mqtt5__property;
extern "C" {
#[doc = " Important note"]
#[doc = ""]
#[doc = " The following functions that deal with network operations will return"]
#[doc = " MOSQ_ERR_SUCCESS on success, but this does not mean that the operation has"]
#[doc = " taken place. An attempt will be made to write the network data, but if the"]
#[doc = " socket is not available for writing at that time then the packet will not be"]
#[doc = " sent. To ensure the packet is sent, call mosquitto_loop() (which must also"]
#[doc = " be called to process incoming network data)."]
#[doc = " This is especially important when disconnecting a client that has a will. If"]
#[doc = " the broker does not receive the DISCONNECT command, it will assume that the"]
#[doc = " client has disconnected unexpectedly and send the will."]
#[doc = ""]
#[doc = " mosquitto_connect()"]
#[doc = " mosquitto_disconnect()"]
#[doc = " mosquitto_subscribe()"]
#[doc = " mosquitto_unsubscribe()"]
#[doc = " mosquitto_publish()"]
pub fn mosquitto_lib_version(
major: *mut ::std::os::raw::c_int,
minor: *mut ::std::os::raw::c_int,
revision: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_lib_init() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_lib_cleanup() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_new(
id: *const ::std::os::raw::c_char,
clean_session: bool,
obj: *mut ::std::os::raw::c_void,
) -> *mut mosquitto;
}
extern "C" {
pub fn mosquitto_destroy(mosq: *mut mosquitto);
}
extern "C" {
pub fn mosquitto_reinitialise(
mosq: *mut mosquitto,
id: *const ::std::os::raw::c_char,
clean_session: bool,
obj: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_will_set(
mosq: *mut mosquitto,
topic: *const ::std::os::raw::c_char,
payloadlen: ::std::os::raw::c_int,
payload: *const ::std::os::raw::c_void,
qos: ::std::os::raw::c_int,
retain: bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_will_set_v5(
mosq: *mut mosquitto,
topic: *const ::std::os::raw::c_char,
payloadlen: ::std::os::raw::c_int,
payload: *const ::std::os::raw::c_void,
qos: ::std::os::raw::c_int,
retain: bool,
properties: *mut mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_will_clear(mosq: *mut mosquitto) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_username_pw_set(
mosq: *mut mosquitto,
username: *const ::std::os::raw::c_char,
password: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_connect(
mosq: *mut mosquitto,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
keepalive: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_connect_bind(
mosq: *mut mosquitto,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
keepalive: ::std::os::raw::c_int,
bind_address: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_connect_bind_v5(
mosq: *mut mosquitto,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
keepalive: ::std::os::raw::c_int,
bind_address: *const ::std::os::raw::c_char,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_connect_async(
mosq: *mut mosquitto,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
keepalive: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_connect_bind_async(
mosq: *mut mosquitto,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
keepalive: ::std::os::raw::c_int,
bind_address: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_connect_srv(
mosq: *mut mosquitto,
host: *const ::std::os::raw::c_char,
keepalive: ::std::os::raw::c_int,
bind_address: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_reconnect(mosq: *mut mosquitto) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_reconnect_async(mosq: *mut mosquitto) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_disconnect(mosq: *mut mosquitto) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_disconnect_v5(
mosq: *mut mosquitto,
reason_code: ::std::os::raw::c_int,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_publish(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
topic: *const ::std::os::raw::c_char,
payloadlen: ::std::os::raw::c_int,
payload: *const ::std::os::raw::c_void,
qos: ::std::os::raw::c_int,
retain: bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_publish_v5(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
topic: *const ::std::os::raw::c_char,
payloadlen: ::std::os::raw::c_int,
payload: *const ::std::os::raw::c_void,
qos: ::std::os::raw::c_int,
retain: bool,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_subscribe(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
sub: *const ::std::os::raw::c_char,
qos: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_subscribe_v5(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
sub: *const ::std::os::raw::c_char,
qos: ::std::os::raw::c_int,
options: ::std::os::raw::c_int,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_subscribe_multiple(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
sub_count: ::std::os::raw::c_int,
sub: *const *mut ::std::os::raw::c_char,
qos: ::std::os::raw::c_int,
options: ::std::os::raw::c_int,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_unsubscribe(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
sub: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_unsubscribe_v5(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
sub: *const ::std::os::raw::c_char,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_unsubscribe_multiple(
mosq: *mut mosquitto,
mid: *mut ::std::os::raw::c_int,
sub_count: ::std::os::raw::c_int,
sub: *const *mut ::std::os::raw::c_char,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_message_copy(
dst: *mut mosquitto_message,
src: *const mosquitto_message,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_message_free(message: *mut *mut mosquitto_message);
}
extern "C" {
pub fn mosquitto_message_free_contents(message: *mut mosquitto_message);
}
extern "C" {
pub fn mosquitto_loop_forever(
mosq: *mut mosquitto,
timeout: ::std::os::raw::c_int,
max_packets: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_loop_start(mosq: *mut mosquitto) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_loop_stop(mosq: *mut mosquitto, force: bool) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_loop(
mosq: *mut mosquitto,
timeout: ::std::os::raw::c_int,
max_packets: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_loop_read(
mosq: *mut mosquitto,
max_packets: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_loop_write(
mosq: *mut mosquitto,
max_packets: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_loop_misc(mosq: *mut mosquitto) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_socket(mosq: *mut mosquitto) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_want_write(mosq: *mut mosquitto) -> bool;
}
extern "C" {
pub fn mosquitto_threaded_set(mosq: *mut mosquitto, threaded: bool) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_opts_set(
mosq: *mut mosquitto,
option: mosq_opt_t,
value: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_int_option(
mosq: *mut mosquitto,
option: mosq_opt_t,
value: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_void_option(
mosq: *mut mosquitto,
option: mosq_opt_t,
value: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_reconnect_delay_set(
mosq: *mut mosquitto,
reconnect_delay: ::std::os::raw::c_uint,
reconnect_delay_max: ::std::os::raw::c_uint,
reconnect_exponential_backoff: bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_max_inflight_messages_set(
mosq: *mut mosquitto,
max_inflight_messages: ::std::os::raw::c_uint,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_message_retry_set(mosq: *mut mosquitto, message_retry: ::std::os::raw::c_uint);
}
extern "C" {
pub fn mosquitto_user_data_set(mosq: *mut mosquitto, obj: *mut ::std::os::raw::c_void);
}
extern "C" {
pub fn mosquitto_userdata(mosq: *mut mosquitto) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn mosquitto_tls_set(
mosq: *mut mosquitto,
cafile: *const ::std::os::raw::c_char,
capath: *const ::std::os::raw::c_char,
certfile: *const ::std::os::raw::c_char,
keyfile: *const ::std::os::raw::c_char,
pw_callback: ::std::option::Option<
unsafe extern "C" fn(
buf: *mut ::std::os::raw::c_char,
size: ::std::os::raw::c_int,
rwflag: ::std::os::raw::c_int,
userdata: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_tls_insecure_set(mosq: *mut mosquitto, value: bool) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_tls_opts_set(
mosq: *mut mosquitto,
cert_reqs: ::std::os::raw::c_int,
tls_version: *const ::std::os::raw::c_char,
ciphers: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_tls_psk_set(
mosq: *mut mosquitto,
psk: *const ::std::os::raw::c_char,
identity: *const ::std::os::raw::c_char,
ciphers: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_connect_callback_set(
mosq: *mut mosquitto,
on_connect: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
),
>,
);
}
extern "C" {
pub fn mosquitto_connect_with_flags_callback_set(
mosq: *mut mosquitto,
on_connect: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: ::std::os::raw::c_int,
),
>,
);
}
extern "C" {
pub fn mosquitto_connect_v5_callback_set(
mosq: *mut mosquitto,
on_connect: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: ::std::os::raw::c_int,
props: *const mosquitto_property,
),
>,
);
}
extern "C" {
pub fn mosquitto_disconnect_callback_set(
mosq: *mut mosquitto,
on_disconnect: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
),
>,
);
}
extern "C" {
pub fn mosquitto_disconnect_v5_callback_set(
mosq: *mut mosquitto,
on_disconnect: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: *const mosquitto_property,
),
>,
);
}
extern "C" {
pub fn mosquitto_publish_callback_set(
mosq: *mut mosquitto,
on_publish: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
),
>,
);
}
extern "C" {
pub fn mosquitto_publish_v5_callback_set(
mosq: *mut mosquitto,
on_publish: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: ::std::os::raw::c_int,
arg5: *const mosquitto_property,
),
>,
);
}
extern "C" {
pub fn mosquitto_message_callback_set(
mosq: *mut mosquitto,
on_message: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: *const mosquitto_message,
),
>,
);
}
extern "C" {
pub fn mosquitto_message_v5_callback_set(
mosq: *mut mosquitto,
on_message: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: *const mosquitto_message,
arg4: *const mosquitto_property,
),
>,
);
}
extern "C" {
pub fn mosquitto_subscribe_callback_set(
mosq: *mut mosquitto,
on_subscribe: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: ::std::os::raw::c_int,
arg5: *const ::std::os::raw::c_int,
),
>,
);
}
extern "C" {
pub fn mosquitto_subscribe_v5_callback_set(
mosq: *mut mosquitto,
on_subscribe: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: ::std::os::raw::c_int,
arg5: *const ::std::os::raw::c_int,
arg6: *const mosquitto_property,
),
>,
);
}
extern "C" {
pub fn mosquitto_unsubscribe_callback_set(
mosq: *mut mosquitto,
on_unsubscribe: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
),
>,
);
}
extern "C" {
pub fn mosquitto_unsubscribe_v5_callback_set(
mosq: *mut mosquitto,
on_unsubscribe: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: *const mosquitto_property,
),
>,
);
}
extern "C" {
pub fn mosquitto_log_callback_set(
mosq: *mut mosquitto,
on_log: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: ::std::os::raw::c_int,
arg4: *const ::std::os::raw::c_char,
),
>,
);
}
extern "C" {
pub fn mosquitto_string_option(
mosq: *mut mosquitto,
option: mosq_opt_t,
value: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_socks5_set(
mosq: *mut mosquitto,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
username: *const ::std::os::raw::c_char,
password: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_strerror(mosq_errno: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn mosquitto_connack_string(
connack_code: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn mosquitto_reason_string(
reason_code: ::std::os::raw::c_int,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn mosquitto_string_to_command(
str: *const ::std::os::raw::c_char,
cmd: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_sub_topic_tokenise(
subtopic: *const ::std::os::raw::c_char,
topics: *mut *mut *mut ::std::os::raw::c_char,
count: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_sub_topic_tokens_free(
topics: *mut *mut *mut ::std::os::raw::c_char,
count: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_topic_matches_sub(
sub: *const ::std::os::raw::c_char,
topic: *const ::std::os::raw::c_char,
result: *mut bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_topic_matches_sub2(
sub: *const ::std::os::raw::c_char,
sublen: size_t,
topic: *const ::std::os::raw::c_char,
topiclen: size_t,
result: *mut bool,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_pub_topic_check(topic: *const ::std::os::raw::c_char)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_pub_topic_check2(
topic: *const ::std::os::raw::c_char,
topiclen: size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_sub_topic_check(topic: *const ::std::os::raw::c_char)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_sub_topic_check2(
topic: *const ::std::os::raw::c_char,
topiclen: size_t,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_validate_utf8(
str: *const ::std::os::raw::c_char,
len: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct libmosquitto_will {
pub topic: *mut ::std::os::raw::c_char,
pub payload: *mut ::std::os::raw::c_void,
pub payloadlen: ::std::os::raw::c_int,
pub qos: ::std::os::raw::c_int,
pub retain: bool,
}
#[test]
fn bindgen_test_layout_libmosquitto_will() {
assert_eq!(
::std::mem::size_of::<libmosquitto_will>(),
32usize,
concat!("Size of: ", stringify!(libmosquitto_will))
);
assert_eq!(
::std::mem::align_of::<libmosquitto_will>(),
8usize,
concat!("Alignment of ", stringify!(libmosquitto_will))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_will>())).topic as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_will),
"::",
stringify!(topic)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_will>())).payload as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_will),
"::",
stringify!(payload)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_will>())).payloadlen as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_will),
"::",
stringify!(payloadlen)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_will>())).qos as *const _ as usize },
20usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_will),
"::",
stringify!(qos)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_will>())).retain as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_will),
"::",
stringify!(retain)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct libmosquitto_auth {
pub username: *mut ::std::os::raw::c_char,
pub password: *mut ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_libmosquitto_auth() {
assert_eq!(
::std::mem::size_of::<libmosquitto_auth>(),
16usize,
concat!("Size of: ", stringify!(libmosquitto_auth))
);
assert_eq!(
::std::mem::align_of::<libmosquitto_auth>(),
8usize,
concat!("Alignment of ", stringify!(libmosquitto_auth))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_auth>())).username as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_auth),
"::",
stringify!(username)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_auth>())).password as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_auth),
"::",
stringify!(password)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct libmosquitto_tls {
pub cafile: *mut ::std::os::raw::c_char,
pub capath: *mut ::std::os::raw::c_char,
pub certfile: *mut ::std::os::raw::c_char,
pub keyfile: *mut ::std::os::raw::c_char,
pub ciphers: *mut ::std::os::raw::c_char,
pub tls_version: *mut ::std::os::raw::c_char,
pub pw_callback: ::std::option::Option<
unsafe extern "C" fn(
buf: *mut ::std::os::raw::c_char,
size: ::std::os::raw::c_int,
rwflag: ::std::os::raw::c_int,
userdata: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>,
pub cert_reqs: ::std::os::raw::c_int,
}
#[test]
fn bindgen_test_layout_libmosquitto_tls() {
assert_eq!(
::std::mem::size_of::<libmosquitto_tls>(),
64usize,
concat!("Size of: ", stringify!(libmosquitto_tls))
);
assert_eq!(
::std::mem::align_of::<libmosquitto_tls>(),
8usize,
concat!("Alignment of ", stringify!(libmosquitto_tls))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).cafile as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(cafile)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).capath as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(capath)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).certfile as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(certfile)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).keyfile as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(keyfile)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).ciphers as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(ciphers)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).tls_version as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(tls_version)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).pw_callback as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(pw_callback)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<libmosquitto_tls>())).cert_reqs as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(libmosquitto_tls),
"::",
stringify!(cert_reqs)
)
);
}
extern "C" {
pub fn mosquitto_subscribe_simple(
messages: *mut *mut mosquitto_message,
msg_count: ::std::os::raw::c_int,
want_retained: bool,
topic: *const ::std::os::raw::c_char,
qos: ::std::os::raw::c_int,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
client_id: *const ::std::os::raw::c_char,
keepalive: ::std::os::raw::c_int,
clean_session: bool,
username: *const ::std::os::raw::c_char,
password: *const ::std::os::raw::c_char,
will: *const libmosquitto_will,
tls: *const libmosquitto_tls,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_subscribe_callback(
callback: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut mosquitto,
arg2: *mut ::std::os::raw::c_void,
arg3: *const mosquitto_message,
) -> ::std::os::raw::c_int,
>,
userdata: *mut ::std::os::raw::c_void,
topic: *const ::std::os::raw::c_char,
qos: ::std::os::raw::c_int,
host: *const ::std::os::raw::c_char,
port: ::std::os::raw::c_int,
client_id: *const ::std::os::raw::c_char,
keepalive: ::std::os::raw::c_int,
clean_session: bool,
username: *const ::std::os::raw::c_char,
password: *const ::std::os::raw::c_char,
will: *const libmosquitto_will,
tls: *const libmosquitto_tls,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_add_byte(
proplist: *mut *mut mosquitto_property,
identifier: ::std::os::raw::c_int,
value: u8,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_add_int16(
proplist: *mut *mut mosquitto_property,
identifier: ::std::os::raw::c_int,
value: u16,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_add_int32(
proplist: *mut *mut mosquitto_property,
identifier: ::std::os::raw::c_int,
value: u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_add_varint(
proplist: *mut *mut mosquitto_property,
identifier: ::std::os::raw::c_int,
value: u32,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_add_binary(
proplist: *mut *mut mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *const ::std::os::raw::c_void,
len: u16,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_add_string(
proplist: *mut *mut mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_add_string_pair(
proplist: *mut *mut mosquitto_property,
identifier: ::std::os::raw::c_int,
name: *const ::std::os::raw::c_char,
value: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_read_byte(
proplist: *const mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *mut u8,
skip_first: bool,
) -> *const mosquitto_property;
}
extern "C" {
pub fn mosquitto_property_read_int16(
proplist: *const mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *mut u16,
skip_first: bool,
) -> *const mosquitto_property;
}
extern "C" {
pub fn mosquitto_property_read_int32(
proplist: *const mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *mut u32,
skip_first: bool,
) -> *const mosquitto_property;
}
extern "C" {
pub fn mosquitto_property_read_varint(
proplist: *const mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *mut u32,
skip_first: bool,
) -> *const mosquitto_property;
}
extern "C" {
pub fn mosquitto_property_read_binary(
proplist: *const mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *mut *mut ::std::os::raw::c_void,
len: *mut u16,
skip_first: bool,
) -> *const mosquitto_property;
}
extern "C" {
pub fn mosquitto_property_read_string(
proplist: *const mosquitto_property,
identifier: ::std::os::raw::c_int,
value: *mut *mut ::std::os::raw::c_char,
skip_first: bool,
) -> *const mosquitto_property;
}
extern "C" {
pub fn mosquitto_property_read_string_pair(
proplist: *const mosquitto_property,
identifier: ::std::os::raw::c_int,
name: *mut *mut ::std::os::raw::c_char,
value: *mut *mut ::std::os::raw::c_char,
skip_first: bool,
) -> *const mosquitto_property;
}
extern "C" {
pub fn mosquitto_property_free_all(properties: *mut *mut mosquitto_property);
}
extern "C" {
pub fn mosquitto_property_copy_all(
dest: *mut *mut mosquitto_property,
src: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_check_command(
command: ::std::os::raw::c_int,
identifier: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_property_check_all(
command: ::std::os::raw::c_int,
properties: *const mosquitto_property,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn mosquitto_string_to_property_info(
propname: *const ::std::os::raw::c_char,
identifier: *mut ::std::os::raw::c_int,
type_: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
pub type __builtin_va_list = [__va_list_tag; 1usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __va_list_tag {
pub gp_offset: ::std::os::raw::c_uint,
pub fp_offset: ::std::os::raw::c_uint,
pub overflow_arg_area: *mut ::std::os::raw::c_void,
pub reg_save_area: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout___va_list_tag() {
assert_eq!(
::std::mem::size_of::<__va_list_tag>(),
24usize,
concat!("Size of: ", stringify!(__va_list_tag))
);
assert_eq!(
::std::mem::align_of::<__va_list_tag>(),
8usize,
concat!("Alignment of ", stringify!(__va_list_tag))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).gp_offset as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(gp_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize },
4usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(fp_offset)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(overflow_arg_area)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(__va_list_tag),
"::",
stringify!(reg_save_area)
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment