37 releases (breaking)

0.28.0 Aug 9, 2024
0.27.1 Dec 2, 2023
0.26.0 Oct 13, 2023
0.24.0 May 12, 2023
0.4.1 Nov 19, 2020

#170 in #part

Download history 26/week @ 2024-07-25 8/week @ 2024-08-01 101/week @ 2024-08-08 6/week @ 2024-08-15 10/week @ 2024-09-12 36/week @ 2024-09-19 20/week @ 2024-09-26 1/week @ 2024-10-03

67 downloads per month

CC0 license

300KB
7K SLoC

C bindings for ergo-lib

A thin wrapper for core Rust part of C bindings Does not use Rust types in the API and is suitable for C FFI.

Build instructions

The following command builds the project with REST API features:

cargo build -p ergo-lib-c --features rest

To build without REST simply omit --features rest.

The C header file is generated with cbindgen. Run the following command:

cbindgen --config cbindgen.toml --crate ergo-lib-c --output h/ergo_lib.h

Note that we require a nightly version of rustc just for this command. This is because we use macros to generate some C-types and cbindgen cannot directly generate types through them. However cbindgen gives us the option to expand macros, which can only be done through a nightly version of rustc. The crate itself can always be compiled by a stable version of rustc.


lib.rs:

C bindings for ergo-lib

Dependencies

~18–31MB
~498K SLoC