Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ping_iterator_get(3) [debian man page]

ping_iterator_get(3)						     liboping						      ping_iterator_get(3)

NAME
ping_iterator_get, ping_iterator_next - Iterate over all hosts of a liboping object SYNOPSIS
#include <oping.h> pingobj_iter_t *ping_iterator_get (pingobj_t *obj); pingobj_iter_t *ping_iterator_next (pingobj_iter_t *iter) DESCRIPTION
These two functions can be used to iterate over all hosts associated with a liboping object. You can use these methods as follows: pingobj_iter_t *iter; for (iter = ping_iterator_get (obj); iter != NULL; iter = ping_iterator_next (iter)) { ...; } To get usable information from an iterator object (which is also an opaque data type, just like the liboping object itself) use ping_iterator_get_info(3) and ping_iterator_get_context(3). RETURN VALUE
The ping_iterator_get returns an iterator for obj or NULL if no host is associated with obj. The ping_iterator_next returns an iterator for the host following iter or NULL if the last host has been reached. SEE ALSO
ping_host_add(3), ping_iterator_get_info(3), ping_iterator_get_context(3), liboping(3) AUTHOR
liboping is written by Florian "octo" Forster <octo at verplant.org>. Its homepage can be found at <http://verplant.org/liboping/>. Copyright (c) 2005-2011 by Florian "octo" Forster. 1.6.2 2012-01-31 ping_iterator_get(3)

Check Out this Related Man Page

ping_iterator_get_context(3)					     liboping					      ping_iterator_get_context(3)

NAME
ping_iterator_get_context, ping_iterator_set_context - Store host-dependent data SYNOPSIS
#include <oping.h> void *ping_iterator_get_context (pingobj_iter_t *iter); void ping_iterator_set_context (pingobj_iter_t *iter, void *context); DESCRIPTION
ping_iterator_set_context can be used to store host-specific data within the liboping structures. This data can be received again by calling ping_iterator_get_context. The data itself is never touched by liboping. If you call ping_host_remove (see ping_host_add(3)) or ping_destroy (see ping_construct(3)) and the context is not NULL liboping will assume you know what you're doing and simply ignore the fact this might be a memory leak. The iter argument is an iterator object as returned by ping_iterator_get(3) and ping_iterator_next. The context argument of ping_iterator_set_context is a pointer to anything and may be NULL. RETURN VALUE
ping_iterator_get_context returns the same pointer previously passed to ping_iterator_set_context or NULL if ping_iterator_set_context has never been called before. SEE ALSO
ping_iterator_get(3), ping_construct(3), ping_host_add(3), liboping(3) AUTHOR
liboping is written by Florian "octo" Forster <octo at verplant.org>. Its homepage can be found at <http://verplant.org/liboping/>. Copyright (c) 2005-2011 by Florian "octo" Forster. 1.6.2 2012-01-31 ping_iterator_get_context(3)
Man Page