Changeset 11523 in vbox for trunk/src/VBox/Runtime/include/internal/rand.h
- Timestamp:
- Aug 20, 2008 8:48:52 PM (17 years ago)
- svn:sync-xref-src-repo-rev:
- 35074
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/include/internal/rand.h
r11347 r11523 85 85 * 86 86 * @returns IPRT status code. 87 * @retval VERR_NOT_SUPPORTED if it isn't a pseudo generator. 88 * 87 89 * @param pThis Pointer to the instance data. 88 90 * @param u64Seed The seed. 89 91 */ 90 92 DECLCALLBACKMEMBER(int, pfnSeed)(PRTRANDINT pThis, uint64_t u64Seed); 93 94 /** 95 * Save the current state of a pseudo generator. 96 * 97 * This can be use to save the state so it can later be resumed at the same 98 * position. 99 * 100 * @returns IPRT status code. 101 * @retval VINF_SUCCESS on success. *pcbState contains the length of the 102 * returned string and pszState contains the state string. 103 * @retval VERR_BUFFER_OVERFLOW if the supplied buffer is too small. *pcbState 104 * will contain the necessary buffer size. 105 * @retval VERR_NOT_SUPPORTED by non-psuedo generators. 106 * 107 * @param hRand Handle to the random number generator. 108 * @param pszState Where to store the state. The returned string will be 109 * null terminated and printable. 110 * @param pcbState The size of the buffer pszState points to on input, the 111 * size required / used on return (including the 112 * terminator, thus the 'cb' instead of 'cch'). 113 */ 114 DECLCALLBACKMEMBER(int, pfnSaveState)(RTRAND hRand, char *pszState, size_t *pcbState); 115 116 /** 117 * Restores the state of a pseudo generator. 118 * 119 * The state must've been obtained using pfnGetState. 120 * 121 * @returns IPRT status code. 122 * @retval VERR_PARSE_ERROR if the state string is malformed. 123 * @retval VERR_NOT_SUPPORTED by non-psuedo generators. 124 * 125 * @param hRand Handle to the random number generator. 126 * @param pszState The state to load. 127 */ 128 DECLCALLBACKMEMBER(int, pfnRestoreState)(RTRAND hRand, char const *pszState); 91 129 92 130 /** … … 113 151 uint32_t cBits; 114 152 } ParkMiller; 153 154 struct RTRandFile 155 { 156 /** The file handle. */ 157 RTFILE hFile; 158 } File; 115 159 } u; 116 160 } RTRANDINT; … … 141 185 DECLCALLBACK(uint64_t) rtRandAdvSynthesizeU64FromBytes(PRTRANDINT pThis, uint64_t u64First, uint64_t u64Last); 142 186 DECLCALLBACK(uint64_t) rtRandAdvSynthesizeU64FromU32(PRTRANDINT pThis, uint64_t u64First, uint64_t u64Last); 187 DECLCALLBACK(int) rtRandAdvStubSeed(PRTRANDINT pThis, uint64_t u64Seed); 188 DECLCALLBACK(int) rtRandAdvStubSaveState(PRTRANDINT pThis, char *pszState, size_t *pcbState); 189 DECLCALLBACK(int) rtRandAdvStubRestoreState(PRTRANDINT pThis, char const *pszState); 190 DECLCALLBACK(int) rtRandAdvDefaultDestroy(PRTRANDINT pThis); 143 191 144 192 __END_DECLS
Note:
See TracChangeset
for help on using the changeset viewer.