circu.js
    Preparing search index...

    Namespace CModuleFFI

    FFI (Foreign Function Interface) module - Call C functions from JavaScript

    const ffi = import.meta.use('ffi');

    // Load libc and call printf
    const libc = new ffi.UvLib(ffi.LIBC_NAME);
    const printf = libc.symbol('printf');

    const cif = new ffi.FfiCif(ffi.type_void, [ffi.type_pointer]);
    const msg = ffi.getCString(ffi.getArrayBufPtr(new TextEncoder().encode('Hello!\0')));
    cif.call(printf, msg);

    Classes

    FfiCif
    FfiClosure
    FfiType
    UvDlSym
    UvLib

    Variables

    LIBC_NAME
    LIBM_NAME
    type_double
    type_float
    type_longdouble
    type_pointer
    type_schar
    type_sint
    type_sint16
    type_sint32
    type_sint64
    type_sint8
    type_size
    type_sll
    type_slong
    type_sshort
    type_ssize
    type_uchar
    type_uint
    type_uint16
    type_uint32
    type_uint64
    type_uint8
    type_ull
    type_ulong
    type_ushort
    type_void

    Functions

    derefPtr
    errno
    getArrayBufPtr
    getCString
    ptrToBuffer
    strerror