Files
sakurac/core/ffi.sakura
T
2026-12-06 13:52:57 -06:00

20 lines
765 B
Plaintext

#! @file ffi.sakura
#! @author John Christman (sorakatadzuma@gmail.com)
#! @copyright Malunal Studios, LLC.
#! @license MIT
#!
#! Contains `cfn`, the address of a C function. C's functions, structs, and
#! unions are declared in an `extern module`, and `extern import` names the
#! library they are found in.
module core;
#! The address of a C function taking and giving what `F` does, as
#! `cfn<def(i32): void>`, which may be `null`. It is callable, and converts with
#! `as` to and from pointers, integers, and other addresses of C functions. A
#! function of the program given where one is expected is the address of an
#! entry C calls it back through.
#! @tparam F The function type the C function has, as `def(i32): void`.
@intrinsic
pub struct cfn<F> {}