Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 97 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
[workspace]
members = ["icechunk", "icechunk-python", "icechunk-macros"]
members = ["icechunk", "icechunk-python", "icechunk-macros", "icechunk-c"]
default-members = ["icechunk"]
resolver = "2"

[workspace.package]
edition = "2024"

[workspace.lints.clippy]
expect_used = "warn"
unwrap_used = "warn"
Expand Down
24 changes: 24 additions & 0 deletions icechunk-c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "icechunk-c"
version = "0.1.0"
edition.workspace = true
publish = false

[lib]
crate-type = ["cdylib", "staticlib"]

[dependencies]
icechunk = { path = "../icechunk", version = "0.3.14" }
tokio = { version = "1", features = ["rt-multi-thread"] }
bytes = "1"
futures = "0.3"
libc = "0.2"

[build-dependencies]
cbindgen = "0.28"

[dev-dependencies]
tempfile = "3"

[lints]
workspace = true
19 changes: 19 additions & 0 deletions icechunk-c/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
fn main() {
let Ok(crate_dir) = std::env::var("CARGO_MANIFEST_DIR") else {
eprintln!("CARGO_MANIFEST_DIR not set");
return;
};
let config_path = std::path::Path::new(&crate_dir).join("cbindgen.toml");
let config = cbindgen::Config::from_file(&config_path).unwrap_or_default();

let output_path = std::path::Path::new(&crate_dir).join("include").join("icechunk.h");

match cbindgen::Builder::new().with_crate(&crate_dir).with_config(config).generate() {
Ok(bindings) => {
bindings.write_to_file(&output_path);
}
Err(e) => {
eprintln!("Unable to generate C bindings: {e}");
}
}
}
11 changes: 11 additions & 0 deletions icechunk-c/cbindgen.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language = "C"
header = "/* Generated by cbindgen — do not edit */"
include_guard = "ICECHUNK_H"
no_includes = true
sys_includes = ["stdint.h", "stddef.h", "stdbool.h"]

[export]
prefix = ""

[enum]
rename_variants = "ScreamingSnakeCase"
Loading
Loading