1
by brian
clean slate |
1 |
/* Copyright (C) 2000 MySQL AB
|
2 |
||
3 |
This program is free software; you can redistribute it and/or modify
|
|
4 |
it under the terms of the GNU General Public License as published by
|
|
5 |
the Free Software Foundation; version 2 of the License.
|
|
6 |
||
7 |
This program is distributed in the hope that it will be useful,
|
|
8 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10 |
GNU General Public License for more details.
|
|
11 |
||
12 |
You should have received a copy of the GNU General Public License
|
|
13 |
along with this program; if not, write to the Free Software
|
|
14 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
15 |
||
16 |
/* readline for batch mode */
|
|
17 |
||
18 |
typedef struct st_line_buffer |
|
19 |
{
|
|
20 |
File file; |
|
21 |
char *buffer; /* The buffer itself, grown as needed. */ |
|
22 |
char *end; /* Pointer at buffer end */ |
|
23 |
char *start_of_line,*end_of_line; |
|
24 |
uint bufread; /* Number of bytes to get with each read(). */ |
|
25 |
uint eof; |
|
26 |
ulong max_size; |
|
27 |
ulong read_length; /* Length of last read string */ |
|
28 |
} LINE_BUFFER; |
|
29 |
||
30 |
extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file); |
|
31 |
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str); |
|
32 |
extern char *batch_readline(LINE_BUFFER *buffer); |
|
33 |
extern void batch_readline_end(LINE_BUFFER *buffer); |