kwid_match_id()
#
Checks if the given id
exists within the JSON structure ids
, which can be a string, list, or dictionary. The function returns TRUE
if the id
is found, otherwise FALSE
.
Prototype
BOOL kwid_match_id(
hgobj gobj,
json_t *ids,
const char *id
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A handle to the GObj instance, used for logging errors. |
|
|
A JSON object, array, or string containing the possible matches for |
|
|
The identifier to search for within |
Return Value
Returns TRUE
if id
is found in ids
, otherwise returns FALSE
.
Notes
The function supports different JSON structures:
If
ids
is a string, it is directly compared toid
.If
ids
is an array, it checks forid
in string elements or in objects with anid
field.If
ids
is a dictionary, it checks ifid
exists as a key.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples