7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER START
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * The contents of this file are subject to the terms of the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Common Development and Distribution License (the "License").
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You may not use this file except in compliance with the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * See the License for the specific language governing permissions
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * and limitations under the License.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * When distributing Covered Code, include this CDDL HEADER in each
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * If applicable, add the following below this CDDL HEADER, with the
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * fields enclosed by brackets "[]" replaced with your own identifying
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * information: Portions Copyright [yyyy] [name of copyright owner]
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * CDDL HEADER END
4557a2a1868181b517f5dfe61ba6eeba58edf4c0robj * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * Use is subject to license terms.
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi#pragma ident "%Z%%M% %I% %E% SMI"
7aec1d6e253b21f9e9b7ef68b4d81ab9859b51fecindi * This file hides the details of any file manipulation to
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi * establish topology for a given enumerator.
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi topo_mod_free(tfp->tf_mod, tfp, sizeof (topo_file_t));
0eb822a1c0c2bea495647510b75f77f0e57633ebcinditopo_file_load(topo_mod_t *mod, tnode_t *node, const char *name,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((tfp = topo_mod_zalloc(mod, sizeof (topo_file_t))) == NULL)
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void) snprintf(fp, MAXNAMELEN, TOPO_DEFAULT_FILE, name,
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi (void) snprintf(fp, MAXNAMELEN, TOPO_COMMON_FILE, scheme);
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((tfp->tf_filenm = topo_search_path(mod, mod->tm_rootdir, fp))
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi if ((tfp->tf_tmap = topo_xml_read(mod, tfp->tf_filenm, scheme))
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "failed to load topology file %s: "
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "%s\n", tfp->tf_filenm, topo_strerror(ETOPO_MOD_XRD));
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi "Failed to enumerate topology: %s\n",
0eb822a1c0c2bea495647510b75f77f0e57633ebcindi return (0);