MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
my_readline.h
1 #ifndef CLIENT_MY_READLINE_INCLUDED
2 #define CLIENT_MY_READLINE_INCLUDED
3 
4 /*
5  Copyright (c) 2000, 2011, 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 as published by
9  the Free Software Foundation; version 2 of the License.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 /* readline for batch mode */
22 
23 typedef struct st_line_buffer
24 {
25  File file;
26  char *buffer; /* The buffer itself, grown as needed. */
27  char *end; /* Pointer at buffer end */
28  char *start_of_line,*end_of_line;
29  uint bufread; /* Number of bytes to get with each read(). */
30  uint eof;
31  ulong max_size;
32  ulong read_length; /* Length of last read string */
33  int error;
34  bool truncated;
35 } LINE_BUFFER;
36 
37 extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file);
38 extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
39 extern char *batch_readline(LINE_BUFFER *buffer, bool binary_mode);
40 extern void batch_readline_end(LINE_BUFFER *buffer);
41 
42 #endif /* CLIENT_MY_READLINE_INCLUDED */