2025-07-29 12:59:33 -04:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Sealed with Magistamp.
|
|
|
|
|
2017-01-24 14:55:42 -05:00
|
|
|
//! This defines the primitive types that may be seen
|
|
|
|
//! when creating 'C' bindings.
|
2025-07-29 17:54:46 -04:00
|
|
|
/// 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};
|
2017-01-24 14:55:42 -05:00
|
|
|
|
|
|
|
// 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.
|
2017-01-24 14:55:42 -05:00
|
|
|
pub type CReturnVoid = ();
|
|
|
|
|
2025-07-29 17:54:46 -04:00
|
|
|
#[cfg(feature = "use_std")]
|
2019-06-24 19:55:35 -04:00
|
|
|
pub type CString = ::std::ffi::CString;
|