31 releases (5 stable)

1.1.3 Sep 10, 2021
1.1.1 May 6, 2021
1.1.0 Nov 11, 2020
0.9.1 Dec 29, 2019
0.4.4 Jun 21, 2016

#28 in FFI

Download history 309/week @ 2021-06-07 392/week @ 2021-06-14 366/week @ 2021-06-21 286/week @ 2021-06-28 603/week @ 2021-07-05 269/week @ 2021-07-12 269/week @ 2021-07-19 624/week @ 2021-07-26 462/week @ 2021-08-02 537/week @ 2021-08-09 498/week @ 2021-08-16 1017/week @ 2021-08-23 600/week @ 2021-08-30 651/week @ 2021-09-06 1013/week @ 2021-09-13 720/week @ 2021-09-20

2,073 downloads per month
Used in 7 crates (3 directly)

MIT/Apache

2MB
46K SLoC

C 31K SLoC // 0.2% comments GNU Style Assembly 13K SLoC // 0.2% comments Rust 817 SLoC // 0.1% comments Shell 440 SLoC // 0.2% comments Automake 252 SLoC // 0.1% comments Perl 171 SLoC // 0.4% comments Python 157 SLoC C++ 128 SLoC // 0.1% comments Visual Studio Project 126 SLoC // 0.0% comments Visual Studio Solution 33 SLoC

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

GitHub Workflow Status 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 = "1.1.3"

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

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

to your Cargo.toml instead.

This crate supports Rust version 1.32 and later.

Dependencies