41 releases (15 stable)

2.3.0 Apr 26, 2023
2.2.0 Mar 28, 2023
2.0.1 Oct 20, 2022
2.0.0 Mar 7, 2022
0.4.4 Jun 21, 2016

#128 in FFI

Download history 8840/week @ 2024-07-22 8518/week @ 2024-07-29 8822/week @ 2024-08-05 7987/week @ 2024-08-12 8197/week @ 2024-08-19 8288/week @ 2024-08-26 8095/week @ 2024-09-02 8458/week @ 2024-09-09 8385/week @ 2024-09-16 8929/week @ 2024-09-23 7654/week @ 2024-09-30 8820/week @ 2024-10-07 8468/week @ 2024-10-14 8582/week @ 2024-10-21 9182/week @ 2024-10-28 7260/week @ 2024-11-04

34,493 downloads per month
Used in 58 crates (5 directly)

MIT/Apache

3MB
69K SLoC

C 35K SLoC // 0.2% comments GNU Style Assembly 14K SLoC // 0.2% comments M4 9K SLoC // 0.2% comments Shell 9K SLoC // 0.2% comments Rust 1K SLoC // 0.1% comments Bitbake 436 SLoC // 0.1% comments Automake 258 SLoC // 0.1% comments Python 247 SLoC Perl 171 SLoC // 0.4% comments C++ 128 SLoC // 0.1% comments Visual Studio Project 126 SLoC // 0.0% comments Visual Studio Solution 33 SLoC

Contains (autotools obfuscated code, 715KB) libffi/configure, (obscure autoconf code, 15KB) libffi/configure.ac

libffi-sys-rs: Low-level Rust bindings for libffi

GitHub Workflow Status Documentation Crates.io License: MIT License: Apache 2.0

The C libffi library provides two main facilities: assembling calls to functions dynamically, and creating closures that can be called as ordinary C functions. This is an undocumented wrapper, generated by bindgen, intended as the basis for higher-level bindings.

If you clone this repository in order to build the library and you do not plan to enable the system Cargo feature to build against your system’s C libffi, then you should do a recursive clone, by default this library builds C libffi from a Git submodule.

See the libffi crate for a higher-level API.

Usage

libffi-sys can either build its own copy of the libffi C library from github or it can link against your system’s C libffi. By default it builds its own because many systems ship with an old C libffi; this requires that you have a working make, C compiler, automake, and autoconf first. If your system libffi is new enough (v3.2.1 as of October 2019), you can instead enable the system feature flag to use that. If you want this crate to build a C libffi for you, add

[dependencies]
libffi-sys = "2.3.0"

to your Cargo.toml. If you want to use your system C libffi, then

[dependencies.libffi-sys]
version = "2.3.0"
features = ["system"]

to your Cargo.toml instead.

This crate supports Rust version 1.32 and later.

Dependencies