ping_construct(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_construct β€” the liboping constructor bestie πŸ’–

okay so this is ping_construct(3) from the liboping manual, and it's literally the origin story of every liboping object you will ever make. sit down, hydrate, let's go 🫢


✨ NAME ✨

ping_construct β€” constructor for the liboping class. it's giving birth of an object, no cap πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <oping.h>

pingobj_t *ping_construct (void);
void       ping_destroy   (pingobj_t *obj);

like, that's it. two little functions. one makes, one takes away. the circle of life fr fr 🌸


🌈 DESCRIPTION 🌈

so the ping_construct constructor is the main character here: it allocates the memory that a liboping object needs, initializes that memory, and then hands you back a pointer to it. memory girlbossing, honestly ✨

then ping_destroy is the cleanup crew. it iterates over all the hosts associated with the liboping object obj, closes the sockets, removes the hosts, and frees obj's memory. not me romanticizing garbage collection 😭 but yeah, it does all of that, in that order, so nothing leaks. slay πŸŽ€


⭐ RETURN VALUE ⭐

  • the ping_construct constructor returns a pointer to the allocated memory πŸ’–
  • or it returns NULL if no memory could be allocated πŸ’€ (sad, tragic, but you gotta check for it)

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, they're iconic:


🌸 AUTHOR 🌸

liboping is written by Florian "octo" Forster <ff at octo.it>. the homepage lives at <http://noping.cc/> β€” go say hi 🫢

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


ok and that's the whole page bestie, you're officially certified in liboping object construction πŸ’…

and for the cute sign-off: this is liboping 1.10.0, dated 2017-05-11, and the manual page is ping_construct(3) β€” periodt πŸ’œ