From 9c45d9ad13fdf439d44d7443ae75da15ea0223ed Mon Sep 17 00:00:00 2001 From: Sam Varshavchik Date: Mon, 19 Aug 2013 16:39:41 -0400 Subject: Initial checkin Imported from subversion report, converted to git. Updated all paths in scripts and makefiles, reflecting the new directory hierarchy. --- sqwebmail/testhtml.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sqwebmail/testhtml.c (limited to 'sqwebmail/testhtml.c') diff --git a/sqwebmail/testhtml.c b/sqwebmail/testhtml.c new file mode 100644 index 0000000..aa7572f --- /dev/null +++ b/sqwebmail/testhtml.c @@ -0,0 +1,46 @@ +#include "html.h" + +#include +#include + +static void write_stdout(const unicode_char *uc, size_t n, void *dummy) +{ + while (n) + { + putchar(*uc++); + --n; + } +} + +static char *cid_func(const char *cid, void *dummy) +{ + return strdup(cid); +} + +int main(int argc, char **argv) +{ + struct htmlfilter_info *p; + char buf[1024]; + unicode_char ubuf[1024]; + size_t n; + + p=htmlfilter_alloc(write_stdout, NULL); + + htmlfilter_set_http_prefix(p, "http://redirect?"); + htmlfilter_set_mailto_prefix(p, "http://mailto?"); + htmlfilter_set_convertcid(p, cid_func, NULL); + + while (fgets(buf, sizeof(buf), stdin) != NULL) + { + size_t i; + + n=strlen(buf); + + for (i=0; i