kw_decref()

kw_decref()#

kw_decref() decrements the reference count of a JSON object and its associated binary fields, freeing memory if necessary.

Prototype

json_t *kw_decref(
    json_t *kw
);

Parameters

Key

Type

Description

kw

json_t *

The JSON object whose reference count will be decremented.


Return Value

Returns NULL if the operation is successful or if kw is already NULL. If an error occurs, logs an error message and returns NULL.

Notes

If kw is NULL, the function returns immediately. If the reference count of kw is already zero or negative, an error is logged. If kw contains binary fields, their reference counts are also decremented using the appropriate function. Uses JSON_DECREF to safely decrement the reference count of kw.

Prototype

// Not applicable in JS

Prototype

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