MySQL 8.0.30
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, 2022, 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 also distributed 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 included with MySQL.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License, version 2.0, for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26*/
27
28/* readline for batch mode */
29
30#include "my_inttypes.h"
31#include "my_io.h"
32
35 char *buffer; /* The buffer itself, grown as needed. */
36 char *end; /* Pointer at buffer end */
38 uint bufread; /* Number of bytes to get with each read(). */
40 ulong max_size;
41 ulong read_length; /* Length of last read string */
42 int error;
44};
45
46extern LINE_BUFFER *batch_readline_init(ulong max_size, FILE *file);
48extern char *batch_readline(LINE_BUFFER *buffer, bool binary_mode);
50
51static const unsigned long int batch_io_size = 16 * 1024 * 1024;
52
53#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:50
void batch_readline_end(LINE_BUFFER *buffer)
Definition: readline.cc:101
LINE_BUFFER * batch_readline_init(ulong max_size, FILE *file)
Definition: readline.cc:46
LINE_BUFFER * batch_readline_command(LINE_BUFFER *buffer, char *str)
Definition: readline.cc:108
static const unsigned long int batch_io_size
Definition: my_readline.h:51
char * batch_readline(LINE_BUFFER *buffer, bool binary_mode)
Definition: readline.cc:68
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1055
const std::string FILE("FILE")
Definition: os0file.h:85
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:391
Definition: my_readline.h:33
char * end_of_line
Definition: my_readline.h:37
int error
Definition: my_readline.h:42
char * start_of_line
Definition: my_readline.h:37
char * buffer
Definition: my_readline.h:35
ulong max_size
Definition: my_readline.h:40
uint eof
Definition: my_readline.h:39
char * end
Definition: my_readline.h:36
bool truncated
Definition: my_readline.h:43
ulong read_length
Definition: my_readline.h:41
File file
Definition: my_readline.h:34
uint bufread
Definition: my_readline.h:38
unsigned int uint
Definition: uca-dump.cc:29