zenilib: zenilib/jni/external/sdl/SDL/SDL_test_random.h File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Macros | Functions
SDL_test_random.h File Reference
`#include "begin_code.h"`
`#include "close_code.h"`

Go to the source code of this file.

## Classes

struct | SDLTest_RandomContext

## Macros

#define | SDLTest_RandomInt(c) ((int)SDLTest_Random(c))

## Functions

unsigned int | SDLTest_Random (SDLTest_RandomContext *rndContext)
| Initialize random number generator based on current system time. More...
void | SDLTest_RandomInit (SDLTest_RandomContext *rndContext, unsigned int xi, unsigned int ci)
| Initialize random number generator with two integers. More...
void | SDLTest_RandomInitTime (SDLTest_RandomContext *rndContext)
| Initialize random number generator based on current system time. More...

## Detailed Description

Include file for SDL test framework.

This code is a part of the SDL2_test library, not the main SDL library.

Definition in file SDL_test_random.h.

## Macro Definition Documentation

#define SDLTest_RandomInt | ( |  | c | ) | ((int)SDLTest_Random(c))

Definition at line 54 of file SDL_test_random.h.

Referenced by SDLTest_RandomDouble(), SDLTest_RandomSint16(), SDLTest_RandomSint32(), SDLTest_RandomSint8(), SDLTest_RandomUint16(), SDLTest_RandomUint32(), and SDLTest_RandomUint8().

## Function Documentation

unsigned int SDLTest_Random | ( | SDLTest_RandomContext * | rndContext | ) |

Initialize random number generator based on current system time.

Note: ...RandomInit() or ...RandomInitTime() must have been called before using this function.

Parameters

  rndContext | pointer to context structure

Returns
  A random number (32bit unsigned integer)

Definition at line 80 of file SDL_test_random.c.

References SDLTest_RandomContext::a, SDLTest_RandomContext::ah, SDLTest_RandomContext::al, SDLTest_RandomContext::c, NULL, return, and SDLTest_RandomContext::x.

Referenced by SDLTest_GenerateRunSeed().

void SDLTest_RandomInit | ( | SDLTest_RandomContext * | rndContext,
|  | unsigned int | xi,
|  | unsigned int | ci
| ) |  |

Initialize random number generator with two integers.

Note: The random sequence of numbers returned by ...Random() is the same for the same two integers and has a period of 2^31.

Parameters

  rndContext | pointer to context structure
  xi | integer that defines the random sequence
  ci | integer that defines the random sequence

Definition at line 41 of file SDL_test_random.c.

References SDLTest_RandomContext::a, SDLTest_RandomContext::ah, SDLTest_RandomContext::al, SDLTest_RandomContext::c, NULL, and SDLTest_RandomContext::x.

Referenced by SDLTest_FuzzerInit(), and SDLTest_RandomInitTime().

void SDLTest_RandomInitTime | ( | SDLTest_RandomContext * | rndContext | ) |

Initialize random number generator based on current system time.

Parameters

  rndContext | pointer to context structure

Definition at line 65 of file SDL_test_random.c.

References NULL, and SDLTest_RandomInit().

Referenced by SDLTest_GenerateRunSeed().