language = "C"
header = """
/*
* readcon-core C API.
*
* Memory ownership
* - Opaque handles (RKRConFrame, RKRConFrameWriter, RKRConFrameBuilder,
* CConFrameIterator) are caller-owned. Free each with its dedicated
* destructor: free_rkr_frame, free_rkr_frame_writer,
* free_rkr_frame_builder, free_con_frame_iterator.
* - rkr_read_all_frames returns a heap-allocated array of RKRConFrame*
* handles together with the frame count via the *num_frames out-param.
* The array's capacity equals the count (shrunk to fit). Free with
* free_rkr_frame_array(frames, *num_frames). Each individual frame is
* released by free_rkr_frame_array; do NOT also call free_rkr_frame.
* - char* values returned by rkr_frame_metadata_json,
* rkr_frame_potential_type, and rkr_frame_get_header_line_cpp are heap
* allocated; free them with rkr_free_string. rkr_free_string is safe
* to call with NULL (no-op).
* - const char* returned by rkr_library_version is process-static; do
* NOT free it.
* - rkr_frame_to_c_frame returns a CFrame whose `atoms` array is owned
* by the caller; release with free_c_frame.
*
* Sentinel values for absent metadata
* - Floating-point getters (rkr_frame_energy, rkr_frame_time,
* rkr_frame_timestep, etc.) return NaN when the metadata key is
* absent. Test with isnan() from <math.h>.
* - Unsigned-integer getters (rkr_frame_frame_index, rkr_frame_neb_bead,
* rkr_frame_neb_band) return UINT64_MAX when absent.
* - String getters return NULL when absent.
*
* Thread safety
* - Opaque handles are NOT Sync. Do not share a single
* RKRConFrame/RKRConFrameWriter/RKRConFrameBuilder across threads
* without external synchronization. Distinct handles are independent.
* - rkr_read_all_frames internally uses sequential parsing; the
* `parallel` Cargo feature is exposed only through the Rust API and
* is not surfaced via this C header.
*/
/* Forward-declare the DLPack-managed tensor type for the tier-3
* builder export FFI. Consumers that want to dereference fields
* (data, shape, strides, dtype, deleter) must include
* <dlpack/dlpack.h> (or equivalent) themselves; the readcon-core C
* ABI only passes the pointer through. */
struct DLManagedTensorVersioned;
typedef struct DLManagedTensorVersioned RKRDLManagedTensorVersioned;
"""
include_guard = "READCON_H"
include_version = true
pragma_once = true
autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */"
namespace = "readcon"
no_includes = false
cpp_compat = true
line_length = 80
tab_width = 4
braces = "SameLine"
documentation = true
documentation_style = "Doxy"
documentation_length = "full"
line_endings = "LF"
[defines]
"feature = zstd" = "READCON_CORE_HAS_ZSTD"
[export]
exclude = ["FxHashMap"]