#ffi #libffi #closure #c

sys deno-libffi-sys

Raw Rust bindings for libffi

7 releases

0.0.7 Aug 9, 2021
0.0.6 Aug 9, 2021
0.0.3 Jul 18, 2021

#633 in Development tools

Download history 43/week @ 2022-06-06 17/week @ 2022-06-13 49/week @ 2022-06-20 28/week @ 2022-06-27 30/week @ 2022-07-04 38/week @ 2022-07-11 27/week @ 2022-07-18 36/week @ 2022-07-25 26/week @ 2022-08-01 49/week @ 2022-08-08 26/week @ 2022-08-15 45/week @ 2022-08-22 23/week @ 2022-08-29 50/week @ 2022-09-05 38/week @ 2022-09-12 28/week @ 2022-09-19

140 downloads per month
Used in 2 crates (via deno-libffi)

MIT/Apache

2MB
56K SLoC

C 33K SLoC // 0.2% comments GNU Style Assembly 14K SLoC // 0.2% comments Shell 8K SLoC // 0.2% comments Rust 798 SLoC // 0.0% comments Automake 248 SLoC // 0.1% comments Python 200 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

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, but you can see the libffi documentation.

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.1"

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

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

to your Cargo.toml instead.

This crate supports Rust version 1.32 and later.

Dependencies