Module ctypes

Module ctypes 

Source
Expand description

C type aliases for FFI.

These types map to their C equivalents and are used in extern blocks for declaring foreign functions.

§Example

use ffi::c::*;

extern "C" {
    fn strlen(s: *const c_char) -> usize;
    fn malloc(size: usize) -> *mut c_void;
    fn free(ptr: *mut c_void);
    fn printf(fmt: *const c_char, ...) -> c_int;
}

Enums§

CType
C type information for type checking and code generation.

Constants§

C_TYPE_ALIASES
C type aliases as they appear in Sigil code.

Functions§

is_c_type
Check if a type name is a C type.