Lines Matching refs:root

65 	hp_node_t	root = NULL;
94 rv = i_hp_parse_results(results, &root, NULL);
101 if (root)
102 hp_fini(root);
108 if (root == NULL) {
115 return (root);
124 hp_fini(hp_node_t root)
130 i_hp_dprintf("hp_fini: root=%p\n", (void *)root);
132 if (root == NULL) {
138 if (root->hp_basepath) {
139 basepath = root->hp_basepath;
140 for (node = root; node != NULL; node = node->hp_sibling)
146 node = root;
168 hp_traverse(hp_node_t root, void *arg, int (*hp_callback)(hp_node_t, void *arg))
173 i_hp_dprintf("hp_traverse: root=%p, arg=%p, hp_callback=%p\n",
174 (void *)root, arg, (void *)hp_callback);
177 if ((root == NULL) || (hp_callback == NULL)) {
183 for (node = root; node; node = node->hp_sibling) {
442 hp_node_t root;
465 /* Trace back to the root node, accumulating components */
472 root = parent;
476 if (root->hp_basepath == NULL) {
482 * Construct the path. Start with the base path from the root
485 if (strcmp(root->hp_basepath, "/") != 0) {
486 (void) strlcat(path, root->hp_basepath, MAXPATHLEN);
487 if ((root->hp_type == HP_NODE_DEVICE) &&
509 hp_node_t root = NULL;
573 rv = i_hp_parse_results(results, &root, NULL);
575 *resultsp = root;
705 * Given the root of a hotplug information snapshot, pack
710 hp_pack(hp_node_t root, char **bufp, size_t *lenp)
718 i_hp_dprintf("hp_pack: root=%p, bufp=%p, lenp=%p\n", (void *)root,
721 if ((root == NULL) || (bufp == NULL) || (lenp == NULL)) {
735 if (root->hp_basepath != NULL) {
736 rv = nvlist_add_string(nvl, HP_INFO_BASE, root->hp_basepath);
743 for (node = root; node != NULL; node = node->hp_sibling) {
775 hp_node_t root;
818 rv = i_hp_unpack_branch(buf, len, NULL, &root);
823 prev_root->hp_sibling = root;
825 root_list = root;
827 prev_root = root;
841 /* Store the base path in each root node */
843 for (root = root_list; root; root = root->hp_sibling)
844 root->hp_basepath = basepath;
877 i_hp_pack_branch(hp_node_t root, char **bufp, size_t *lenp)
892 /* Pack the root of the branch and add it to the nvlist */
893 if ((rv = i_hp_pack_node(root, &buf, &len)) == 0) {
904 for (child = root->hp_child; child != NULL; child = child->hp_sibling) {
1013 * always the root node. And zero or more subordinate
1023 /* Check that there is only one root node */