~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/my_readline.h

  • Committer: Monty Taylor
  • Date: 2008-11-16 05:36:13 UTC
  • mto: (584.1.9 devel)
  • mto: This revision was merged to the branch mainline in revision 589.
  • Revision ID: monty@inaugust.com-20081116053613-bld4rqxhlkb49c02
Split out cache_row and type_holder.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
 
 
16
 
#ifndef CLIENT_LINEBUFFER_H
17
 
#define CLIENT_LINEBUFFER_H
18
 
 
19
 
#include <vector>
20
 
#include <sstream>
21
 
#include <iostream>
22
 
#include <boost/iostreams/stream.hpp>
23
 
#include <boost/iostreams/device/file_descriptor.hpp>
24
 
 
25
 
class LineBuffer
 
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
26
19
{
27
 
public:
28
 
  LineBuffer(uint32_t max_size,FILE *file);
29
 
  void addString(const std::string &argument);
30
 
  char *readline();
31
 
private:
32
 
  FILE *file;
33
 
  std::vector<char> line;
34
 
  std::iostream *file_stream;
 
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;
35
26
  uint32_t max_size;
36
 
};
 
27
  uint32_t read_length;         /* Length of last read string */
 
28
} LINE_BUFFER;
37
29
 
38
 
#endif /* CLIENT_LINEBUFFER_H */
 
30
extern LINE_BUFFER *batch_readline_init(uint32_t 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);