00001 /* Copyright (C) 2000 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 /* readline for batch mode */ 00018 00019 typedef struct st_line_buffer 00020 { 00021 File file; 00022 char *buffer; /* The buffer itself, grown as needed. */ 00023 char *end; /* Pointer at buffer end */ 00024 char *start_of_line,*end_of_line; 00025 uint bufread; /* Number of bytes to get with each read(). */ 00026 uint eof; 00027 ulong max_size; 00028 ulong read_length; /* Length of last read string */ 00029 } LINE_BUFFER; 00030 00031 extern LINE_BUFFER *batch_readline_init(ulong max_size,FILE *file); 00032 extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, my_string str); 00033 extern char *batch_readline(LINE_BUFFER *buffer); 00034 extern void batch_readline_end(LINE_BUFFER *buffer);
1.4.7

