MySQL 8.0.39
Source Code Documentation
my_readline.h
Go to the documentation of this file.
1#ifndef CLIENT_MY_READLINE_INCLUDED
2#define CLIENT_MY_READLINE_INCLUDED
3
4/*
5 Copyright (c) 2000, 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/* readline for batch mode */
30
31#include "my_inttypes.h"
32#include "my_io.h"
33
36 char *buffer; /* The buffer itself, grown as needed. */
37 char *end; /* Pointer at buffer end */
39 uint bufread; /* Number of bytes to get with each read(). */
41 ulong max_size;
42 ulong read_length; /* Length of last read string */
43 int error;
45};
46
47extern LINE_BUFFER *batch_readline_init(ulong max_size, FILE *file);
49extern char *batch_readline(LINE_BUFFER *buffer, bool binary_mode);
51
52static const unsigned long int batch_io_size = 16 * 1024 * 1024;
53
54#endif /* CLIENT_MY_READLINE_INCLUDED */
Some integer typedefs for easier portability.
Common #defines and includes for file and socket I/O.
int File
Definition: my_io_bits.h:51
void batch_readline_end(LINE_BUFFER *buffer)
Definition: readline.cc:103
LINE_BUFFER * batch_readline_init(ulong max_size, FILE *file)
Definition: readline.cc:47
LINE_BUFFER * batch_readline_command(LINE_BUFFER *buffer, char *str)
Definition: readline.cc:110
static const unsigned long int batch_io_size
Definition: my_readline.h:52
char * batch_readline(LINE_BUFFER *buffer, bool binary_mode)
Definition: readline.cc:69
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
const std::string FILE("FILE")
Definition: os0file.h:86
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:420
Definition: my_readline.h:34
char * end_of_line
Definition: my_readline.h:38
int error
Definition: my_readline.h:43
char * start_of_line
Definition: my_readline.h:38
char * buffer
Definition: my_readline.h:36
ulong max_size
Definition: my_readline.h:41
uint eof
Definition: my_readline.h:40
char * end
Definition: my_readline.h:37
bool truncated
Definition: my_readline.h:44
ulong read_length
Definition: my_readline.h:42
File file
Definition: my_readline.h:35
uint bufread
Definition: my_readline.h:39
unsigned int uint
Definition: uca9-dump.cc:75