kw_has_word()

kw_has_word()#

Checks if a given word exists within the JSON object kw. The word can be found in a string, list, or dictionary. Supports recursive search and verbosity options.

Prototype

BOOL kw_has_word(
    hgobj    gobj,
    json_t  *kw,   // NOT owned
    const char *word,
    kw_flag_t kw_flag
);

Parameters

Key

Type

Description

gobj

hgobj

Handle to the calling object, used for logging errors.

kw

json_t *

JSON object to search within. Must be a dictionary, list, or string.

word

const char *

The word to search for within kw.

kw_flag

kw_flag_t

Flags controlling search behavior, such as KW_VERBOSE for logging and KW_REQUIRED for strict checking.


Return Value

Returns TRUE if the word is found in kw, otherwise returns FALSE.

Notes

The function supports searching within JSON strings, lists, and dictionaries. If kw_flag includes KW_VERBOSE, errors will be logged when kw is not a valid type.

Prototype

// Not applicable in JS

Prototype

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