Function
judo_scan
Incrementally scan JSON.
Parameters π
stream | inout | Scanner state. |
source | in | JSON source text. |
length | in | Number of code units in |
Return Value π
JUDO_SUCCESS | If |
JUDO_BAD_SYNTAX | If |
JUDO_ILLEGAL_BYTE_SEQUENCE | If |
JUDO_INVALID_OPERATION | If |
JUDO_MAXIMUM_NESTING | If |
JUDO_MALFUNCTION | If there is a defect in the implementation. |
Discussion π
The judo_scan function reads string
as JSON and populates stream
with the current semantic element. The number of code units in string
is specified by length
, which, if negative, indicates that string
is null-terminated.
The caller must zero initialize stream
before the first call to this function. The implementation will update stream
as string
is scanned. The caller must never modify stream
otherwise the behavior is undefined.
The caller may copy stream
with memcpy
to preserve its state.