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_
append_ ⚠trajectory_ frame - Ingest one parsed
RKRConFrame*from libreadcon_core. Caller keeps the handle. - rkrdb_
append_ ⚠trajectory_ str - Ingest CON text.
sourcemay be NULL ("memory"). - rkrdb_
append_ ⚠trajectory_ units units_jsonis optional JSON ({"length":"A","energy":"ev"}). NULL stamps nothing.- 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_
extend_ ⚠trajectory - rkrdb_
extend_ ⚠trajectory_ units - Create the trajectory or append frames after the live count.
units_jsonis optional; NULL stamps nothing on the new frames. - 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_
frame_ ⚠units - Write the frame
unitsobject as JSON intobuf(NUL-terminated). - rkrdb_
get_ ⚠forces - Prefer cooked forces when present; writes N×3 doubles. Sets *out_has_forces 0/1.
- rkrdb_
get_ ⚠frame - Parse stored CON text into a readcon-core
RKRConFrame. Caller frees withfree_rkr_framefrom libreadcon_core. NULL on error. - 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_
get_ ⚠velocities - rkrdb_
h5md_ ⚠edges - rkrdb_
h5md_ ⚠forces - rkrdb_
h5md_ ⚠positions - Row-major
[T][N][3]dest-Å positions fromcollect_h5md. - rkrdb_
h5md_ ⚠shape nframesandnatomsfor one trajectory’s H5MD arrays.- rkrdb_
h5md_ ⚠species - Integer Z, length
N(collect_h5mdspecies_z). - rkrdb_
h5md_ ⚠times - Dest-
pstimes fromcollect_h5md(CON time ori * timestep, else index). - rkrdb_
h5md_ ⚠velocities - 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_
open_ ⚠readonly - Open an existing corpus
MDB_RDONLY. No mkdir, no write txn. - rkrdb_
pack_ ⚠frame - Pack one frame as RCSO bytes for
MPI_Bcaston the caller communicator.buf == NULLreturns the required size. Rank 0 of that comm calls this; other ranks never open the env. - rkrdb_
pack_ ⚠frames - Pack many frames as one RCSB envelope.
buf == NULLreturns the required size. Rank 0 of the caller comm packs; others never open the env. - 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_
set_ ⚠units - Convert stored numbers and rewrite CON
unitsfor every frame oftraj_id. - rkrdb_
unpack_ ⚠batch_ item - Unpack one RCSO item from an RCSB envelope into xyz. No corpus handle.
- rkrdb_
unpack_ ⚠batch_ nframes - Number of RCSO blobs in an RCSB envelope. No corpus handle.
- rkrdb_
unpack_ ⚠positions - Unpack RCSO positions (no corpus handle — MPI worker side).
- rkrdb_
xxh3_ ⚠128 - xxHash3-128 of arbitrary bytes (LE 16 bytes) — for clients hashing off-line blobs.