diff options
author | James Bursa <james@netsurf-browser.org> | 2003-02-09 12:58:15 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2003-02-09 12:58:15 +0000 |
commit | a4c5929a2fac1cb0c039b2d009d8093ac81a90d7 (patch) | |
tree | 710bf4247d92ec63df7c92815c5360ec907a4b66 /render/textplain.c | |
parent | 948dfeb1c2404e6bdad8c20c83a26f3eecb3764a (diff) | |
download | netsurf-a4c5929a2fac1cb0c039b2d009d8093ac81a90d7.tar.gz netsurf-a4c5929a2fac1cb0c039b2d009d8093ac81a90d7.tar.bz2 |
[project @ 2003-02-09 12:58:14 by bursa]
Reorganization and rewrite of fetch, cache, and content handling.
svn path=/import/netsurf/; revision=96
Diffstat (limited to 'render/textplain.c')
-rw-r--r-- | render/textplain.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/render/textplain.c b/render/textplain.c new file mode 100644 index 000000000..c5407c6f5 --- /dev/null +++ b/render/textplain.c @@ -0,0 +1,52 @@ +/** + * $Id: textplain.c,v 1.1 2003/02/09 12:58:15 bursa Exp $ + */ + +#include <assert.h> +#include <string.h> +#include <stdlib.h> +#include "libxml/HTMLparser.h" +#include "netsurf/render/html.h" +#include "netsurf/render/textplain.h" + + +static const char header[] = "<html><body><pre>"; +static const char footer[] = "</pre></body></html>"; + + +void textplain_create(struct content *c) +{ + html_create(c); + htmlParseChunk(c->data.html.parser, header, sizeof(header), 0); +} + + +void textplain_process_data(struct content *c, char *data, unsigned long size) +{ + html_process_data(c, data, size); +} + + +int textplain_convert(struct content *c, unsigned int width, unsigned int height) +{ + htmlParseChunk(c->data.html.parser, footer, sizeof(footer), 0); + return html_convert(c, width, height); +} + + +void textplain_revive(struct content *c, unsigned int width, unsigned int height) +{ + html_revive(c, width, height); +} + + +void textplain_reformat(struct content *c, unsigned int width, unsigned int height) +{ + html_reformat(c, width, height); +} + + +void textplain_destroy(struct content *c) +{ + html_destroy(c); +} |