gobj_write_attr()
#
The gobj_write_attr
function writes a new value to a specified attribute of a given hgobj
.
Prototype
int gobj_write_attr(
hgobj gobj,
const char *path,
json_t *value,
hgobj src
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The target |
|
|
The attribute path to be modified. If it contains ‘ |
|
|
The new value to be assigned to the attribute. This parameter is owned and will be decremented. |
|
|
The source |
Return Value
Returns 0 on success, or -1 if the attribute is not found or an error occurs.
Notes
If the attribute does not exist, an error is logged. The function ensures that the provided value is decremented after use.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples