mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
In general, it maps: * Traits to a struct with a void* and a list of function pointers, emulating what the compiler will do for a dyn trait anyway, * Structs as a struct with a single opaque pointer to the underlying type and a flag to indicate ownership. While this is a bit less effecient than just a direct pointer, it neatly lets us expose in the public interface the concept of ownership by setting a flag in the generated struct. * Unit enums as enums with each type copied over and conversion functions, * Non-unit enums have each field converted back and forth with a type flag and a union across all the C-mapped fields.
12 lines
272 B
TOML
12 lines
272 B
TOML
[package]
|
|
name = "c-bindings-gen"
|
|
version = "0.0.1"
|
|
authors = ["Matt Corallo"]
|
|
edition = "2018"
|
|
|
|
[dependencies]
|
|
syn = { version = "1", features = ["full", "extra-traits"] }
|
|
proc-macro2 = "1"
|
|
|
|
# We're not in the workspace as we're just a binary code generator:
|
|
[workspace]
|