A transparent, “lossy” C-struct containing only the core atomic data.
This can be extracted from an RKRConFrame handle for direct data access.
The caller is responsible for freeing the atoms array using free_c_frame.
Element type request — layout-identical to DLPack DLDataType
(uint8_t code, uint8_t bits, uint16_t lanes). Interchangeable with
DLDataType from <dlpack/dlpack.h> when that header is included.
Re-export of dlpk’s DLManagedTensorVersioned for the C ABI surface.
Defined here so cbindgen emits a forward declaration without pulling
in the full dlpk header; consumers include <dlpack/dlpack.h> (or
equivalent) and cast through the standard DLPack ABI.
A versioned and managed C Tensor object, manage memory of DLTensor.
Creates a new iterator for a .con / .convel path, including transparent
gzip (.con.gz) and zstd (.con.zst, requires zstd feature) inputs via
crate::compression::read_file_contents.
Deprecated: prefer rkr_frame_add_atom_full with NULL velocity
and force pointers. Adds an atom (no velocity, no forces) to the
builder using a single uniform fixed flag.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Deprecated: prefer rkr_frame_add_atom_full. Adds an atom (no
velocity, no forces) using per-axis fixed flags.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Deprecated: prefer rkr_frame_add_atom_full. Adds an atom with
a force vector and a single uniform fixed flag.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Deprecated: prefer rkr_frame_add_atom_full. Adds an atom with
a force vector and per-axis fixed flags.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Deprecated: prefer rkr_frame_add_atom_full. Adds an atom with
a velocity vector and a single uniform fixed flag.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Deprecated: prefer rkr_frame_add_atom_full. Adds an atom with
both velocity and force vectors and a single uniform fixed flag.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Deprecated: prefer rkr_frame_add_atom_full. Adds an atom with
both velocity and force vectors and per-axis fixed flags.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Deprecated: prefer rkr_frame_add_atom_full. Adds an atom with
a velocity vector and per-axis fixed flags.
Returns RKR_STATUS_SUCCESS on success, or an error code.
Returns the position of an atom inside the frame’s atom_data array
matching the given atom_id. Returns UINT64_MAX if no atom with
that id exists or frame_handle is NULL.
Consumes the builder and returns a finalized RKRConFrame handle.
The builder handle is invalidated after this call.
The caller OWNS the returned frame and MUST call free_rkr_frame.
Returns NULL on error.
Cheap, copy-on-write clone of a frame builder. Returned handle owns
a new ConFrameBuilder whose per-atom buffers share storage with
the source via ArcArray; any subsequent mutation triggers a
per-buffer copy-on-write so writes do not leak across clones.
Reads the per-atom energy of an atom (if any). *has_value is set to
true if the atom carries an energy contribution, else false and
*out_value is left untouched.
Reads the velocity / force vector of an atom (if any) into 3 contiguous
f64. *has_value is set to true if the atom carries that vector,
false if it does not (in which case out_xyz is left untouched).
Borrow the positions buffer as a raw (N, 3) f64 row-major pointer.
Returns NULL on invalid handle. Pointer is valid until the builder
is dropped or add_atom reallocates.
Updates the atom_id (pre-grouping index from .con column 5) of an
existing atom. The underlying Array1<u64> buffer pointer stays
stable; callers that hold a raw *const u64 via
rkr_frame_builder_atom_ids_data do not need to refresh after this.
Returns the JSON metadata line from a parsed frame as a heap-allocated
null-terminated C string. The caller MUST free with rkr_free_string.
Returns NULL on error.
Metatensor-style: export positions as they are stored (CPU f64), with
explicit device request. Non-CPU → FEATURE_DISABLED. Prefer this over
dtype-cast *_dlpack_ex for new code.
Returns the potential type string from metadata as a heap-allocated
null-terminated C string. The caller MUST free with rkr_free_string.
Returns NULL if absent or on error.
Frees a C string that was allocated by Rust (e.g., from
rkr_frame_metadata_json, rkr_frame_potential_type, or
rkr_frame_get_header_line_cpp). Safe to call with NULL (no-op).
Reads all frames from a .con file using mmap.
Returns an array of frame handles and sets num_frames to the count.
The caller OWNS both the array and each frame handle.
Free frames with free_rkr_frame and the array with free_rkr_frame_array.
Returns NULL on error.
Read the first frame from a chemfiles-supported path (XYZ, PDB, GRO, …).
Returns NULL on error or without the chemfiles feature. Caller: free_rkr_frame.
Read all frames from memory with chemfiles format (e.g. "XYZ").
Sets *num_frames. Free frames with free_rkr_frame and the array with
free_rkr_frame_array. NULL on error / without chemfiles.
Reads the first frame from a .con file.
Uses read_to_string for small files (< 64 KiB) and mmap for larger ones.
Stops after the first frame rather than parsing the entire file.
The caller OWNS the returned handle and MUST call free_rkr_frame.
Returns NULL on error.
Returns the atomic number for a chemical symbol, or 0 if the symbol
is unknown or symbol is NULL. Lookup covers H..U (Z = 1..=92) and
is case-sensitive: “Fe” works, “fe” does not.
Enable (canonical != 0) or disable campaign-stable CON serialization on an open writer.
Matches Rust ConFrameWriter::canonical(true) (deterministic metadata key order).
Returns a pointer to a static, NUL-terminated chemical symbol for an
atomic number, or “X” for unknown values. Coverage is H..U
(Z = 1..=92). The returned pointer is valid for the lifetime of the
process; do NOT free it.