Back to index

kdeartwork  4.3.2
vm_random.h
Go to the documentation of this file.
00001 #ifndef __VM_RANDOM_H__
00002 #define __VM_RANDOM_H__
00003 
00004 #define VM_RAND_MAX        2147483647
00005 
00006 #define int32_t int
00007 
00008 struct vm_random_data
00009 {
00010  int32_t *fptr;              /* Front pointer.  */
00011  int32_t *rptr;              /* Rear pointer.  */
00012  int32_t *state;             /* Array of state values.  */
00013  int vm_rand_type;              /* Type of random number generator.  */
00014  int vm_rand_deg;               /* Degree of random number generator.  */
00015  int vm_rand_sep;               /* Distance between front and rear.  */
00016  int32_t *end_ptr;           /* Pointer behind state table.  */
00017 };
00018 
00019 int vm_initstate (unsigned int seed, 
00020                   void* arg_state, 
00021                   size_t n, 
00022                   struct vm_random_data* buf);
00023 int vm_setstate (void* arg_state, 
00024                  struct vm_random_data* buf);
00025 void vm_default_initstate( int seed,
00026                            struct vm_random_data* buf );
00027 int vm_srandom (unsigned int seed, 
00028                 struct vm_random_data* buf);
00029 int32_t vm_random (struct vm_random_data* buf);
00030 
00031 #endif /* !defined( __VM_RANDOM_H__ ) */