trq_set_metadata()

trq_set_metadata()#

trq_set_metadata() sets a metadata key-value pair in the given JSON object.

Prototype

int trq_set_metadata(
    json_t  *kw,
    const char *key,
    json_t  *jn_value  // owned
);

Parameters

Key

Type

Description

kw

json_t *

The JSON object where the metadata will be stored.

key

const char *

The key under which the metadata value will be stored.

jn_value

json_t *

The JSON value to be stored as metadata. Ownership is transferred.


Return Value

Returns 0 on success, or a negative value on failure.

Notes

The caller must ensure that kw is a valid JSON object before calling trq_set_metadata().

Prototype

// Not applicable in JS

Prototype

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