LibreOffice: rtl/random.h Source File

LibreOffice LibreOffice 26.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
random.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_RTL_RANDOM_H
25#define INCLUDED_RTL_RANDOM_H
26
27#include "sal/config.h"
28
29#include "sal/saldllapi.h"
30#include "sal/types.h"
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
38 typedef void* rtlRandomPool;
39
40
43 enum __rtl_RandomError
44{
45 rtl_Random_E_None,
46 rtl_Random_E_Argument,
47 rtl_Random_E_Memory,
48 rtl_Random_E_Unknown,
49 rtl_Random_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
50};
51
54 typedef enum __rtl_RandomError rtlRandomError;
55
62 SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_getBytes (
63 rtlRandomPool Pool,
64 void *Buffer,
65 sal_Size Bytes
66) SAL_THROW_EXTERN_C();
67
68
73 SAL_DLLPUBLIC rtlRandomPool SAL_CALL rtl_random_createPool (void) SAL_THROW_EXTERN_C();
74
75
80 SAL_DLLPUBLIC void SAL_CALL rtl_random_destroyPool (
81 rtlRandomPool Pool
82) SAL_THROW_EXTERN_C();
83
84
93 SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_addBytes (
94 rtlRandomPool Pool,
95 const void *Buffer,
96 sal_Size Bytes
97) SAL_THROW_EXTERN_C();
98
99
100#ifdef __cplusplus
101}
102#endif
103
104#endif // INCLUDED_RTL_RANDOM_H
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
saldllapi.h
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition saldllapi.h:34
types.h
SAL_MAX_ENUM
#define SAL_MAX_ENUM
Definition types.h:205
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition types.h:352
config.h
__rtl_RandomError
__rtl_RandomError
Error Code enumeration.
Definition random.h:44
rtl_Random_E_None
@ rtl_Random_E_None
Definition random.h:45
rtl_Random_E_Argument
@ rtl_Random_E_Argument
Definition random.h:46
rtl_Random_E_FORCE_EQUAL_SIZE
@ rtl_Random_E_FORCE_EQUAL_SIZE
Definition random.h:49
rtl_Random_E_Memory
@ rtl_Random_E_Memory
Definition random.h:47
rtl_Random_E_Unknown
@ rtl_Random_E_Unknown
Definition random.h:48
rtlRandomPool
void * rtlRandomPool
Random Pool opaque type.
Definition random.h:38
rtl_random_getBytes
SAL_DLLPUBLIC rtlRandomError rtl_random_getBytes(rtlRandomPool Pool, void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C()
Retrieve random bytes.
rtl_random_addBytes
SAL_DLLPUBLIC rtlRandomError rtl_random_addBytes(rtlRandomPool Pool, const void *Buffer, sal_Size Bytes) SAL_THROW_EXTERN_C()
Add bytes to a Random Pool.
rtlRandomError
enum __rtl_RandomError rtlRandomError
Error Code type.
Definition random.h:54
rtl_random_createPool
SAL_DLLPUBLIC rtlRandomPool rtl_random_createPool(void) SAL_THROW_EXTERN_C()
Create a Random Pool.
rtl_random_destroyPool
SAL_DLLPUBLIC void rtl_random_destroyPool(rtlRandomPool Pool) SAL_THROW_EXTERN_C()
Destroy a Random Pool.