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 |
|---|---|---|
|
|
The JSON object where the metadata will be stored. |
|
|
The key under which the metadata value will be stored. |
|
|
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