ping_construct(3)
π 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_constructconstructor returns a pointer to the allocated memory π - or it returns
NULLif 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 π
π¦ where this page comes from
- alpine 3.24: liboping-doc 1.10.0-r2 Β· LGPL-2.0-or-later
- epel 10: liboping-devel 1.10.0-33.el10_0 Β· GPL-2.0-only
- epel 9: liboping-devel 1.10.0-19.el9 Β· GPLv2
- fedora 43: liboping-devel 1.10.0-35.fc43 Β· GPL-2.0-only
- fedora 43: liboping-devel 1.10.0-35.fc43 Β· GPL-2.0-only
- fedora 44: liboping-devel 1.10.0-36.fc44 Β· GPL-2.0-only
- fedora 44: liboping-devel 1.10.0-36.fc44 Β· GPL-2.0-only
- nixos 26.05: liboping 1.10.0
- nixpkgs unstable: liboping 1.10.0
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- opensuse-leap 16.0: liboping-devel 1.10.0-bp160.1.14 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms