cctools
random.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014- The University of Notre Dame
3  * This software is distributed under the GNU General Public License.
4  * See the file COPYING for details.
5  */
6 
7 #ifndef RANDOM_H
8 #define RANDOM_H
9 
10 #include <stdint.h>
11 #include <stdlib.h>
12 
20 void random_init (void);
21 
26 #define random_int() ((int) random_int64())
27 
32 #define random_uint() ((unsigned) random_int64())
33 
38 #define random_int32() ((int32_t) random_int64())
39 
44 int64_t random_int64 (void);
45 
51 void random_array (void *m, size_t l);
52 
58 void random_hex (char *s, size_t l);
59 
60 #endif
61 
62 /* vim: set noexpandtab tabstop=4: */
void random_init(void)
Initialize the random number generator.
int64_t random_int64(void)
Get a random int64_t.
void random_hex(char *s, size_t l)
Insert a random string in hexadecimal.
void random_array(void *m, size_t l)
Insert random data into an array.