Functions

vlc_rand.h File Reference

This file defined random number generator function in vlc. More...

Go to the source code of this file.

Functions

VLC_API void vlc_rand_bytes (void *buf, size_t len)
VLC_API double vlc_drand48 (void) VLC_USED
 PRNG uniformly distributed between 0.0 and 1.0 with 48-bits precision.
VLC_API long vlc_lrand48 (void) VLC_USED
 PRNG uniformly distributed between 0 and 2^32 - 1.
VLC_API long vlc_mrand48 (void) VLC_USED
 PRNG uniformly distributed between -2^32 and 2^32 - 1.

Detailed Description

This file defined random number generator function in vlc.


Function Documentation

VLC_API double vlc_drand48 ( void   ) 

PRNG uniformly distributed between 0.0 and 1.0 with 48-bits precision.

Note:
Contrary to POSIX drand48(), this function is thread-safe.
Warning:
Series generated by this function are not reproducible. Use erand48() if you need reproducible series.
Returns:
a double value within [0.0, 1.0] inclusive

References erand48(), init_rand48(), rand48, vlc_mutex_lock(), and vlc_mutex_unlock().

VLC_API long vlc_lrand48 ( void   ) 

PRNG uniformly distributed between 0 and 2^32 - 1.

Note:
Contrary to POSIX lrand48(), this function is thread-safe.
Warning:
Series generated by this function are not reproducible. Use nrand48() if you need reproducible series.
Returns:
an integral value within [0.0, 2^32-1] inclusive

References init_rand48(), nrand48(), rand48, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by ResetCurrentlyPlaying().

VLC_API long vlc_mrand48 ( void   ) 

PRNG uniformly distributed between -2^32 and 2^32 - 1.

Note:
Contrary to POSIX mrand48(), this function is thread-safe.
Warning:
Series generated by this function are not reproducible. Use jrand48() if you need reproducible series.
Returns:
an integral value within [-2^32, 2^32-1] inclusive

References init_rand48(), jrand48(), rand48, vlc_mutex_lock(), and vlc_mutex_unlock().

Referenced by httpd_StreamCallBack(), input_item_add_subitem_tree(), and playlist_ItemArraySort().

VLC_API void vlc_rand_bytes ( void *  buf,
size_t  len 
)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines