picox  0.1
xrandom.h
[詳解]
1 
14 /*
15  * License: MIT license
16  * Copyright (c) <2016> <MaskedW [maskedw00@gmail.com]>
17  *
18  * Permission is hereby granted, free of charge, to any person
19  * obtaining a copy of this software and associated documentation
20  * files (the "Software"), to deal in the Software without
21  * restriction, including without limitation the rights to use, copy,
22  * modify, merge, publish, distribute, sublicense, and/or sell copies
23  * of the Software, and to permit persons to whom the Software is
24  * furnished to do so, subject to the following conditions:
25  *
26  * The above copyright notice and this permission notice shall be
27  * included in all copies or substantial portions of the Software.
28  *
29  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
32  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
33  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
34  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
35  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36  * SOFTWARE.
37  */
38 
39 
40 #ifndef picox_core_detail_xrandom_h_
41 #define picox_core_detail_xrandom_h_
42 
43 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif /* __cplusplus */
59 
60 
63 void x_srand(uint32_t seed);
64 
65 
68 uint8_t x_rand8(void);
69 
70 
73 uint8_t x_randrange8(uint8_t min, uint8_t max);
74 
75 
78 uint16_t x_rand16(void);
79 
80 
83 uint16_t x_randrange16(uint16_t min, uint16_t max);
84 
85 
88 uint32_t x_rand32(void);
89 
90 
93 uint32_t x_randrange32(uint32_t min, uint32_t max);
94 
95 
98 unsigned x_rand(void);
99 
100 
103 unsigned x_randrange(unsigned min, unsigned max);
104 
105 
106 #ifdef __cplusplus
107 }
108 #endif /* __cplusplus */
109 
110 
116 #endif /* picox_core_detail_xrandom_h_ */
unsigned x_rand(void)
0 ~ UINT_MAXの範囲の擬似乱数を返します
Definition: xrandom.c:91
uint16_t x_rand16(void)
0 ~ UINT16_MAXの範囲の擬似乱数を返します
Definition: xrandom.c:72
uint16_t x_randrange16(uint16_t min, uint16_t max)
min ~ maxの範囲の擬似乱数を返します
Definition: xrandom.c:110
uint8_t x_randrange8(uint8_t min, uint8_t max)
min ~ maxの範囲の擬似乱数を返します
Definition: xrandom.c:103
void x_srand(uint32_t seed)
randが生成する擬似乱数の種を設定します
Definition: xrandom.c:48
uint8_t x_rand8(void)
0 ~ UINT8_MAXの範囲の擬似乱数を返します
Definition: xrandom.c:63
uint32_t x_rand32(void)
0 ~ UINT32_MAXの範囲の擬似乱数を返します
Definition: xrandom.c:81
uint32_t x_randrange32(uint32_t min, uint32_t max)
min ~ maxの範囲の擬似乱数を返します
Definition: xrandom.c:117
unsigned x_randrange(unsigned min, unsigned max)
min ~ maxの範囲の擬似乱数を返します
Definition: xrandom.c:124