libwget-random(3)
π libwget-random β Random functions π
okay bestie, sit down, hydrate, because we're talking about libwget-random, aka the Library Functions Manual entry for the wget2 randomness girlies. it's giving dice-roll energy, it's giving "trust the vibes, they're seeded". let's go π²β¨
π NAME π
libwget-random β Random functions. that's it, that's the whole identity. random functions, no notes. π
β¨ SYNOPSIS β¨
π«Ά Functions
here's the whole cast, no skips, no cuts:
INITIALIZER (random_init)
void wget_random_init (void)
void wget_random_exit (void)
int wget_random (void)
void wget_srandom (unsigned int seed)
look at them. icons. every single one of them shows up later, so don't scroll past. π
π¦ Detailed Description π¦
so basically this is wrapper code around gnulib's srandom_r() and random_r() with automatic seeding. that's the whole tea. it doesn't reinvent randomness, it just wraps the gnulib ones up in a lil bow π and handles the seeding for you automatically. no cap.
πΈ Function Documentation πΈ
π void wget_random_init (void )
Random API initialization β it's allocating/preparing the internal resources. the pre-game ritual, the getting-ready-with-me. π
lowkey important detail: on systems with automatic library constructors, this function doesn't have to be called explicitly. the system already did it for you, bestie, it's self-sufficient like that.
β οΈ This function is not thread-safe. do not come for it in a crowd, she will not handle it. π
π§ void wget_random_exit (void )
Random API deinitialization β it's free'ing all internal resources. the skincare routine after the party, the cleanup era. π§Ό
and same deal as her sister: on systems with automatic library destructors, this function doesn't have to be called explicitly. the system handles the goodbye on its own. π«Ά
β οΈ This function is not thread-safe. periodt. one at a time please.
β int wget_random (void )
the main character!! π
Returns
Random value between 0 and RAND_MAX. yes, that RAND_MAX. iconic range, honestly.
and here's the lore: this functions wraps around gnulib's random_r(). it performs a thread-safe seeding on the first use, if not done before by wget_srandom(). so if you forgot to seed it yourself, she's got you β first use, seeded, thread-safe, done. no drama. π₯
π void wget_srandom (unsigned int seed)
the seeding girlie. π±
Parameters
- seed β Value to seed the random generator. that's the lil number you hand over so everything after it isn't the same sequence every single time. choose wisely, or don't, it's random anyway. π
and the vibe: this functions wraps around srandom_r() to make a thread-safe seeding for wget_random(). so it's not just seeding, it's seeding responsibly. π
π Author π
Generated automatically by Doxygen for wget2 from the source code. the manpage wrote itself, literally, and honestly? slay. β¨
and that's the whole page, bestie!! π this was brought to you by wget2, Version 2.3.0, living under the libwget-random(3) name β go forth and be random, thread-safely, one call at a time. bye mwah πππ¦
π¦ where this page comes from
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: wget2-devel 2.3.0-2.fc43 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-1.fc44
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: wget2-devel 2.3.0-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND GFDL-1.3-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms