ping_iterator_get(3)

πŸ“¦
version 1.10.0 Β· 8 versions
, in alpine 3.24, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

πŸ’– ping_iterator_get(3) β€” a liboping moment πŸ’–

okay bestie, so this page lives in the liboping manual (section 3, the library-girlies section) and it's all about iterating over hosts. two little functions, one big slay. πŸ¦‹


✨ 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)

no cap, that's the whole vibe. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

so these two functions? they let you iterate over every host that's chillin' inside a liboping object. the way you use them is literally this:

pingobj_iter_t *iter;

for (iter = ping_iterator_get (obj);
     iter != NULL;
     iter = ping_iterator_next (iter))
{
  ...;
}

look at that for-loop. it's giving main character energy fr fr. πŸŽ€

now, here's the tea: the iterator object is an opaque data type, just like the liboping object itself (yes, both of them are mysterious like that πŸ™ˆ). so you can't just peek inside and grab stuff directly. if you want usable info out of an iterator, you gotta go through ping_iterator_get_info(3) and ping_iterator_get_context(3). those are your besties for that. πŸ’œ


⭐ RETURN VALUE ⭐

  • ping_iterator_get β€” returns an iterator for obj, or NULL if there's no host associated with obj. 😭 (empty vibes, literally)
  • ping_iterator_next β€” returns an iterator for the host following iter, or NULL if you've hit the last host and there's nowhere left to go. πŸ’€ end of the line, bestie.

🫢 SEE ALSO 🫢


πŸ‘‘ AUTHOR πŸ‘‘

liboping is written by Florian "octo" Forster <ff at octo.it>. 🧚 its homepage can be found at <http://noping.cc/>.

Copyright (c) 2006-2017 by Florian "octo" Forster.


and that's the whole page, bestie!! this one's from liboping version 1.10.0, dated 2017-05-11, and it's been serving ping_iterator_get(3) realness ever since. slay, iterate responsibly, and remember: if the iterator is NULL, the loop is done. periodt. πŸ’–βœ¨πŸŒˆ