minimage 0.1.2

Minimum-image convention for periodic parallelepiped cells
Documentation
# cbindgen config for include/minimage.h.
# Source of truth is src/capi.rs; this file only styles the generated header.
# Meson and CMake install the shipped include/minimage.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 mi_cell_ortho from Rust; it is a header-only inline in trailer.

language = "C"

############## Options for Wrapping the Contents of the Header #################

header = """
/* Generated by cbindgen from src/capi.rs. Do not edit. */

/*
 * minimage C API.
 *
 * Memory ownership
 *   - Constructor calls write one mi_cell into a caller-owned out.
 *   - mi_displacement / mi_displacement_euclidean / mi_wrap_many /
 *     mi_dist2 / mi_dist2_many / mi_dist2_pairs / mi_dist2_ortho_diffs
 *     write into caller-owned buffers.
 *   - mi_reduce_pairs writes kept (i, j) pairs into caller-owned out
 *     and the count into out_n.
 *   - mi_last_error returns a thread-local pointer. Do not free. The
 *     pointer is invalid after the next mi_* call on the same thread.
 *     mi_version does not read or write the slot.
 *   - mi_version returns a process-static pointer. Do not free.
 *
 * Thread safety
 *   - Distinct cells and distance calls may run concurrently.
 *   - mi_last_error is a thread-local slot. Read it on the same thread
 *     that received a nonzero return.
 */
"""
include_guard = "MINIMAGE_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
trailer = """
#ifndef MINIMAGE_MI_CELL_ORTHO_H
#define MINIMAGE_MI_CELL_ORTHO_H

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Orthorhombic cell with origin at zero.
 */
static inline mi_cell mi_cell_ortho(double lx, double ly, double lz) {
    mi_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  /* MINIMAGE_MI_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

[export]
include = [
    "mi_cell",
    "mi_cell_from_ase",
    "mi_cell_from_con",
    "mi_cell_from_con_box",
    "mi_cell_from_lammps",
    "mi_cell_from_lammps_bounds",
    "mi_cell_from_vectors",
    "mi_cell_from_vesin",
    "mi_displacement",
    "mi_displacement_euclidean",
    "mi_dist2",
    "mi_dist2_many",
    "mi_dist2_ortho_diffs",
    "mi_dist2_pairs",
    "mi_last_error",
    "mi_reduce_pairs",
    "mi_version",
    "mi_wrap_many",
]
exclude = ["mi_cell_ortho", "Cell", "Error"]
item_types = ["enums", "structs", "unions", "typedefs", "opaque", "functions", "constants"]

[export.rename]

[fn]
rename_args = "None"
args = "auto"
sort_by = "Name"

[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

[parse]
parse_deps = false
exclude = []
clean = false
extra_bindings = []