Repository navigation
Expand file tree
/
Copy pathcbindgen.toml
More file actions
180 lines (158 loc) · 4.68 KB
/
Copy pathcbindgen.toml
File metadata and controls
180 lines (158 loc) · 4.68 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# cbindgen config for include/linkcell.h.
# Source of truth is src/capi.rs; this file only styles the generated header.
# Meson and CMake install the shipped include/linkcell.h and must not run
# cbindgen. Regenerate with: scripts/regen-capi-headers.sh
#
# Do not add [parse.expand] crates: that runs cargo expand (a compile).
# cbindgen parses src/ without building.
# Do not export lc_cell_ortho from Rust; it is a header-only inline in trailer.
# Do not set [layout] aligned_n: that annotation is unused and a numeric
# value is not a valid cbindgen layout config.
language = "C"
############## Options for Wrapping the Contents of the Header #################
header = """
/* Generated by cbindgen from src/capi.rs. Do not edit. */
/*
* linkcell C API.
*
* Memory ownership
* - lc_knearest writes into caller-owned out_nn (length n * k).
* - lc_knearest_d2 also writes out_d2 (length n * k, unused NaN).
* - lc_knearest_many is the frame-major batch (n_frames * n * k).
* - lc_pairs_within writes caller-owned i, j, shift, dist2 rows.
* Null outputs query the row count.
* - lc_last_error returns a thread-local pointer. Do not free. The
* pointer is invalid after the next lc_knearest on the same thread.
* lc_version does not read or write the slot.
* - lc_version returns a process-static pointer. Do not free.
*
* Thread safety
* - Distinct searches may run concurrently.
* - lc_last_error is a thread-local slot. Read it on the same thread
* that received a nonzero return from lc_knearest.
*/
"""
include_guard = "LINKCELL_H"
include_version = true
pragma_once = true
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
no_includes = false
cpp_compat = true
# lc_cell_ortho is header-only. Trailer sits after the include guard, so
# the inline carries its own guard and an extern "C" wrap.
trailer = """
#ifndef LINKCELL_LC_CELL_ORTHO_H
#define LINKCELL_LC_CELL_ORTHO_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* Orthorhombic cell with origin at zero.
*/
static inline lc_cell lc_cell_ortho(double lx, double ly, double lz) {
lc_cell c;
c.ax = lx;
c.ay = 0.0;
c.az = 0.0;
c.bx = 0.0;
c.by = ly;
c.bz = 0.0;
c.cx = 0.0;
c.cy = 0.0;
c.cz = lz;
c.ox = 0.0;
c.oy = 0.0;
c.oz = 0.0;
return c;
}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* LINKCELL_LC_CELL_ORTHO_H */
"""
############################ Code Style Options ################################
line_length = 80
tab_width = 4
braces = "SameLine"
documentation = true
documentation_style = "Doxy"
documentation_length = "full"
line_endings = "LF"
############################# Codegen Options ##################################
style = "both"
sort_by = "Name"
usize_is_size_t = true
# `feature = capi` is left unmapped on purpose: a [defines] entry wraps
# every lc_* declaration in `#if defined(...)`. The shipped header is
# the capi surface; consumers must not need a -D flag. cbindgen warns
# "Missing [defines] entry for feature = capi"; that warning is expected.
[export]
include = [
"lc_cell",
"lc_knearest",
"lc_knearest_d2",
"lc_knearest_many",
"lc_pairs_within",
"lc_last_error",
"lc_version",
]
# Vesin types and entry points are the hand-written include/linkcell_vesin.h.
# The OpenMP region is an internal schedule, not part of include/linkcell.h.
# cbindgen would otherwise append both sets to that header.
exclude = [
"lc_cell_ortho",
"Cell",
"Error",
"Neighbors",
"KHeap",
"lc_tune_set",
"lc_tune_pairs",
"VesinDevice",
"VesinNeighborList",
"VesinOptions",
"NeighborCalc",
"lc_vesin_neighbors",
"lc_vesin_free",
"Phase",
"lc_knn_one_region",
"lc_knn_shutdown",
"lc_knn_shutdown_impl",
"lc_omp_max_threads",
]
item_types = ["enums", "structs", "unions", "typedefs", "opaque", "functions", "constants"]
[export.rename]
[fn]
rename_args = "None"
args = "auto"
sort_by = "Name"
# No C++ operator helpers: those emit static_asserts that break C CI.
[struct]
rename_fields = "None"
derive_constructor = false
derive_eq = false
derive_neq = false
derive_lt = false
derive_lte = false
derive_gt = false
derive_gte = false
[enum]
rename_variants = "None"
add_sentinel = false
prefix_with_name = false
derive_helper_methods = false
derive_const_casts = false
derive_mut_casts = false
derive_tagged_enum_destructor = false
derive_tagged_enum_copy_constructor = false
[const]
allow_static_const = true
allow_constexpr = false
sort_by = "Name"
[macro_expansion]
bitflags = false
############## Options for How Your Rust library Should Be Parsed ##############
[parse]
parse_deps = false
exclude = []
clean = false
extra_bindings = []