nqdchk(3)
NAME
nqdchk, nqdrepn,
nqdrepi, nqdrepj,
nqdrepfree — check a
capsule's data record against its files
LIBRARY
libnqd, -lnqd -lnoqtis
SYNOPSIS
#include
<nqd.h>
int
nqdchk(const
char *dir, nqdrep
**rep);
size_t
nqdrepn(const
nqdrep *r);
int
nqdrepi(const nqdrep *r,
size_t i, const char **check,
int *ok, const char
**detail);
const char *
nqdrepj(const
nqdrep *r, size_t
i);
void
nqdrepfree(nqdrep
*r);
DESCRIPTION
nqdchk()
reads noqtis.data.json in dir
(noqtis-data(5)) and
checks the folder against it, one report row per check:
- ‘
record’ - the record reads, is of the format and canonical (the detail says what is wrong when not)
- ‘
source’ - one per source: its file is there, with the recorded SHA-256 (compared in constant time) and size
- ‘
lock’ - one per lock file of
env: its file is there, with the recorded SHA-256 - ‘
schema, ‘’rule’ - one per schema: its file matches the columns, types, missing-value codes, ranges and sets; one per rule
- ‘
stats’ - one per summary: made again from its file, read as the element says
(
delim,header), else as the file's schema says, the summaries are the recorded ones byte for byte (a calibration,cal, aside); the detail names the first column that differs - ‘
step’ - one per step with both
scriptandsha256: the script or mapping is in the folder with that SHA-256 - ‘
chunk’ - per
chunkselement: its file, whole, has the recorded size and chunk digests (nqdpiece(3)) - ‘
recorded’ - one per recorded check: it fails when the check was recorded as
‘
fail’. Whenexpectedandobservedare both numbers it is recomputed: ‘|observed - expected| <= tol’ (tol0 when not given); when both are strings, they must be equal. A check recorded as ‘pass’ that does not hold fails; the detail gives the numbers
A row about a file marked synthetic says
‘[synthetic]’ after the path. It
checks nothing of the seal: check the capsule with
nqchk(3) too.
nqdrepn(),
nqdrepi()
and
nqdrepfree()
read and free the report as
nqrep(3) does a capsule's.
nqdrepj()
returns the numbers of row i as canonical JSON, for
rows that have them (those of
nqddrift(3)), or
NULL. The strings stay valid until the report is
freed.
RETURN VALUES
nqdchk() returns
NQOK when every row passed and
NQEVRFY when one failed (no record, or one that does
not read, is a failed ‘record’ row);
in both cases *rep is set.
NQEARG and NQEMEM return no
report. nqdrepi() returns
NQEARG for a row that is not there.