LibreOffice LibreOffice 25.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
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.
typedef enum __rtl_RandomError | rtlRandomError
| Error Code type.

## 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 rtlRandomError | rtl_random_getBytes (rtlRandomPool Pool, void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C()
| Retrieve random bytes.
SAL_DLLPUBLIC rtlRandomPool | rtl_random_createPool (void) SAL_THROW_EXTERN_C()
| Create a Random Pool.
SAL_DLLPUBLIC void | rtl_random_destroyPool (rtlRandomPool Pool) SAL_THROW_EXTERN_C()
| Destroy a Random Pool.
SAL_DLLPUBLIC rtlRandomError | rtl_random_addBytes (rtlRandomPool Pool, const void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C()
| Add bytes to a Random Pool.

## Typedef Documentation

## ◆ rtlRandomError

typedef enum __rtl_RandomError rtlRandomError

Error Code type.

## ◆ rtlRandomPool

typedef void* rtlRandomPool

Random Pool opaque type.

## Enumeration Type Documentation

## ◆ __rtl_RandomError

enum __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] | Pool | a Random Pool.
  [in] | Buffer | a buffer containing the bytes to add.
  [in] | Bytes | the number of bytes to read from the buffer.

Return values

  rtl_Random_E_None | upon success.

Deprecated
  This now does nothing, instead use rtl_random_getBytes with a NULL Pool

## ◆ rtl_random_createPool()

SAL_DLLPUBLIC rtlRandomPool rtl_random_createPool | ( | void |  | ) |

Create a Random Pool.

Returns
  initialized Random Pool, or NULL upon failure.

Deprecated
  Instead use rtl_random_getBytes with a NULL Pool

## ◆ rtl_random_destroyPool()

SAL_DLLPUBLIC void rtl_random_destroyPool | ( | rtlRandomPool | Pool | ) |

Destroy a Random Pool.

Parameters

  [in] | Pool | a Random Pool.

Deprecated
  Instead use rtl_random_getBytes with a NULL Pool

## ◆ rtl_random_getBytes()

SAL_DLLPUBLIC rtlRandomError rtl_random_getBytes | ( | rtlRandomPool | Pool,
|  | void * | Buffer,
|  | sal_Size | Bytes )

Retrieve random bytes.

Parameters

  [in] | Pool | use NULL, non-NULL Random Pools are deprecated
  [in,out] | Buffer | a buffer to receive the random bytes.
  [in] | Bytes | the number of bytes to write to the buffer.

Return values

  rtl_Random_E_None | upon success.