dart-bindgen 0.1.8

A tool for generating Dart FFI bindings to C Header file.
Documentation

Goals

  1. be able to generate a single ffi.dart file that should contain all the C header bindings.
  2. Current Supported C Features
  • Functions
  • Function Pointer (aka Callbacks)
  • Simple Structs (NOTE: Nested structs is not supported yet, open a PR?)
  • C Enums

Non-Goals

Writing a High-Level Abstractions and idiomatic Dart Code for the FFI bindgens, we will leave that as a homework for the user :).

Install

Make sure you have installed the dependencies:

  1. LLVM and clang

on macOS:

brew install llvm

on Windows:

Download a prebuild from here

on Linux:

you know what to do ;)


and then you could install the CLI from github releases or you could also use cargo to build it from source:

$ cargo install --force dart-bindgen --features cli

Safety

This crate uses #![deny(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

Contributing

Want to join us? Check out our "Contributing" guide and take a look at some of these issues:

License