Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

rand.c File Reference

#include "config.h"
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include "dnet.h"

Go to the source code of this file.

Functions

static void rand_init (rand_t *rand)
static void rand_addrandom (rand_t *rand, u_char *buf, int len)
rand_trand_open (void)
static uint8_t rand_getbyte (rand_t *r)
int rand_get (rand_t *r, void *buf, size_t len)
int rand_set (rand_t *r, const void *buf, size_t len)
int rand_add (rand_t *r, const void *buf, size_t len)
uint8_t rand_uint8 (rand_t *r)
uint16_t rand_uint16 (rand_t *r)
uint32_t rand_uint32 (rand_t *r)
int rand_shuffle (rand_t *r, void *base, size_t nmemb, size_t size)
rand_trand_close (rand_t *r)


Function Documentation

int rand_add rand_t r,
const void *  buf,
size_t  len
 

Definition at line 135 of file rand.c.

References rand_addrandom().

Referenced by __pyx_f_4dnet_4rand_add().

static void rand_addrandom rand_t rand,
u_char *  buf,
int  len
[inline, static]
 

Definition at line 50 of file rand.c.

References rand_handle::i, rand_handle::j, and rand_handle::s.

Referenced by rand_add(), rand_open(), and rand_set().

rand_t* rand_close rand_t r  ) 
 

Definition at line 203 of file rand.c.

References NULL, and rand_handle::tmp.

Referenced by __pyx_f_4dnet_4rand___dealloc__(), and START_TEST().

int rand_get rand_t r,
void *  buf,
size_t  len
 

Definition at line 114 of file rand.c.

References rand_getbyte().

Referenced by __pyx_f_4dnet_13__rand_xrange___init__(), __pyx_f_4dnet_4rand_get(), rand_main(), and START_TEST().

static uint8_t rand_getbyte rand_t r  )  [static]
 

Definition at line 100 of file rand.c.

Referenced by rand_get(), rand_uint16(), rand_uint32(), and rand_uint8().

static void rand_init rand_t rand  )  [inline, static]
 

Definition at line 40 of file rand.c.

References rand_handle::i, rand_handle::j, and rand_handle::s.

Referenced by rand_open(), and rand_set().

rand_t* rand_open void   ) 
 

Definition at line 67 of file rand.c.

References gettimeofday(), NULL, rand_addrandom(), and rand_init().

Referenced by __pyx_f_4dnet_4rand___init__(), rand_main(), and START_TEST().

int rand_set rand_t r,
const void *  buf,
size_t  len
 

Definition at line 126 of file rand.c.

References rand_addrandom(), and rand_init().

Referenced by __pyx_f_4dnet_4rand_set(), and START_TEST().

int rand_shuffle rand_t r,
void *  base,
size_t  nmemb,
size_t  size
 

Definition at line 170 of file rand.c.

References memcpy, NULL, and rand_uint32().

Referenced by START_TEST().

uint16_t rand_uint16 rand_t r  ) 
 

Definition at line 148 of file rand.c.

References rand_getbyte().

Referenced by __pyx_f_4dnet_4rand_uint16().

uint32_t rand_uint32 rand_t r  ) 
 

Definition at line 158 of file rand.c.

References rand_getbyte().

Referenced by __pyx_f_4dnet_4rand_uint32(), and rand_shuffle().

uint8_t rand_uint8 rand_t r  ) 
 

Definition at line 142 of file rand.c.

References rand_getbyte().

Referenced by __pyx_f_4dnet_4rand_uint8().


Generated on Sun May 14 14:51:22 2006 by  doxygen 1.4.2