Skip to main content

devela/lang/prog/ffi/c/
libc.rs

1// devela/src/lang/prog/ffi/c/libc.rs
2
3#![allow(non_camel_case_types)]
4
5#[doc = crate::_tags!(primitive logic)]
6/// Equivalent to C99 `_Bool` / `<stdbool.h>` `bool`.
7#[doc = crate::_doc_meta!{location("lang/ffi/c")}]
8pub type c_bool = bool;
9
10#[doc = crate::_tags!(primitive num)]
11/// Equivalent to C's `mode_t` type.
12#[doc = crate::_doc_meta!{location("lang/ffi/c")}]
13///
14/// POSIX numeric type used to encode file modes and permission bits.
15pub type c_mode_t = u32;
16
17#[doc = crate::_tags!(primitive num)]
18/// Equivalent to C's `off_t` type.
19#[doc = crate::_doc_meta!{location("lang/ffi/c")}]
20///
21/// POSIX signed integer type used to represent file offsets and sizes.
22pub type c_off_t = i64;
23
24#[doc = crate::_tags!(primitive num)]
25/// Equivalent to C's `size_t` type.
26#[doc = crate::_doc_meta!{location("lang/ffi/c")}]
27///
28/// Unsigned integer type (C standard)
29/// used to represent the size of objects in bytes and the result of `sizeof`.
30pub type c_size_t = usize;
31
32#[doc = crate::_tags!(primitive num)]
33/// Equivalent to C's `ssize_t` type.
34#[doc = crate::_doc_meta!{location("lang/ffi/c")}]
35///
36/// POSIX signed integer type used for functions
37/// that return either a non‑negative byte count or -1 to indicate an error.
38pub type c_ssize_t = isize;