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
idsis a string, it is directly compared toid.If
idsis an array, it checks foridin string elements or in objects with anidfield.If
idsis a dictionary, it checks ifidexists as a key.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples