LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
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

◆ rtlRandomError

Error Code type.

◆ rtlRandomPool

typedef void* rtlRandomPool

Random Pool opaque type.

Enumeration Type Documentation

◆ __rtl_RandomError

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

◆ rtl_random_addBytes()

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.
Return values
rtl_Random_E_Noneupon success.

◆ rtl_random_createPool()

SAL_DLLPUBLIC rtlRandomPool rtl_random_createPool ( void  )

Create a Random Pool.

Returns
initialized Random Pool, or NULL upon failure.

◆ rtl_random_destroyPool()

SAL_DLLPUBLIC void rtl_random_destroyPool ( rtlRandomPool  Pool)

Destroy a Random Pool.

Parameters
[in]Poola Random Pool.

◆ rtl_random_getBytes()

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.
Return values
rtl_Random_E_Noneupon success.