bglibs: surfrand.h Source File

bglibs

surfrand.h
1 #ifndef BGLIBS__SURFRAND__H__
2 #define BGLIBS__SURFRAND__H__
3
4 #include "surf.h"
5
10 struct surfrand
11 {
14 unsigned left;
16 uint32 generated[SURF_OUT_U32];
18 uint32 seed[SURF_SEED_U32];
20 uint32 counter[SURF_IN_U32];
21 };
22
23 void surfrand_init(struct surfrand* c, const uint32* data, unsigned words);
24 uint32 surfrand_uint32(struct surfrand* c);
25 double surfrand_double(struct surfrand* c);
26 void surfrand_fill(struct surfrand* c, unsigned char* buf, unsigned len);
27 uint32 surfrand_uniform(struct surfrand* c, uint32 bound);
28
31 #endif
surfrand
Definition: surfrand.h:10
surfrand_double
double surfrand_double(struct surfrand *c)
Definition: surfrand.c:93
surfrand_fill
void surfrand_fill(struct surfrand *c, unsigned char *buf, unsigned len)
Definition: surfrand.c:101
surfrand::generated
uint32 generated[SURF_OUT_U32]
Definition: surfrand.h:16
SURF_SEED_U32
#define SURF_SEED_U32
Definition: surf.h:14
surfrand::counter
uint32 counter[SURF_IN_U32]
Definition: surfrand.h:20
surfrand::left
unsigned left
Definition: surfrand.h:14
surfrand_uint32
uint32 surfrand_uint32(struct surfrand *c)
Definition: surfrand.c:81
SURF_OUT_U32
#define SURF_OUT_U32
Definition: surf.h:10
surfrand_uniform
uint32 surfrand_uniform(struct surfrand *c, uint32 bound)
Definition: surfrand.c:121
surfrand_init
void surfrand_init(struct surfrand *c, const uint32 *data, unsigned words)
Definition: surfrand.c:51
SURF_IN_U32
#define SURF_IN_U32
Definition: surf.h:12
surfrand::seed
uint32 seed[SURF_SEED_U32]
Definition: surfrand.h:18