MySQL 9.1.0
Source Code Documentation
my_rnd.h
Go to the documentation of this file.
1#ifndef MY_RANDOM_INCLUDED
2#define MY_RANDOM_INCLUDED
3
4/*
5 Copyright (c) 2012, 2024, Oracle and/or its affiliates.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License, version 2.0,
9 as published by the Free Software Foundation.
10
11 This program is designed to work with certain software (including
12 but not limited to OpenSSL) that is licensed under separate terms,
13 as designated in a particular file or component or in included license
14 documentation. The authors of MySQL hereby grant you an additional
15 permission to link the program and your derivative works with the
16 separately licensed software that they have either included with
17 the program or referenced in the documentation.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License, version 2.0, for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
27
28/**
29 @file include/my_rnd.h
30 A wrapper to use OpenSSL PRNGs.
31*/
32
33#include <stddef.h>
34
35double my_rnd_ssl(bool *failed);
36int my_rand_buffer(unsigned char *buffer, size_t buffer_size);
37void randominit(struct rand_struct *, unsigned long seed1, unsigned long seed2);
38double my_rnd(struct rand_struct *);
39
40#endif /* MY_RANDOM_INCLUDED */
static bool failed
Definition: log_sink_test.cc:54
double my_rnd_ssl(bool *failed)
Generate a random number using the OpenSSL supplied random number generator if available.
Definition: my_rnd.cc:95
double my_rnd(struct rand_struct *)
Generate random number.
Definition: my_rnd.cc:60
int my_rand_buffer(unsigned char *buffer, size_t buffer_size)
Fill a buffer with random bytes using the SSL library routines.
Definition: my_rnd.cc:75
void randominit(struct rand_struct *, unsigned long seed1, unsigned long seed2)
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
size_t buffer_size(const ConstBufferSequence &buffers) noexcept
Definition: buffer.h:313
Definition: mysql_com.h:1109