FFI(3)

✨ NAME ✨

FFI β€” Foreign Function Interface

okay so bestie, you're reading FFI(3), and this is the manual page for the foreign function interface πŸ’– it's lowkey iconic, highkey useful, and we're gonna get you comfy with it.


πŸŽ€ LIBRARY πŸŽ€

  • libffi β€” the library itself, and you link against it with -lffi ✨

🌸 SYNOPSIS 🌸

#include <ffi.h>

ffi_status
ffi_prep_cif(ffi_cif *cif, ffi_abi abi, unsigned int nargs,
    ffi_type *rtype, ffi_type **atypes);

void
ffi_prep_cif_var(ffi_cif *cif, ffi_abi abi, unsigned int nfixedargs,
    unsigned int ntotalargs, ffi_type *rtype, ffi_type **atypes);

void
ffi_call(ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue);

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, the foreign function interface provides a mechanism by which a function can generate a call to another function at runtime β€” and it does not require knowledge of the called function's interface at compile time. it's giving "call it later, figure it out live," and it ate πŸ’…

literally the whole point is runtime flexibility, no cap.


πŸ’œ SEE ALSO πŸ’œ


πŸ’– that's the whole page, bestie β€” FFI(3), dated February 15, 2008. mwah πŸ’‹

πŸ“¦ where this page comes from