drone_ctypes/lib.rs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
//! Platform-specific types, as defined by C, for [Drone] applications.
//!
//! This crate is an analogue of [`std::os::raw`] module. See its documentation
//! for more details.
//!
//! [Drone]: https://github.com/drone-os/drone
//! [`std::os::raw`]: https://doc.rust-lang.org/std/os/raw/
#![warn(missing_docs, unsafe_op_in_unsafe_fn)]
#![warn(clippy::pedantic)]
#![allow(non_camel_case_types)]
#![no_std]
#[doc(no_inline)]
pub use core::ffi::c_void;
/// Equivalent to C's `char` type.
pub type c_char = u8;
/// Equivalent to C's `signed char` type.
pub type c_schar = i8;
/// Equivalent to C's `unsigned char` type.
pub type c_uchar = u8;
/// Equivalent to C's `signed short` (`short`) type.
pub type c_short = i16;
/// Equivalent to C's `unsigned short` type.
pub type c_ushort = u16;
/// Equivalent to C's `signed int` (`int`) type.
pub type c_int = i32;
/// Equivalent to C's `unsigned int` type.
pub type c_uint = u32;
/// Equivalent to C's `signed long` (`long`) type.
#[cfg(target_pointer_width = "32")]
pub type c_long = i32;
/// Equivalent to C's `unsigned long` type.
#[cfg(target_pointer_width = "32")]
pub type c_ulong = u32;
/// Equivalent to C's `signed long` (`long`) type.
#[cfg(target_pointer_width = "64")]
pub type c_long = i64;
/// Equivalent to C's `unsigned long` type.
#[cfg(target_pointer_width = "64")]
pub type c_ulong = u64;
/// Equivalent to C's `signed long long` (`long long`) type.
pub type c_longlong = i64;
/// Equivalent to C's `unsigned long long` type.
pub type c_ulonglong = u64;
/// Equivalent to C's `float` type.
pub type c_float = f32;
/// Equivalent to C's `double` type.
pub type c_double = f64;