gobj_write_new_json_attr()
#
Writes a new JSON value to the specified attribute of a hgobj
. The provided JSON value is owned and will not be incremented in reference count.
Prototype
int gobj_write_new_json_attr(
hgobj gobj,
const char *name,
json_t *jn_value
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The |
|
|
The name of the attribute to be updated. |
|
|
The new JSON value to be assigned to the attribute. This value is owned and will not be incremented in reference count. |
Return Value
Returns 0 on success, or -1 if the attribute is not found.
Notes
This function does not increment the reference count of jn_value
. Ensure that jn_value
is not used elsewhere after calling gobj_write_new_json_attr()
.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples