Set the value of the object with the value of the key.

Syntax

int json_object_set_new(
    json_t* object,
    const char* key,
    json_t* value
);

Parameters

object
[out] JSON object
key
[in] key
value
[in] JSON value

Return value

Returns 0 on success and -1 on error.

Remarks

Set the value of key to value in object. And, steals the reference to value. key must be a valid null terminated UTF-8 encoded Unicode string. If there already is a value for key, it is replaced by the new value. Returns 0 on success and -1 on error.

See the API Reference below for more information.

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