Mercurial > dovecot > core-2.2
view src/plugins/fts/xml2text.c @ 17130:add8c00fb3cc
Updated copyright notices to include year 2014.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 04 Feb 2014 16:23:22 -0500 |
parents | 36ef72481934 |
children | fc40b1a6e962 |
line wrap: on
line source
/* Copyright (c) 2011-2014 Dovecot authors, see the included COPYING file */ #include "lib.h" #include "message-parser.h" #include "fts-parser.h" #include <unistd.h> int main(void) { struct fts_parser *parser; unsigned char buf[IO_BLOCK_SIZE]; struct message_block block; ssize_t ret; lib_init(); parser = fts_parser_html.try_init(NULL, "text/html", NULL); i_assert(parser != NULL); memset(&block, 0, sizeof(block)); while ((ret = read(STDIN_FILENO, buf, sizeof(buf))) > 0) { block.data = buf; block.size = ret; parser->v.more(parser, &block); write(STDOUT_FILENO, block.data, block.size); } for (;;) { block.size = 0; parser->v.more(parser, &block); if (block.size == 0) break; write(STDOUT_FILENO, block.data, block.size); } lib_deinit(); }