gobj_write_attrs()

gobj_write_attrs()#

Writes multiple attributes of a hgobj object based on the provided JSON dictionary, applying the specified flag filter.

Prototype

int gobj_write_attrs(
    hgobj gobj,
    json_t *kw,  // owned
    sdata_flag_t flag,
    hgobj src
);

Parameters

Key

Type

Description

gobj

hgobj

The target hgobj object whose attributes will be modified.

kw

json_t *

A JSON dictionary containing attribute names and their new values. The ownership of this object is transferred to the function.

flag

sdata_flag_t

A flag specifying which attributes should be updated. Only attributes matching this flag will be modified.

src

hgobj

The source hgobj object initiating the attribute modification.


Return Value

Returns 0 on success, or a negative value if an error occurs.

Notes

This function ensures that only attributes matching the specified flag are updated. The kw parameter is decremented after processing.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples