Expand description
C ABI for readcon-db (always linked into cdylib/staticlib).
Status codes mirror a small subset of readcon-core style (negative = error).
Constants§
Functions§
- rkrdb_
append_ ⚠trajectory - rkrdb_
close ⚠ - rkrdb_
cook_ ⚠frame - Opt-in cook: derive RCSO into
frames_soafrom CON text inframes(CON remains authority). - rkrdb_
delete_ ⚠cooked - Drop cooked tier only; CON text and indexes unchanged.
- rkrdb_
frame_ ⚠formula - Canonical composition formula for a stored frame (same as core
index_proj). Writes intobuf(NUL-terminated). Returns RKRDB_OK, RKRDB_NOT_FOUND, RKRDB_ERR, or buffer size need as positive? On success returns RKRDB_OK; if buflen too small returns RKRDB_ERR and sets last_error. - rkrdb_
frame_ ⚠hash - Hash frame blob at key; writes 16 LE bytes to out_hash16.
- rkrdb_
get_ ⚠forces - Prefer cooked forces when present; writes N×3 doubles. Sets *out_has_forces 0/1.
- rkrdb_
get_ ⚠frame_ text - Copy frame CON text into buf (NUL-terminated). Returns length excluding NUL, or error code.
- rkrdb_
get_ ⚠positions - Prefer cooked positions (no CON parse on hit); else parse CON.
Writes
*out_natoms * 3doubles intoout_xyz(row-major N×3).capacity_atomsis max N. - rkrdb_
has_ ⚠valid_ cooked - Returns 1 if valid RCSO present, 0 if missing/corrupt, negative on error.
- rkrdb_
last_ ⚠error - Last error message (thread-safe snapshot into caller buffer). Returns bytes written excluding NUL, or -1 if truncated / null.
- rkrdb_
open ⚠ - Open corpus directory. On success writes opaque handle id to
out_id(>=0). Returns RKRDB_OK or error code. - rkrdb_
recook_ ⚠all - Cook every frame that has CON text (
recook_all). - rkrdb_
reindex ⚠ - Rebuild secondary indexes from authoritative frame blobs.
- rkrdb_
result_ ⚠count - rkrdb_
result_ ⚠key - Write traj_id and frame_idx for result index
i(0-based). - rkrdb_
select_ ⚠basic - Select by required symbol (optional) and natoms range (use 0, UINT32_MAX for any). Results stored internally; use rkrdb_result_count / rkrdb_result_key.
- rkrdb_
select_ ⚠campaign - Campaign select: composition formula (NUL-terminated, may be null), optional fmax window.
use_fmax_rangenon-zero applies fmax_min/max. Flags: bit0 forces, bit1 velocities, bit2 energy. Element constraints: passelem_sym+elem_count+elem_exact(1=exact, 0=min) for one pair (null skips). - rkrdb_
select_ ⚠hash - Select by exact xxHash3-128 (16 bytes LE).
- rkrdb_
select_ ⚠meta - Metadata / section filters. Pass
use_energy_range=0to ignore energy bounds. Flags: bit0=require_forces, bit1=require_velocities, bit2=require_energy. - rkrdb_
xxh3_ ⚠128 - xxHash3-128 of arbitrary bytes (LE 16 bytes) — for clients hashing off-line blobs.