LibreOffice: rtl/random.h File Reference

LibreOffice LibreOffice 7.5 SDK C/C++ API Reference

Loading...
Searching...
No Matches
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.
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 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.
SAL_DLLPUBLIC rtlRandomError | rtl_random_getBytes (rtlRandomPool Pool, void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C()
| Retrieve bytes from 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.

## ◆ 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] | Pool | a 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] | Pool | a Random Pool.
  [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.