strings2bits()

strings2bits()#

Convert a JSON array of strings to a bitmask based on a predefined mapping. Works with json_t *.

Prototype

PUBLIC uint64_t strings2bits(
    json_t      *jn_strlist,
    const char *bit_names[]
);
        

Parameters

Key

Type

Description

jn_strlist

json_t *

The JSON array of strings to convert.

bit_names

const char *[]

The array of strings corresponding to bit positions.


Return Value

Returns a uint64_t bitmask representing the active bits from the JSON array.

Prototype

// Not applicable in JS

Prototype

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