Crates.io | ergo-lib-c |
lib.rs | ergo-lib-c |
version | 0.28.0 |
source | src |
created_at | 2020-10-06 13:16:46.10446 |
updated_at | 2024-08-09 15:05:11.019967 |
description | C bindings for ergo-lib |
homepage | |
repository | https://github.com/ergoplatform/sigma-rust |
max_upload_size | |
id | 296621 |
size | 127,543 |
A thin wrapper for core Rust part of C bindings Does not use Rust types in the API and is suitable for C FFI.
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
.