kw_get_list_value()
#
Retrieves the JSON value at the specified index from the JSON list kw
. If the index is out of bounds and KW_REQUIRED
is set, an error is logged. If KW_EXTRACT
is set, the value is removed from the list.
Prototype
json_t *kw_get_list_value(
hgobj gobj,
json_t *kw,
int idx,
kw_flag_t flag
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
Pointer to the gobj context, used for logging errors. |
|
|
A JSON list from which the value is retrieved. |
|
|
The index of the value to retrieve. |
|
|
Flags controlling behavior, such as |
Return Value
Returns the JSON value at the specified index. If KW_EXTRACT
is set, the value is removed from the list. Returns NULL
if the index is out of bounds or kw
is not a list.
Notes
If kw
is not a JSON array, an error is logged. If KW_REQUIRED
is set and the index is out of bounds, 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