Mojo module
ffi
Implements a foreign functions interface (FFI).
Aliases
c_char
alias c_char = SIMD[int8, 1]
C char
type.
c_double
alias c_double = SIMD[float64, 1]
C double
type.
c_float
alias c_float = SIMD[float32, 1]
C float
type.
c_int
alias c_int = SIMD[int32, 1]
C int
type.
The C int
type is typically a signed 32-bit integer on commonly used targets
today.
c_long
alias c_long = SIMD[_c_long_dtype(), 1]
C long
type.
The C long
type is typically a signed 64-bit integer on macOS and Linux, and a
32-bit integer on Windows.
c_long_long
alias c_long_long = SIMD[_c_long_long_dtype(), 1]
C long long
type.
The C long long
type is typically a signed 64-bit integer on commonly used
targets today.
c_short
alias c_short = SIMD[int16, 1]
C short
type.
c_size_t
alias c_size_t = UInt
C size_t
type.
c_ssize_t
alias c_ssize_t = Int
C ssize_t
type.
c_uchar
alias c_uchar = SIMD[uint8, 1]
C unsigned char
type.
c_uint
alias c_uint = SIMD[uint32, 1]
C unsigned int
type.
c_ushort
alias c_ushort = SIMD[uint16, 1]
C unsigned short
type.
DEFAULT_RTLD
alias DEFAULT_RTLD = (256 if os_is_linux() else 8 | 2)
OpaquePointer
alias OpaquePointer = UnsafePointer[NoneType]
An opaque pointer, equivalent to the C void*
type.
Structs
-
DLHandle
: Represents a dynamically linked library that can be loaded and unloaded. -
RTLD
: Enumeration of the RTLD flags used during dynamic library loading.
Functions
-
external_call
: Calls an external function.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!