~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/my_readline.h

  • Committer: Stewart Smith
  • Date: 2008-07-13 06:56:15 UTC
  • mto: (210.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 211.
  • Revision ID: stewart@flamingspork.com-20080713065615-vzok75kgnnviokl9
Move MD5() into a UDF

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
   along with this program; if not, write to the Free Software
14
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
 
#ifndef CLIENT_LINEBUFFER_H
17
 
#define CLIENT_LINEBUFFER_H
18
 
 
19
 
#include <vector>
20
 
#include <sstream>
21
 
 
22
 
class LineBuffer
 
16
/* readline for batch mode */
 
17
 
 
18
typedef struct st_line_buffer
23
19
{
24
 
public:
25
 
  LineBuffer(uint32_t max_size,FILE *file);
26
 
 
27
 
  void addString(const std::string &argument);
28
 
  char *readline();
29
 
private:
30
 
  FILE *file;
31
 
  std::stringstream buffer;
32
 
  std::vector<char> line;
33
 
  uint32_t max_size;
34
 
  bool eof;
35
 
};
36
 
 
37
 
#endif /* CLIENT_LINEBUFFER_H */
 
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);