gridoxide 0.1.0

AC power flow and state estimation solver with a sparse Newton-Raphson core
Documentation
# 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.

language = "C"
header = """
/* 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.
 */"""
include_guard = "GRIDOXIDE_H"
cpp_compat = true
documentation = true
documentation_style = "doxy"
line_length = 88
tab_width = 4
usize_is_size_t = true

[parse]
parse_deps = false

[export]
# 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.
item_types = ["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.
[export.rename]
"Status" = "gridoxide_status"
"GridoxidePowerFlow" = "gridoxide_powerflow"
"GridoxideOptions" = "gridoxide_options"
"GridoxideBus" = "gridoxide_bus"
"GridoxideBusType" = "gridoxide_bus_type"
"GridoxideLine" = "gridoxide_line"
"GridoxideTransformer" = "gridoxide_transformer"
"GridoxideShunt" = "gridoxide_shunt"
"GridoxideComplex" = "gridoxide_complex"
"GridoxideBackend" = "gridoxide_backend"
"GridoxideIslandStatus" = "gridoxide_island_status"

[enum]
prefix_with_name = true
rename_variants = "ScreamingSnakeCase"

[fn]
sort_by = "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.