Iterate over all key / value pairs and returns a value.

Syntax

void json_object_foreach_safe(
    json_t* object,
    void* tmp,
    const char* key,
    json_t* value
);

Parameters

object
[in] JSON object
tmp
[in] Pointer used for temporary storage
key
[out] key
value
[out] JSON value pointer

Return value

None.

Remarks

Examine every key / value pair in the object, set the appropriate values for const char* and json_t pointer variables key and value, respectively, and execute the subsequent block of code each time. It's also safe to call json_object_del (object, key) or json_object_deln (object, key, key_len) during the iteration. You need to pass an extra void* parameter tmp that is used for temporary storage.

Requirements

Header file:
lib.h : System E6.0 or later.
jansson.h
jansson_config.h
jansson_log.h
Library file:
libJansson.a
libSTARTUPOPH5000.a : System E6.0 or later.

See also

Last updated: 2022/01/26