bits2jn_strlist()
#
Converts a bitmask into a JSON list of corresponding string representations based on a provided lookup table.
Prototype
json_t *bits2jn_strlist(
const char **strings_table,
uint64_t bits
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
An array of string literals representing bit positions, terminated by a NULL pointer. |
|
|
A bitmask where each set bit corresponds to an index in |
Return Value
A JSON array containing the string representations of the set bits in bits
. The caller is responsible for managing the returned JSON object.
Notes
The function iterates through the strings_table
and checks each bit in bits
. If a bit is set, the corresponding string is added to the JSON array.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples