mdesc_init_intern.c revision 26cf27f05670b1ca90e4a07802cba858cb358690
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mdesc_impl.h>
md_t *
{
int idx;
int count;
int done;
/*
* Very basic checkup for alignment to avoid
* bus error issues.
*/
return (NULL);
return (NULL);
/*
* setup internal structures
*/
goto cleanup_nohash;
}
mdp->node_blk_size);
/*
* Should do a lot more sanity checking here.
*/
/*
* Should initialize a name hash here if we intend to use one
*/
/*
* Setup to find the root node
*/
if (root_name == MDE_INVAL_STR_COOKIE) {
goto cleanup;
}
/*
* One more property we need is the count of nodes in the
* DAG, not just the number of elements.
*
* We try and pickup the root node along the way here.
*/
case MDET_LIST_END:
done = 1;
break;
case MDET_NODE:
/* Gah .. more than one root */
goto cleanup;
}
}
count ++;
break;
default:
idx++; /* ignore */
}
}
/*
* Ensure there is a root node
*/
goto cleanup;
}
/*
* Register the counts
*/
/*
* Final sanity check that everything adds up
*/
goto cleanup;
cleanup:;
/*
* Clean up here - including a name hash if
* we build one.
*/
return (NULL);
}