kw_delete_subkey()

kw_delete_subkey()#

Deletes a sub-key from a JSON dictionary located at the specified path. If the sub-key does not exist, an error is logged.

Prototype

int kw_delete_subkey(
    hgobj    gobj,
    json_t  *kw,
    const char *path,
    const char *key
);

Parameters

Key

Type

Description

gobj

hgobj

The handler object used for logging errors.

kw

json_t *

The JSON dictionary from which the sub-key will be deleted.

path

const char *

The path to the dictionary containing the sub-key.

key

const char *

The sub-key to be deleted.


Return Value

Returns 0 on success, or -1 if the sub-key or dictionary is not found.

Notes

If the dictionary at the specified path does not exist, an error is logged. If the sub-key does not exist, an error is also logged.

Prototype

// Not applicable in JS

Prototype

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