Lines Matching defs:tp

70 set_create_error(topo_hdl_t *thp, ttree_t *tp, int err)
72 if (tp != NULL)
73 topo_tree_destroy(tp);
84 ttree_t *tp;
87 if ((tp = topo_mod_zalloc(mod, sizeof (ttree_t))) == NULL)
90 tp->tt_mod = mod;
92 if ((tp->tt_scheme = topo_mod_strdup(mod, scheme)) == NULL)
93 return (set_create_error(thp, tp, ETOPO_NOMEM));
98 if ((tp->tt_walk = topo_mod_zalloc(mod, sizeof (topo_walk_t))) == NULL)
99 return (set_create_error(thp, tp, ETOPO_NOMEM));
105 return (set_create_error(thp, tp, 0)); /* th_errno set */
108 rp->tn_name = tp->tt_scheme;
115 tp->tt_walk->tw_root = rp;
116 tp->tt_walk->tw_thp = thp;
120 tp->tt_root = rp;
122 return (tp);
126 topo_tree_destroy(ttree_t *tp)
130 if (tp == NULL)
133 mod = tp->tt_mod;
134 if (tp->tt_walk != NULL)
135 topo_mod_free(mod, tp->tt_walk, sizeof (topo_walk_t));
137 if (tp->tt_root != NULL) {
138 assert(tp->tt_root->tn_refs == 1);
139 topo_node_rele(tp->tt_root);
146 if (tp->tt_scheme != NULL)
147 topo_mod_strfree(mod, tp->tt_scheme);
149 topo_mod_free(mod, tp, sizeof (ttree_t));
153 topo_tree_enum(topo_hdl_t *thp, ttree_t *tp)
162 __func__, tp->tt_scheme,
169 rv = topo_file_load(tp->tt_root->tn_enum, tp->tt_root,
170 NULL, tp->tt_scheme, B_FALSE);
188 if (topo_file_load(tp->tt_root->tn_enum, tp->tt_root,
189 pp, tp->tt_scheme, B_FALSE) < 0) {
194 if (topo_file_load(tp->tt_root->tn_enum, tp->tt_root,
195 pp, tp->tt_scheme, B_FALSE) < 0) {
196 if (topo_file_load(tp->tt_root->tn_enum,
197 tp->tt_root, thp->th_machine,
198 tp->tt_scheme, B_FALSE) < 0) {
200 tp->tt_root->tn_enum, tp->tt_root,
201 NULL, tp->tt_scheme, B_FALSE);
210 tp->tt_scheme, topo_mod_errmsg(tp->tt_root->tn_enum));
212 topo_mod_errno(tp->tt_root->tn_enum)));
222 ttree_t *tp;
224 for (tp = topo_list_next(&thp->th_trees); tp != NULL;
225 tp = topo_list_next(tp)) {
226 if (topo_tree_enum(thp, tp) < 0) {