Repository navigation
Expand file tree
/
Copy pathcbindgen.toml
More file actions
68 lines (62 loc) · 2.34 KB
/
Copy pathcbindgen.toml
File metadata and controls
68 lines (62 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# cbindgen configuration for the pdf_oxide C ABI header.
#
# The committed header `include/pdf_oxide_c/pdf_oxide.h` had drifted
# badly (it was stamped "v0.3.24" and was missing every v0.3.50/v0.3.51
# C symbol — redaction, PAdES, crypto-governance, split-by-bookmarks,
# auto-extraction/classify — even though they exist in `src/ffi.rs`).
# There was no cbindgen config, no build.rs invocation and no CI drift
# guard, so a C/C++ consumer compiling against the shipped header could
# not call any new feature. Regenerate with:
#
# cbindgen --config cbindgen.toml --crate pdf_oxide \
# --output include/pdf_oxide_c/pdf_oxide.h
#
# (also wired into `make c-header` and checked for drift in CI).
language = "C"
header = """
/**
* pdf_oxide C API
*
* C-compatible Foreign Function Interface for pdf_oxide.
* Used by Go (CGO), Node.js (N-API), and C# (P/Invoke) bindings, and
* by direct C/C++ consumers.
*
* AUTO-GENERATED by cbindgen from `src/ffi.rs` — do not edit by hand.
* Regenerate: `make c-header` (or see cbindgen.toml). CI fails if this
* file is out of sync with `src/ffi.rs`.
*
* Error Convention:
* Most functions accept an `int* error_code` out-parameter.
* 0 = success, 1 = invalid arg, 2 = IO error, 3 = parse error,
* 4 = extraction failed, 5 = internal error, 6 = invalid page index,
* 7 = search error, 8 = unsupported feature.
*
* Memory Convention:
* - Strings returned as `char*` must be freed with `free_string()`.
* - Byte buffers returned as `uint8_t*` must be freed with `free_bytes()`.
* - Opaque handles must be freed with their corresponding `*_free()`.
*/
"""
include_guard = "PDF_OXIDE_H"
tab_width = 4
style = "type"
cpp_compat = true
documentation = true
documentation_style = "doxy"
[defines]
# wasm-only FFI items are not part of the native C ABI; guard them so
# they are compiled out for C/C++ consumers (also silences the cbindgen
# "Missing [defines] entry for target_arch = wasm32" warnings).
"target_arch = wasm32" = "PDF_OXIDE_TARGET_WASM32"
[parse]
parse_deps = false
[export]
# Emit feature-gated symbols (e.g. PAdES, gated on `signatures`)
# unconditionally: the shipped cdylib/staticlib is built with the
# extended feature set (see release.yml), so the C ABI surface is the
# full set. cbindgen does not evaluate #[cfg] by default.
prefix = ""
[fn]
sort_by = "None"
[enum]
prefix_with_name = true