LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Typedefs | Enumerations | Functions
random.h File Reference
#include <sal/config.h>
#include <sal/saldllapi.h>
#include <sal/types.h>

Go to the source code of this file.

Typedefs

typedef void * rtlRandomPool
 Random Pool opaque type. More...
 
typedef enum __rtl_RandomError rtlRandomError
 Error Code type. More...
 

Enumerations

enum  __rtl_RandomError {
  rtl_Random_E_None, rtl_Random_E_Argument, rtl_Random_E_Memory, rtl_Random_E_Unknown,
  rtl_Random_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
}
 Error Code enumeration. More...
 

Functions

SAL_DLLPUBLIC rtlRandomPool rtl_random_createPool (void) SAL_THROW_EXTERN_C()
 Create a Random Pool. More...
 
SAL_DLLPUBLIC void rtl_random_destroyPool (rtlRandomPool Pool) SAL_THROW_EXTERN_C()
 Destroy a Random Pool. More...
 
SAL_DLLPUBLIC rtlRandomError rtl_random_addBytes (rtlRandomPool Pool, const void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C()
 Add bytes to a Random Pool. More...
 
SAL_DLLPUBLIC rtlRandomError rtl_random_getBytes (rtlRandomPool Pool, void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C()
 Retrieve bytes from a Random Pool. More...
 

Typedef Documentation

Error Code type.

typedef void* rtlRandomPool

Random Pool opaque type.

Enumeration Type Documentation

Error Code enumeration.

Enumerator
rtl_Random_E_None 
rtl_Random_E_Argument 
rtl_Random_E_Memory 
rtl_Random_E_Unknown 
rtl_Random_E_FORCE_EQUAL_SIZE 

Function Documentation

SAL_DLLPUBLIC rtlRandomError rtl_random_addBytes ( rtlRandomPool  Pool,
const void *  Buffer,
sal_Size  Bytes 
)

Add bytes to a Random Pool.

Parameters
[in]Poola Random Pool.
[in]Buffera buffer containing the bytes to add.
[in]Bytesthe number of bytes to read from the buffer.
Returns
rtl_Random_E_None upon success.
SAL_DLLPUBLIC rtlRandomPool rtl_random_createPool ( void  )

Create a Random Pool.

Returns
initialized Random Pool, or NULL upon failure.
SAL_DLLPUBLIC void rtl_random_destroyPool ( rtlRandomPool  Pool)

Destroy a Random Pool.

Parameters
Pool[in] a Random Pool.
Returns
none. Pool is invalid.
SAL_DLLPUBLIC rtlRandomError rtl_random_getBytes ( rtlRandomPool  Pool,
void *  Buffer,
sal_Size  Bytes 
)

Retrieve bytes from a Random Pool.

Parameters
[in]Poola Random Pool.
[in,out]Buffera buffer to receive the random bytes.
[in]Bytesthe number of bytes to write to the buffer.
Returns
rtl_Random_E_None upon success.