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
# cbindgen configuration for the `capi` feature — see build.rs's `capi` module
# and docs/src/getting_started/c_api.md.
#
# The output is committed as include/gridoxide.h so a C++ project consuming a
# prebuilt library needs no Rust toolchain to get a header.
= "C"
= """
/* gridoxide — a C ABI for the gridoxide power-systems library.
*
* GENERATED BY cbindgen FROM src/capi/. DO NOT EDIT BY HAND.
* Regenerate with: cargo build --features capi
*
* A C++ convenience wrapper over this header lives beside it in
* gridoxide.hpp — RAII handles, std::vector results and exceptions.
*
* THREADING: a gridoxide_powerflow_t is single-thread-affine. Separate
* handles on separate threads are fine; one handle touched from two threads
* is not.
*/"""
= "GRIDOXIDE_H"
= true
= true
= "doxy"
= 88
= 4
= true
[]
= false
[]
# No `prefix`: the Rust types are already named `Gridoxide*`, and the renames
# below give them C-style names. A prefix on top produced
# `GridoxideGridoxideBus`.
#
# No `constants` in `item_types` either. cbindgen would otherwise export every
# `pub const` in the crate — `WYE`, `ZERO_IMPEDANCE_THRESHOLD`,
# `RANK_TOLERANCE` and friends, none of which is part of this ABI. The one
# constant that *is* (`GRIDOXIDE_ABI_VERSION`) is injected by build.rs from the
# Rust value, so the two cannot drift.
= ["enums", "structs", "opaque", "functions"]
# No `_t` suffix, for two reasons. cbindgen builds an enum's variant prefix
# from its exported name, so `gridoxide_status_t` would yield
# `GRIDOXIDE_STATUS_T_OK`; without it the variants read `GRIDOXIDE_STATUS_OK`.
# And POSIX reserves the `_t` suffix for its own type names, so avoiding it is
# the more correct choice regardless.
[]
= "gridoxide_status"
= "gridoxide_powerflow"
= "gridoxide_options"
= "gridoxide_bus"
= "gridoxide_bus_type"
= "gridoxide_line"
= "gridoxide_transformer"
= "gridoxide_shunt"
= "gridoxide_complex"
= "gridoxide_backend"
= "gridoxide_island_status"
[]
= true
= "ScreamingSnakeCase"
[]
= "None"
# Deliberately no `[defines]`. Mapping `feature = capi` to a C macro made
# cbindgen wrap every declaration in `#if defined(GRIDOXIDE_CAPI)` — which is
# exactly wrong here, because this header only ever ships beside a library that
# *was* built with the feature. The guard made every symbol invisible unless
# the consumer happened to define a macro they had no reason to know about.