gobj_write_user_data()

gobj_write_user_data()#

Stores a JSON value in the user data dictionary of the given hgobj instance under the specified key.

Prototype

int gobj_write_user_data(
    hgobj gobj,
    const char *name,
    json_t *value // owned
);

Parameters

Key

Type

Description

gobj

hgobj

The GObj instance where the user data will be stored.

name

const char *

The key under which the JSON value will be stored.

value

json_t *

The JSON value to store. The function takes ownership of this value.


Return Value

Returns 0 on success, or -1 if an error occurs.

Notes

If name is empty, the entire user data dictionary is replaced with value.

Prototype

// Not applicable in JS

Prototype

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