rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
rand.h
Go to the documentation of this file.
1 /* This file is part of rflpc.
2  *
3  * rflpc is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 3 of the License, or
6  * (at your option) any later version.
7  *
8  * rflpc is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with rflpc. If not, see <http://www.gnu.org/licenses/>.
15  */
16 /*
17  Author: Michael Hauspie <michael.hauspie@univ-lille1.fr>
18  Created: 2012-03-27
19 */
26 #ifndef __RFLPC_RAND_H__
27 #define __RFLPC_RAND_H__
28 
29 #ifdef RFLPC_CONFIG_ENABLE_RAND
30 
34 #ifdef RAND_MAX
35 #undef RAND_MAX
36 #endif
37 
41 #define RAND_MAX 2147483647
42 
46 extern void srand(unsigned int seed);
47 
51 extern int rand(void);
52 
57 extern int rand_r(unsigned int *seed);
58 
61 #endif /* ENABLE_RAND */
62 
63 #endif
void srand(unsigned int seed)
Sets the seed used by rand() to generate the pseudo-random sequence.
int rand_r(unsigned int *seed)
Returns a pseudo-random integer in the range of 0 to RAND_MAX.
int rand(void)
Returns a pseudo-random integer in the range of 0 to RAND_MAX.