open62541_sys/lib.rs
1//! Bindings for the [open62541](https://www.open62541.org) library.
2//!
3//! If you are looking for safe Rust bindings that can be used directly, see crate [`open62541`].
4//!
5//! [`open62541`]: https://crates.io/crates/open62541
6
7mod bindings;
8
9use core::ffi;
10
11pub use crate::bindings::*;
12
13// For some reason, `bindgen` generates different type signatures with variadic arguments. We try to
14// export a single type that can be used instead, e.g. in `UA_Logger::log`.
15#[cfg(all(unix, target_arch = "x86_64"))]
16#[allow(non_camel_case_types)] // Match open62541 type.
17#[doc(hidden)] // Not part of stable, public crate API.
18pub type va_list_ = *mut crate::__va_list_tag;
19#[cfg(not(all(unix, target_arch = "x86_64")))]
20#[allow(non_camel_case_types)] // Match open62541 type.
21#[doc(hidden)] // Not part of stable, public crate API.
22pub type va_list_ = crate::va_list;
23
24/// Callback type used for [`UA_Logger::log`].
25#[allow(non_camel_case_types)] // Match open62541 type.
26#[doc(hidden)] // Not part of stable, public crate API.
27pub type UA_LoggerLogCallback_ = Option<
28 unsafe extern "C" fn(
29 logContext: *mut ffi::c_void,
30 level: crate::UA_LogLevel,
31 category: crate::UA_LogCategory,
32 msg: *const ffi::c_char,
33 // Use unified type from above.
34 args: crate::va_list_,
35 ),
36>;
37
38/// Callback type used for [`UA_Logger::clear`].
39#[allow(non_camel_case_types)] // Match open62541 type.
40#[doc(hidden)] // Not part of stable, public crate API.
41pub type UA_LoggerClearCallback_ = Option<unsafe extern "C" fn(logger: *mut UA_Logger)>;