From: Timo Sirainen Date: Sat, 13 Feb 2010 03:44:20 +0000 (+0200) Subject: lib-imap: Added imap_parser_set_streams(). X-Git-Tag: 2.0.beta3~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d09825c4c6acd79a4186e2946bfec28558e54fa;p=thirdparty%2Fdovecot%2Fcore.git lib-imap: Added imap_parser_set_streams(). --HG-- branch : HEAD --- diff --git a/src/lib-imap/imap-parser.c b/src/lib-imap/imap-parser.c index 730f9d4a10..a0e03b49ad 100644 --- a/src/lib-imap/imap-parser.c +++ b/src/lib-imap/imap-parser.c @@ -97,6 +97,13 @@ void imap_parser_reset(struct imap_parser *parser) 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; diff --git a/src/lib-imap/imap-parser.h b/src/lib-imap/imap-parser.h index b9ff84da96..7fb28a329d 100644 --- a/src/lib-imap/imap-parser.h +++ b/src/lib-imap/imap-parser.h @@ -107,6 +107,10 @@ void imap_parser_destroy(struct imap_parser **parser); /* 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. */