MySQL  8.0.17
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, 2018, Oracle and/or its affiliates. All rights reserved.
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 
33 struct LINE_BUFFER {
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(). */
41  ulong read_length; /* Length of last read string */
42  int error;
43  bool truncated;
44 };
45 
46 extern LINE_BUFFER *batch_readline_init(ulong max_size, FILE *file);
48 extern char *batch_readline(LINE_BUFFER *buffer, bool binary_mode);
50 
51 static const unsigned long int batch_io_size = 16 * 1024 * 1024;
52 
53 #endif /* CLIENT_MY_READLINE_INCLUDED */
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 * buffer
Definition: my_readline.h:35
char buffer[STRING_BUFFER]
Definition: test_sql_9_sessions.cc:57
Some integer typedefs for easier portability.
ulong max_size
Definition: my_readline.h:40
int error
Definition: my_readline.h:42
LINE_BUFFER * batch_readline_init(ulong max_size, FILE *file)
Definition: readline.cc:46
const std::string FILE("FILE")
ulong read_length
Definition: my_readline.h:41
char * batch_readline(LINE_BUFFER *buffer, bool binary_mode)
Definition: readline.cc:68
Definition: my_readline.h:33
char * end
Definition: my_readline.h:36
unsigned int uint
Definition: uca-dump.cc:29
int File
Definition: my_io_bits.h:50
char * end_of_line
Definition: my_readline.h:37
File file
Definition: my_readline.h:34
bool truncated
Definition: my_readline.h:43
Common #defines and includes for file and socket I/O.
void batch_readline_end(LINE_BUFFER *buffer)
Definition: readline.cc:101
char * start_of_line
Definition: my_readline.h:37
uint eof
Definition: my_readline.h:39
unsigned long ulong
Definition: my_inttypes.h:48
uint bufread
Definition: my_readline.h:38