json_decoder_set_status()

Set the error status of the JSON decoder

Synopsis:

#include <sys/json.h>
void json_decoder_set_status(json_decoder_t *decoder,
                             json_decoder_error_t status);

Arguments:

decoder
The JSON decoder instance.
status
The new decoder error status (see json_decoder_error_t).

Library:

libjson

Description:

This function allows a caller to reset the given decoder's status to JSON_DECODER_OK, so the success of subsequent operations can be determined, or to set the status so it's not detectable directly by the decoder (e.g., an out-of-memory or range error), so the caller can subsequently handle it. Setting the status of a decoder instance has no effect on the behavior of the decoder.