~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/my_readline.h

  • Committer: Brian Aker
  • Date: 2009-05-26 20:45:27 UTC
  • mto: This revision was merged to the branch mainline in revision 1040.
  • Revision ID: brian@gaz-20090526204527-27uxzwkkitgoxjaz
Bits of dead code.

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
 
 
17
typedef struct st_line_buffer
26
18
{
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;
 
19
  File file;
 
20
  char *buffer;                 /* The buffer itself, grown as needed. */
 
21
  char *end;                    /* Pointer at buffer end */
 
22
  char *start_of_line,*end_of_line;
 
23
  uint32_t bufread;                     /* Number of bytes to get with each read(). */
 
24
  uint32_t eof;
35
25
  uint32_t max_size;
36
 
};
 
26
  uint32_t read_length;         /* Length of last read string */
 
27
} LINE_BUFFER;
37
28
 
38
 
#endif /* CLIENT_LINEBUFFER_H */
 
29
extern LINE_BUFFER *batch_readline_init(uint32_t max_size,FILE *file);
 
30
extern LINE_BUFFER *batch_readline_command(LINE_BUFFER *buffer, char * str);
 
31
extern char *batch_readline(LINE_BUFFER *buffer);
 
32
extern void batch_readline_end(LINE_BUFFER *buffer);