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_RESULT_SUCCESS | If |
| JUDO_RESULT_BAD_SYNTAX | If |
| JUDO_RESULT_ILLEGAL_BYTE_SEQUENCE | If |
| JUDO_RESULT_INVALID_OPERATION | If |
| JUDO_RESULT_MAXIMUM_NESTING | If |
| JUDO_RESULT_MALFUNCTION | If there is a defect in the implementation. |
Discussion π
The judo_scan function reads source as JSON and populates stream with the current token. The number of code units in source is specified by length, which, if negative, indicates that source is null-terminated.
The caller must zero-initialize stream before the first call to this function. The implementation will update stream as source is scanned. The caller must never modify stream otherwise the behavior is undefined.
The caller may copy stream with memcpy to preserve its state.