pdftract/crates/pdftract-libpdftract/cbindgen.toml
jedarden 71872aaf73 feat(pdftract-1eaxm): implement libpdftract C FFI library
Implement the libpdftract native FFI library as a cdylib + staticlib
with cbindgen-generated headers and full extern "C" API.

Components:
- crates/pdftract-libpdftract/ with cdylib + staticlib targets
- All 9 contract methods + utility functions as extern "C"
- cbindgen config and generated pdftract.h header
- pkg-config template (pdftract.pc.in)
- Homebrew formula template (distribution/homebrew/)
- vcpkg port template (distribution/vcpkg/)
- C conformance test (tests/conformance.c)

API features:
- Owned JSON strings returned via CString::into_raw()
- Caller frees with pdftract_free() (not libc free())
- Thread-local error storage (pdftract_last_error)
- Thread-safe and reentrant (no global mutable state)
- ABI version function for compatibility checking

Verification:
- cargo build produces libpdftract.so and libpdftract.a
- Conformance test compiles and runs successfully
- Thread safety verified with 4 concurrent threads

References:
- Plan line 3477: SDK Architecture / The Ten SDKs
- Bead: pdftract-1eaxm

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 08:55:12 -04:00

32 lines
695 B
TOML

language = "C"
header = "/* Copyright 2026 Jed Cabanino. MIT OR Apache-2.0 */"
include_guard = "PDFTRACT_H"
no_includes = false
pragma_once = true
cpp_compat = true
documentation = true
style = "both"
[export]
prefix = "pdftract_"
include = [
"pdftract_extract",
"pdftract_extract_text",
"pdftract_extract_markdown",
"pdftract_extract_stream_open",
"pdftract_stream_next",
"pdftract_stream_close",
"pdftract_search",
"pdftract_get_metadata",
"pdftract_hash",
"pdftract_classify",
"pdftract_free",
"pdftract_version",
"pdftract_last_error",
"pdftract_abi_version",
"pdftract_verify_receipt",
]
[fn]
args = "Vertical"
sort_by = "Name"