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