changeset 10697:e0e6d941941c HEAD

lib-imap: Added imap_parser_set_streams().
author Timo Sirainen <tss@iki.fi>
date Sat, 13 Feb 2010 05:44:20 +0200
parents 57814e99b451
children 15feca627630
files src/lib-imap/imap-parser.c src/lib-imap/imap-parser.h
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-imap/imap-parser.c	Sat Feb 13 05:44:09 2010 +0200
+++ b/src/lib-imap/imap-parser.c	Sat Feb 13 05:44:20 2010 +0200
@@ -97,6 +97,13 @@
 	parser->literal_size_return = FALSE;
 }
 
+void imap_parser_set_streams(struct imap_parser *parser, struct istream *input,
+			     struct ostream *output)
+{
+	parser->input = input;
+	parser->output = output;
+}
+
 const char *imap_parser_get_error(struct imap_parser *parser, bool *fatal)
 {
         *fatal = parser->fatal_error;
--- a/src/lib-imap/imap-parser.h	Sat Feb 13 05:44:09 2010 +0200
+++ b/src/lib-imap/imap-parser.h	Sat Feb 13 05:44:20 2010 +0200
@@ -107,6 +107,10 @@
 /* Reset the parser to initial state. */
 void imap_parser_reset(struct imap_parser *parser);
 
+/* Change parser's input and output streams */
+void imap_parser_set_streams(struct imap_parser *parser, struct istream *input,
+			     struct ostream *output);
+
 /* Return the last error in parser. fatal is set to TRUE if there's no way to
    continue parsing, currently only if too large non-sync literal size was
    given. */