tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
random.h
Go to the documentation of this file.
1 /******************************************************************************
2  * random.h
3  *
4  * A really simple random-number generator. Crappy linear congruential
5  * taken from glibc, but has at least a 2^32 period.
6  */
7 
8 #ifndef __RANDOM_H__
9 #define __RANDOM_H__
10 
11 typedef unsigned long rand_t;
12 
13 #define rand_init(_ptst) \
14  ((_ptst)->rand = RDTICK())
15 
16 #define rand_next(_ptst) \
17  ((_ptst)->rand = ((_ptst)->rand * 1103515245) + 12345)
18 
19 #endif /* __RANDOM_H__ */
unsigned long rand_t
Definition: random.h:11