Skip to main content

Deno Foreign Function Interface (WIP & Need Help)

ci tag license

Deno Foreign Function Interface.

Example

import * as ffi from "https://deno.land/x/ffi/mod.ts";

type Fn0 = ffi.CFunction<"int add(int, int)">; // { "add": { parameters: ["i32", "i32"]; result: "i32" } }
type Fn1 = ffi.CFunction<"long add(long)">; // { "abs": { parameters: ["i64"]; result: "i64" } }
type Fn2 = ffi.CFunction<"void hello(int)">; // { "hello": { parameters: ["i32"]; result: "void" } }
type Fn3 = ffi.CFunction<"void hello()">; // { "hello": { parameters: []; result: "void" } }
type Fn4 = ffi.CFunction<"void hello(void)">; // { "hello": { parameters: ["void"]; result: "void" } }

License

denoffi is released under the MIT License. See the bundled LICENSE file for details.