diff options
Diffstat (limited to 'lib/util/randsysrand.c')
-rw-r--r-- | lib/util/randsysrand.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/util/randsysrand.c b/lib/util/randsysrand.c new file mode 100644 index 00000000..bea5ea17 --- /dev/null +++ b/lib/util/randsysrand.c @@ -0,0 +1,35 @@ +#include "netpbm/rand.h" + +static void +vinit(struct pm_randSt * const randStP) { + + randStP->max = RAND_MAX; + randStP->stateP = NULL; +} + + + +static void +vsrand(struct pm_randSt * const randStP, + unsigned int const seed) { + + srand(seed); +} + + + +static unsigned long int +vrand(struct pm_randSt * const randStP) { + + return rand(); +} + + + +struct pm_rand_vtable const pm_randsysrand_vtable = { + &vinit, + &vsrand, + &vrand +}; + + |