Lines Matching +full:child +full:- +full:nodes

1 /* SPDX-License-Identifier: GPL-2.0 */
17 #define BOOTCONFIG_ALIGN_MASK (BOOTCONFIG_ALIGN - 1)
20 * xbc_calc_checksum() - Calculate checksum of bootconfig
33 while (size--) in xbc_calc_checksum()
42 u16 child; member
49 /* Maximum size of boot config is 32KB - 1 */
50 #define XBC_DATA_MAX (XBC_VALUE - 1)
65 * xbc_node_is_value() - Test the node is a value node
72 return node->data & XBC_VALUE; in xbc_node_is_value()
76 * xbc_node_is_key() - Test the node is a key node
87 * xbc_node_is_array() - Test the node is an arraied value node
94 return xbc_node_is_value(node) && node->child != 0; in xbc_node_is_array()
98 * xbc_node_is_leaf() - Test the node is a leaf key node
102 * or no child. Returns true if it is a leaf node, or false if not.
103 * Note that the leaf node can have subkey nodes in addition to the
109 (!node->child || xbc_node_is_value(xbc_node_get_child(node))); in xbc_node_is_leaf()
112 /* Tree-based key-value access APIs */
127 * xbc_find_value() - Find a value which matches the key
133 * Note that this can return 0-length string and store NULL in *@vnode for
134 * key-only (non-value) entry.
143 * xbc_find_node() - Find a node which matches the key
155 * xbc_node_get_subkey() - Return the first subkey node if exists
158 * Return the first subkey node of the @node. If the @node has no child
163 struct xbc_node *child = xbc_node_get_child(node); in xbc_node_get_subkey() local
165 if (child && xbc_node_is_value(child)) in xbc_node_get_subkey()
166 return xbc_node_get_next(child); in xbc_node_get_subkey()
168 return child; in xbc_node_get_subkey()
172 * xbc_array_for_each_value() - Iterate value nodes on an array
176 * Iterate array value nodes and values starts from @anode. This is expected to
186 * xbc_node_for_each_child() - Iterate child nodes
188 * @child: Iterated XBC node.
190 * Iterate child nodes of @parent. Each child nodes are stored to @child.
191 * The @child can be mixture of a value node and subkey nodes.
193 #define xbc_node_for_each_child(parent, child) \ argument
194 for (child = xbc_node_get_child(parent); child != NULL ; \
195 child = xbc_node_get_next(child))
198 * xbc_node_for_each_subkey() - Iterate child subkey nodes
200 * @child: Iterated XBC node.
202 * Iterate subkey nodes of @parent. Each child nodes are stored to @child.
203 * The @child is only the subkey node.
205 #define xbc_node_for_each_subkey(parent, child) \ argument
206 for (child = xbc_node_get_subkey(parent); child != NULL ; \
207 child = xbc_node_get_next(child))
210 * xbc_node_for_each_array_value() - Iterate array entries of geven key
221 * (key-only node), this does nothing. So don't use this for testing the
222 * key-value pair existence.
230 * xbc_node_for_each_key_value() - Iterate key-value pairs under a node
235 * Iterate key-value pairs under @node. Each key node and value string are
243 * xbc_for_each_key_value() - Iterate key-value pairs
247 * Iterate key-value pairs in whole XBC tree. Each key node and value string
258 * xbc_node_compose_key() - Compose full key string of the XBC node
263 * Compose the full-length key of the @node into @buf. Returns the total
264 * length of the key stored in @buf. Or returns -EINVAL if @node is NULL,
265 * and -ERANGE if the key depth is deeper than max depth.