libwget-random(3)

libwget-random3

Random functions

Usage

Functions

INITIALIZER (random_init)
void wget_random_init (void)
void wget_random_exit (void)
int wget_random (void)
void wget_srandom (unsigned int seed)

Detailed Description

This is wrapper code around gnulib's srandom_r() and random_r() with automatic seeding

Function Documentation

void wget_random_init (void)

Random API initialization, allocating/preparing the internal resources.

On systems with automatic library constructors, this function doesn't have to be called explicitly.

This function is not thread-safe.

void wget_random_exit (void)

Random API deinitialization, free'ing all internal resources.

On systems with automatic library destructors, this function doesn't have to be called explicitly.

This function is not thread-safe.

int wget_random (void)

Returns

Random value between 0 and RAND_MAX

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();

void wget_srandom (unsigned int seed)

Parameters

seed Value to seed the random generator

This functions wraps around srandom_r() to make a thread-safe seeding for wget_random().

Releases

4 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11–12
  3. 13

Author

Generated automatically by Doxygen for wget2 from the source code.

From wget2-dev 2.2.0+ds-1+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.