Skip to main content

seqc/
ffi.rs

1//! FFI (Foreign Function Interface) Support
2//!
3//! This module handles parsing of FFI manifests and generating the LLVM IR
4//! for calling external C functions from Seq code.
5//!
6//! FFI is purely a compiler/linker concern - the runtime remains free of
7//! external dependencies.
8//!
9//! # Usage
10//!
11//! ```seq
12//! include ffi:libedit
13//!
14//! : repl ( -- )
15//!   "prompt> " readline
16//!   dup string-empty not if
17//!     dup add-history
18//!     process-input
19//!     repl
20//!   else
21//!     drop
22//!   then
23//! ;
24//! ```
25
26mod bindings;
27mod manifest;
28
29#[cfg(test)]
30mod tests;
31
32pub use bindings::{FfiBindings, FfiFunctionInfo};
33pub use manifest::{
34    FfiArg, FfiFunction, FfiLibrary, FfiManifest, FfiReturn, FfiType, LIBEDIT_MANIFEST, Ownership,
35    PassMode, get_ffi_manifest, has_ffi_manifest, list_ffi_manifests,
36};