Lines Matching full:node

19 /* XBC tree node */
36 /* Node tree access raw APIs */
38 int __init xbc_node_index(struct xbc_node *node);
39 struct xbc_node * __init xbc_node_get_parent(struct xbc_node *node);
40 struct xbc_node * __init xbc_node_get_child(struct xbc_node *node);
41 struct xbc_node * __init xbc_node_get_next(struct xbc_node *node);
42 const char * __init xbc_node_get_data(struct xbc_node *node);
45 * xbc_node_is_value() - Test the node is a value node
46 * @node: An XBC node.
48 * Test the @node is a value node and return true if a value node, false if not.
50 static inline __init bool xbc_node_is_value(struct xbc_node *node) in xbc_node_is_value() argument
52 return node->data & XBC_VALUE; in xbc_node_is_value()
56 * xbc_node_is_key() - Test the node is a key node
57 * @node: An XBC node.
59 * Test the @node is a key node and return true if a key node, false if not.
61 static inline __init bool xbc_node_is_key(struct xbc_node *node) in xbc_node_is_key() argument
63 return !xbc_node_is_value(node); in xbc_node_is_key()
67 * xbc_node_is_array() - Test the node is an arraied value node
68 * @node: An XBC node.
70 * Test the @node is an arraied value node.
72 static inline __init bool xbc_node_is_array(struct xbc_node *node) in xbc_node_is_array() argument
74 return xbc_node_is_value(node) && node->next != 0; in xbc_node_is_array()
78 * xbc_node_is_leaf() - Test the node is a leaf key node
79 * @node: An XBC node.
81 * Test the @node is a leaf key node which is a key node and has a value node
82 * or no child. Returns true if it is a leaf node, or false if not.
84 static inline __init bool xbc_node_is_leaf(struct xbc_node *node) in xbc_node_is_leaf() argument
86 return xbc_node_is_key(node) && in xbc_node_is_leaf()
87 (!node->child || xbc_node_is_value(xbc_node_get_child(node))); in xbc_node_is_leaf()
107 * @vnode: A container pointer of XBC value node.
110 * the value if found. Found value node is stored in *@vnode.
121 * xbc_find_node() - Find a node which matches the key
124 * Search a (key) node whose key matches @key from whole of XBC tree and
125 * return the node if found. If not found, returns NULL.
134 * @anode: An XBC arraied value node
139 * process each array entry node.
148 * @parent: An XBC node.
149 * @child: Iterated XBC node.
159 * @node: An XBC node.
160 * @key: A key string searched under @node
161 * @anode: Iterated XBC node of array entry.
164 * Iterate array entries of given @key under @node. Each array entry node
165 * is stroed to @anode and @value. If the @node doesn't have @key node,
167 * Note that even if the found key node has only one value (not array)
168 * this executes block once. Hoever, if the found key node has no value
169 * (key-only node), this does nothing. So don't use this for testing the
172 #define xbc_node_for_each_array_value(node, key, anode, value) \ argument
173 for (value = xbc_node_find_value(node, key, &anode); value != NULL; \
178 * xbc_node_for_each_key_value() - Iterate key-value pairs under a node
179 * @node: An XBC node.
180 * @knode: Iterated key node
183 * Iterate key-value pairs under @node. Each key node and value string are
186 #define xbc_node_for_each_key_value(node, knode, value) \ argument
187 for (knode = NULL, value = xbc_node_find_next_key_value(node, &knode);\
188 knode != NULL; value = xbc_node_find_next_key_value(node, &knode))
192 * @knode: Iterated key node
195 * Iterate key-value pairs in whole XBC tree. Each key node and value string
203 struct xbc_node *node, char *buf, size_t size);
206 * xbc_node_compose_key() - Compose full key string of the XBC node
207 * @node: An XBC node.
211 * Compose the full-length key of the @node into @buf. Returns the total
212 * length of the key stored in @buf. Or returns -EINVAL if @node is NULL,
215 static inline int __init xbc_node_compose_key(struct xbc_node *node, in xbc_node_compose_key() argument
218 return xbc_node_compose_key_after(NULL, node, buf, size); in xbc_node_compose_key()
221 /* XBC node initializer */