Files
binding/src/c_types.rs

19 lines
951 B
Rust
Raw Normal View History

// SPDX-License-Identifier: Apache-2.0
// Sealed with Magistamp.
//! This defines the primitive types that may be seen
//! when creating 'C' bindings.
/// CVoid acts as a 'C' void pointer to pass to functions. **DO NOT**
/// use this as a return type from a 'C' function. If a 'C' function
/// returns void, then use the CReturnVoid type for that.
pub use std::ffi::{c_char as CChar, c_double as CDouble, c_float as CFloat, c_int as CInt, c_long as CLong, c_longlong as CLongLong, c_short as CShort, c_uchar as CUChar, c_uint as CUInt, c_ulong as CULong, c_ulonglong as CULongLong, c_ushort as CUShort, c_void as CVoid, CStr};
// Void types.
/// To return void from a 'C' function it should return an empty tuple ().
/// This type is just a descriptive version of that. **DO NOT** use this
2017-04-06 17:28:02 -04:00
/// as an argument to a function. Use the CVoid type for that.
pub type CReturnVoid = ();
#[cfg(feature = "use_std")]
pub type CString = ::std::ffi::CString;