Lines Matching full:node
39 /* XBC tree node */
56 /* Node tree access raw APIs */
58 int __init xbc_node_index(struct xbc_node *node);
59 struct xbc_node * __init xbc_node_get_parent(struct xbc_node *node);
60 struct xbc_node * __init xbc_node_get_child(struct xbc_node *node);
61 struct xbc_node * __init xbc_node_get_next(struct xbc_node *node);
62 const char * __init xbc_node_get_data(struct xbc_node *node);
65 * xbc_node_is_value() - Test the node is a value node
66 * @node: An XBC node.
68 * Test the @node is a value node and return true if a value node, false if not.
70 static inline __init bool xbc_node_is_value(struct xbc_node *node) in xbc_node_is_value() argument
72 return node->data & XBC_VALUE; in xbc_node_is_value()
76 * xbc_node_is_key() - Test the node is a key node
77 * @node: An XBC node.
79 * Test the @node is a key node and return true if a key node, false if not.
81 static inline __init bool xbc_node_is_key(struct xbc_node *node) in xbc_node_is_key() argument
83 return !xbc_node_is_value(node); in xbc_node_is_key()
87 * xbc_node_is_array() - Test the node is an arraied value node
88 * @node: An XBC node.
90 * Test the @node is an arraied value node.
92 static inline __init bool xbc_node_is_array(struct xbc_node *node) in xbc_node_is_array() argument
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
99 * @node: An XBC node.
101 * Test the @node is a leaf key node which is a key node and has a value 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
104 * value node.
106 static inline __init bool xbc_node_is_leaf(struct xbc_node *node) in xbc_node_is_leaf() argument
108 return xbc_node_is_key(node) && in xbc_node_is_leaf()
109 (!node->child || xbc_node_is_value(xbc_node_get_child(node))); in xbc_node_is_leaf()
129 * @vnode: A container pointer of XBC value node.
132 * the value if found. Found value node is stored in *@vnode.
143 * xbc_find_node() - Find a node which matches the key
146 * Search a (key) node whose key matches @key from whole of XBC tree and
147 * return the node if found. If not found, returns NULL.
155 * xbc_node_get_subkey() - Return the first subkey node if exists
156 * @node: Parent node
158 * Return the first subkey node of the @node. If the @node has no child
159 * or only value node, this will return NULL.
161 static inline struct xbc_node * __init xbc_node_get_subkey(struct xbc_node *node) in xbc_node_get_subkey() argument
163 struct xbc_node *child = xbc_node_get_child(node); in xbc_node_get_subkey()
173 * @anode: An XBC arraied value node
178 * process each array entry node.
187 * @parent: An XBC node.
188 * @child: Iterated XBC node.
191 * The @child can be mixture of a value node and subkey nodes.
199 * @parent: An XBC node.
200 * @child: Iterated XBC node.
203 * The @child is only the subkey node.
211 * @node: An XBC node.
212 * @key: A key string searched under @node
213 * @anode: Iterated XBC node of array entry.
216 * Iterate array entries of given @key under @node. Each array entry node
217 * is stored to @anode and @value. If the @node doesn't have @key node,
219 * Note that even if the found key node has only one value (not array)
220 * this executes block once. However, if the found key node has no value
221 * (key-only node), this does nothing. So don't use this for testing the
224 #define xbc_node_for_each_array_value(node, key, anode, value) \ argument
225 for (value = xbc_node_find_value(node, key, &anode); value != NULL; \
230 * xbc_node_for_each_key_value() - Iterate key-value pairs under a node
231 * @node: An XBC node.
232 * @knode: Iterated key node
235 * Iterate key-value pairs under @node. Each key node and value string are
238 #define xbc_node_for_each_key_value(node, knode, value) \ argument
239 for (knode = NULL, value = xbc_node_find_next_key_value(node, &knode);\
240 knode != NULL; value = xbc_node_find_next_key_value(node, &knode))
244 * @knode: Iterated key node
247 * Iterate key-value pairs in whole XBC tree. Each key node and value string
255 struct xbc_node *node, char *buf, size_t size);
258 * xbc_node_compose_key() - Compose full key string of the XBC node
259 * @node: An 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,
267 static inline int __init xbc_node_compose_key(struct xbc_node *node, in xbc_node_compose_key() argument
270 return xbc_node_compose_key_after(NULL, node, buf, size); in xbc_node_compose_key()
273 /* XBC node initializer */