Changeset 889 in vbox
- Timestamp:
- Feb 14, 2007 9:33:52 AM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 18606
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/rand.h
r839 r889 1 1 /** @file 2 * InnoTek Portable Runtime - Memory Allocation.2 * InnoTek Portable Runtime - Random Numbers and Byte Streams. 3 3 */ 4 4 … … 19 19 */ 20 20 21 #ifndef __iprt_ alloc_h__22 #define __iprt_ alloc_h__21 #ifndef __iprt_rand_h__ 22 #define __iprt_rand_h__ 23 23 24 /* Forwarding to the canonical header. */ 25 #include <iprt/mem.h> 24 #include <iprt/cdefs.h> 25 #include <iprt/types.h> 26 27 __BEGIN_DECLS 28 29 /** @defgroup grp_rt_rand RTRand - Random Numbers and Byte Streams 30 * @ingroup grp_rt 31 * @{ 32 */ 33 34 /** 35 * Fills a buffer with random bytes. 36 * 37 * @param pv Where to store the random bytes. 38 * @param cb Number of bytes to generate. 39 */ 40 RTDECL(void) RTRandBytes(void *pv, size_t cb); 41 42 /** 43 * Generate a 32-bit signed random number in the set [i32First..i32Last]. 44 * 45 * @returns The random number. 46 * @param i32First First number in the set. 47 * @param i32Last Last number in the set. 48 */ 49 RTDECL(int32_t) RTRandS32Ex(int32_t i32First, int32_t i32Last); 50 51 /** 52 * Generate a 32-bit signed random number. 53 * 54 * @returns The random number. 55 */ 56 RTDECL(int32_t) RTRandS32(void); 57 58 /** 59 * Generate a 32-bit unsigned random number in the set [u32First..u32Last]. 60 * 61 * @returns The random number. 62 * @param u32First First number in the set. 63 * @param u32Last Last number in the set. 64 */ 65 RTDECL(uint32_t) RTRandU32Ex(uint32_t u32First, uint32_t u32Last); 66 67 /** 68 * Generate a 32-bit unsigned random number. 69 * 70 * @returns The random number. 71 */ 72 RTDECL(uint32_t) RTRandU32(void); 73 74 /** 75 * Generate a 32-bit signed random number in the set [i32First..i32Last]. 76 * 77 * @returns The random number. 78 * @param i32First First number in the set. 79 * @param i32Last Last number in the set. 80 */ 81 RTDECL(int64_t) RTRandS64Ex(int64_t i64First, int64_t i64Last); 82 83 /** 84 * Generate a 64-bit signed random number. 85 * 86 * @returns The random number. 87 */ 88 RTDECL(int64_t) RTRandS64(void); 89 90 /** 91 * Generate a 64-bit unsigned random number in the set [u64First..u64Last]. 92 * 93 * @returns The random number. 94 * @param u64First First number in the set. 95 * @param u64Last Last number in the set. 96 */ 97 RTDECL(uint64_t) RTRandU64Ex(uint64_t u64First, uint64_t u64Last); 98 99 /** 100 * Generate a 64-bit unsigned random number. 101 * 102 * @returns The random number. 103 */ 104 RTDECL(uint64_t) RTRandU64(void); 105 106 /** @} */ 107 108 __END_DECLS 109 26 110 27 111 #endif
Note:
See TracChangeset
for help on using the changeset viewer.