linkcell 0.3.7

Periodic linked-cell cutoff pairs and k-nearest neighbour search
Documentation
# 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",
]
exclude = ["lc_cell_ortho", "Cell", "Error", "Neighbors", "KHeap"]
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 = []