mdesc_getproparcs.c revision 908f1e1388f616898b4e515d343c0414f2a6472e
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mdesc_impl.h>
mde_cookie_t *, size_t);
/*
* Return an array containing the node indexes for the arcs in
* the given node. The array is allocated using the allocator
* defined at machine description initialization time and the
* number of arcs found returned.
*
* Input Description
* ------------------- ----------------------------------------
* md_t * Pointer to md session
* mde_cookie_t Node containing arcs
* char * Arc name to count (e.g. "fwd" or "back")
* mde_cookie_t * Buffer to store indexes, or NULL
* size_t Size of buffer
*
* Output Description
* ------------------- ----------------------------------------
* int Count of arcs in node
*/
int
{
int result;
if (node == MDE_INVAL_ELEM_COOKIE) {
return (-1);
}
if (prop_name == MDE_INVAL_STR_COOKIE) {
return (-1);
}
arcsize);
return (result);
}
/*
* Find the number of arcs in the node of the requested prop_name. If storage
* is given in arcp, store the first arcsize number of node indexes.
*/
static int
{
int result;
int idx;
/* Get the private node information from session data */
/* Make sure the cookie is in fact a node */
return (-1);
}
/*
* Walk the elements in the node and find all the arcs of the
* requested type, and store them in an array.
*/
result = 0;
}
/* Increment the count of arcs found */
result++;
}
}
/* Return the total count of arcs in the node */
return (result);
}