Пример #1
0
void
topo_file_unload(topo_hdl_t *thp, ttree_t *tp)
{
	topo_file_t *tfp = tp->tt_file;

	if (tfp == NULL)
		return;

	if (tfp->tf_fileinfo != NULL)
		tf_info_free(tfp->tf_mod, tfp->tf_fileinfo);

	topo_hdl_free(thp, tfp, sizeof (topo_file_t));
	tp->tt_file = NULL;
}
Пример #2
0
tf_info_t *
tf_info_new(topo_mod_t *mp, xmlDocPtr doc, xmlChar *scheme)
{
	tf_info_t *r;

	if ((r = topo_mod_zalloc(mp, sizeof (tf_info_t))) == NULL)
		return (NULL);
	r->tf_flags = TF_LIVE;
	if ((r->tf_scheme = topo_mod_strdup(mp, (char *)scheme)) == NULL) {
		tf_info_free(mp, r);
		return (NULL);
	}
	r->tf_xdoc = doc;
	return (r);
}