aboutsummaryrefslogtreecommitdiff
path: root/ctru-sys/src/sys/libc.rs
blob: cbc79589f0235ce674c6499ce9511c6386ce075f (plain) (blame)
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
pub const STDOUT_FILENO: c_int = 1;

#[repr(u8)]
pub enum c_void {
    __variant1,
    __variant2,
}

pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_char = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c_uint = u32;
pub type c_long = i32;
pub type c_ulong = u32;
pub type c_longlong = i64;
pub type c_ulonglong = u64;

pub type size_t = usize;
pub type ssize_t = isize;

extern "C" {
    pub fn __errno() -> *const c_int;
    pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
    pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void;
    pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
}