Repository navigation
Expand file tree
/
Copy pathcbindgen.toml
More file actions
64 lines (57 loc) · 1.48 KB
/
Copy pathcbindgen.toml
File metadata and controls
64 lines (57 loc) · 1.48 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
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
cpp_compat = true
documentation = true
documentation_style = "doxy"
include_guard = "CIMPL_VALUE_CONVERTER_H"
language = "C"
line_length = 100
tab_width = 4
header = """
/* Generated by cbindgen - DO NOT EDIT MANUALLY */
/**
* @file value_converter.h
* @brief Cimpl Reference Example - Value Converter
*
* A practical example showing real-world FFI patterns for type conversion.
*
* Unlike toy examples (add two integers), this demonstrates:
* - Multiple constructors (from_i32, from_string, from_hex, etc.)
* - Fallible conversions with proper error handling
* - Type validation (bytes might not be valid UTF-8 or numeric types)
* - Memory safety with tracked allocations
*
* @section memory Memory Management
*
* All pointers returned by this library must be freed with value_free().
* Passing NULL to value_free() is safe.
*
* @section errors Error Handling
*
* Functions return NULL/false on error.
* Check error details with value_last_error().
*/
"""
[export]
# Add prefix to all exported functions
prefix = "vc_"
# Generate opaque pointer declaration
item_types = [
"globals",
"enums",
"structs",
"unions",
"typedefs",
"opaque",
"functions",
"constants",
]
[export.rename]
"ValueConverter" = "ValueConverter"
[enum]
prefix_with_name = true
rename_variants = "ScreamingSnakeCase"
[fn]
rename_args = "CamelCase"
[parse]
include = ["cimpl"]
parse_deps = false