[package]
name = "c2pa-c-ffi"

version.workspace = true

description = "C language FFI base for c2pa crate to create bindings"
edition = "2021"
authors = ["Gavin Peacock <gpeacock@adobe.com>", "Tania Mathern <mathern@adobe.com>"]
license = "MIT OR Apache-2.0"
documentation = "https://docs.rs/c2pa-c-ffi"
homepage = "https://contentauthenticity.org"
repository = "https://github.com/contentauth/c2pa-rs"
keywords = ["metadata", "ffi", "bindings"]
categories = ["api-bindings"]

[lib]
name = "c2pa_c"
crate-type = ["cdylib", "staticlib", "rlib"]

[features]
default = ["c2pa/openssl", "http", "add_thumbnails"]
file_io = ["c2pa/file_io"]
rust_native_crypto = ["c2pa/rust_native_crypto"]
# HTTP and thumbnails: not enabled by default because reqwest pulls in wasm-bindgen-futures
# (incompatible with -Z build-std=panic_abort on wasm32-unknown-emscripten).
# Enable for native builds when you need HTTP or thumbnails.
http = ["c2pa/http_reqwest", "c2pa/http_reqwest_blocking"]
add_thumbnails = ["c2pa/add_thumbnails"]

[dependencies]
c2pa = { workspace = true, features = [
    "fetch_remote_manifests",
    "file_io",
    "pdf",
] }
libc = "0.2"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2.0.18"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1.52", features = ["rt-multi-thread", "rt"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { version = "1.52", features = ["rt", "macros", "io-util", "time"] }

[dev-dependencies]
tempfile = "3.27.0"

[build-dependencies]
cbindgen = "0.29"
