Module ffi

Module ffi 

Source
Expand description

FFI (Foreign Function Interface) Support

This module handles parsing of FFI manifests and generating the LLVM IR for calling external C functions from Seq code.

FFI is purely a compiler/linker concern - the runtime remains free of external dependencies.

§Usage

include ffi:libedit

: repl ( -- )
  "prompt> " readline
  dup string-empty not if
    dup add-history
    process-input
    repl
  else
    drop
  then
;

Structs§

FfiArg
An argument to an FFI function
FfiBindings
Resolved FFI bindings ready for code generation
FfiFunction
A function binding in an FFI manifest
FfiFunctionInfo
Information about an FFI function for code generation
FfiLibrary
A library binding in an FFI manifest
FfiManifest
Top-level FFI manifest structure
FfiReturn
Return value specification

Enums§

FfiType
FFI type mapping for C interop
Ownership
Memory ownership annotation for return values
PassMode
Argument passing mode

Constants§

LIBEDIT_MANIFEST
Embedded libedit FFI manifest (BSD-licensed)

Functions§

get_ffi_manifest
Get an embedded FFI manifest by name
has_ffi_manifest
Check if an FFI manifest exists
list_ffi_manifests
List all available embedded FFI manifests