Skip to main content

Module ffi

Module ffi 

Source

Structs§

CAtom
CConFrameIterator
CFrame
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.
RKRConFrame
An opaque handle to a full, lossless Rust ConFrame object. The C/C++ side needs to treat this as a void pointer
RKRConFrameBuilder
An opaque handle to a Rust ConFrameBuilder object.
RKRConFrameWriter
An opaque handle to a Rust ConFrameWriter object. The C/C++ side needs to treat this as a void pointer

Functions§

con_frame_iterator_next
Reads the next frame from the iterator, returning an opaque handle. The caller OWNS the returned handle and must free it with free_rkr_frame.
create_writer_from_path_c
Creates a new frame writer for the specified file. The caller OWNS the returned pointer and MUST call free_rkr_writer.
create_writer_from_path_with_precision_c
Creates a new frame writer with custom floating-point precision. The caller OWNS the returned pointer and MUST call free_rkr_writer.
free_c_frame
Frees the memory of a CFrame struct, including its internal atoms array.
free_con_frame_iterator
Frees the memory for a CConFrameIterator.
free_rkr_frame
Frees the memory for an opaque RKRConFrame handle.
free_rkr_frame_array
Frees an array of frame handles returned by rkr_read_all_frames. Each frame is freed individually, then the array itself.
free_rkr_frame_builder
Frees a frame builder without building.
free_rkr_writer
Frees the memory for an RKRConFrameWriter, closing the associated file.
read_con_file_iterator
Creates a new iterator for a .con file. The caller OWNS the returned pointer and MUST call free_con_frame_iterator. Returns NULL if there are no more frames or on error.
rkr_frame_add_atom
Adds an atom (without velocity) to the frame builder. Returns 0 on success, -1 on error.
rkr_frame_add_atom_with_velocity
Adds an atom with velocity data to the frame builder. Returns 0 on success, -1 on error.
rkr_frame_builder_build
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.
rkr_frame_get_header_line
Copies a header string line into a user-provided buffer. This is a C style helper… where the user explicitly sets the buffer. Returns the number of bytes written (excluding null terminator), or -1 on error.
rkr_frame_get_header_line_cpp
Gets a header string line as a newly allocated, null-terminated C string.
rkr_frame_new
Creates a new frame builder with the given cell dimensions, angles, and header lines. The caller OWNS the returned pointer and MUST call free_rkr_frame_builder or rkr_frame_builder_build. Returns NULL on error.
rkr_frame_to_c_frame
Extracts the core atomic data into a transparent CFrame struct. The caller OWNS the returned pointer and MUST call free_c_frame on it.
rkr_free_string
Frees a C string that was allocated by Rust (e.g., from rkr_frame_get_header_line).
rkr_read_all_frames
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.
rkr_read_first_frame
Reads the first frame from a .con file using mmap. The caller OWNS the returned handle and MUST call free_rkr_frame. Returns NULL on error.
rkr_writer_extend
Writes multiple frames from an array of handles to the file managed by the writer.