-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcbindgen.toml
62 lines (58 loc) · 2.12 KB
/
cbindgen.toml
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
language = "C++"
include_guard = "AVIF_H"
tab_width = 4
usize_is_size_t = true
namespace = "crabbyavif"
# Some workarounds for cbindgen's potential limitations/bugs:
# 1) In C++ mode, cbindgen balks on use of "Box" objects without this. This
# workaround of aliasing Box to T* comes from
# https://github.com/mozilla/cbindgen/blob/f1d5801d3b299fa2e87d176f03b605532f931cb6/tests/rust/box.toml.
# 2) In C++ mode, cbindgen does not use the struct prefix for structs. We need
# this so that we can have circular struct dependencies that use a pointer.
# So forward declare those structs which have a circular dependency.
after_includes = """
template <typename T>
using Box = T*;
namespace crabbyavif {
struct avifImage;
struct avifIO;
}
"""
[export.rename]
"ChromaDownsampling" = "avifChromaDownsampling"
"ChromaSamplePosition" = "avifChromaSamplePosition"
"ChromaUpsampling" = "avifChromaUpsampling"
"ColorPrimaries" = "avifColorPrimaries"
"Format" = "avifRGBFormat"
"IOStats" = "avifIOStats"
"ImageTiming" = "avifImageTiming"
"MatrixCoefficients" = "avifMatrixCoefficients"
"PixelFormat" = "avifPixelFormat"
"ProgressiveState" = "avifProgressiveState"
"Source" = "avifDecoderSource"
"YuvRange" = "avifRange"
"TransferCharacteristics" = "avifTransferCharacteristics"
"AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE" = "CRABBY_AVIF_DIAGNOSTICS_ERROR_BUFFER_SIZE"
"AVIF_FALSE" = "CRABBY_AVIF_FALSE"
"AVIF_PLANE_COUNT_YUV" = "CRABBY_AVIF_PLANE_COUNT_YUV"
"AVIF_REPETITION_COUNT_INFINITE" = "CRABBY_AVIF_REPETITION_COUNT_INFINITE"
"AVIF_REPETITION_COUNT_UNKNOWN" = "CRABBY_AVIF_REPETITION_COUNT_UNKNOWN"
"AVIF_TRUE" = "CRABBY_AVIF_TRUE"
"DEFAULT_IMAGE_COUNT_LIMIT" = "CRABBY_AVIF_DEFAULT_IMAGE_COUNT_LIMIT"
"DEFAULT_IMAGE_DIMENSION_LIMIT" = "CRABBY_AVIF_DEFAULT_IMAGE_DIMENSION_LIMIT"
"DEFAULT_IMAGE_SIZE_LIMIT" = "CRABBY_AVIF_DEFAULT_IMAGE_SIZE_LIMIT"
"MAX_AV1_LAYER_COUNT" = "CRABBY_AVIF_MAX_AV1_LAYER_COUNT"
[enum]
rename_variants = "QualifiedScreamingSnakeCase"
enum_class = false
[export]
include = [
"avifChannelIndex",
"avifCodecFlag",
"avifCodecFlags",
"avifHeaderFormat",
"avifPlanesFlag",
"avifPlanesFlags",
"avifStrictFlag",
]
exclude = ["Box"]