pips_namespace_next_child()

Walk the children of a namespace

Synopsis:

#include <pips/publication.h>
pips_entity_t* pips_namespace_next_child(pips_namespace_t *const nmspace,
                                         pips_entity_t *const current_child)

Arguments:

nmspace
A pointer to the current namespace instance. This must be specified only when retrieving the first child of the namespace. In subsequent calls, this argument can be NULL.
current_child
A pointer to the child entity returned in the last call to this function. If this argument is NULL, then the first child of the namespace will be returned. Otherwise, the next sibling of this entity will be returned.

Library:

pips-client

Description:

This function returns the next unvisited child entity of the current namespace. This entity may be either a topic or a sub-namespace with its own list of children. Use this function to walk the tree of known topics and namespaces.

Returns:

On success, a pointer to the pips_entity_t instance that is the next child of the current namespace. On error, NULL (errno is set).

Errors:

  • EINVAL: Both the nmspace and current arguments are NULL.
  • ENOENT: The namespace has no children or the last child has been visited.