dag_component_get_subcomponent_count(3)

NAME
dag_component_get_subcomponent_count retrieves the number of subcomponents of a given component.

SYNOPSIS
#include "dag_config.h "

int
dag_component_get_subcomponent_count(dag_component_t component);

DESCRIPTION
dag_component_get_subcomponent_count retrieves a the number of subcomponents of a given component.B y convention all major functional components descends from the root component.However it is possible that a functional component to have its own subcomponents.

RETURN VALUE
A count of the number of subcomponents.

EXAMPLES
The following program illustrates how the function is used. It prints the number of subcomponents of the root component.. For the sake of clarity the error-handling code has been omitted from this example. int main(int argc, const char* argv[]) {

   dag_card_ref_t card_ref = NULL;
   dag_component_t root_component = NULL;
   uint32_t count;
   uint32_t i;

   /* Get a reference to the card. */
   card_ref = dag_config_init("/dev/dag0");
   /* Get a reference to the root component. */
   root_component = dag_config_get_root_component(card_ref);
   /* Find out how many ports the card has. */
   count = dag_component_get_subcomponent_count(root_component);
   printf("Number of sub-components for root components is %d",count);
   /* Dispose of the card. */
   dag_config_dispose(card_ref);
   return EXIT_SUCCESS; }

SEE ALSO
dag_config_get_root_component(3),dag_config_init(3),dag_component_get_subcomponent(3),dag_component_get_subcomponent_count_of_type(3)

BUGS
Report bugs to <support@endace.com>.

LAST UPDATED
$Author: $
$Revision: -1 $
$Date: $

COPYRIGHT
(c) 2009 Endace Technology Ltd, Hamilton, New Zealand. All Rights Reserved.