summaryrefslogtreecommitdiff
path: root/www/htmlcxx/patches/patch-html_CharsetConverter.cc
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2014-02-16 22:58:51 +0000
committerwiz <wiz@pkgsrc.org>2014-02-16 22:58:51 +0000
commitc7cd6409088db0ec4f20f7b297deb0e187635d79 (patch)
tree3b311d1307f107d671922b85898f92fd11ca26e4 /www/htmlcxx/patches/patch-html_CharsetConverter.cc
parenta3a2a0953bbded621d965b3d4d2af026039fdbba (diff)
downloadpkgsrc-c7cd6409088db0ec4f20f7b297deb0e187635d79.tar.gz
Import htmlcxx-0.85 as www/htmlcxx.
htmlcxx is a simple non-validating CSS1 and HTML parser for C++. Although there are several other HTML parsers available, htmlcxx has some characteristics that make it unique: * STL like navigation of DOM tree, using the excellent tree.hh library from Kasper Peeters * It is possible to reproduce exactly, character by character, the original document from the parse tree * Bundled css parser * Optional parsing of attributes * C++ code that looks like C++ (not so true anymore) * Offsets of tags/elements in the original document are stored in the nodes of the DOM tree The parsing politics of htmlcxx were created trying to mimic Mozilla Firefox behavior. So you should expect parse trees similar to those create by Firefox. However, differently from Firefox, htmlcxx does not insert non-existent stuff in your html. Therefore, serializing the DOM tree gives exactly the same bytes contained in the original HTML document.
Diffstat (limited to 'www/htmlcxx/patches/patch-html_CharsetConverter.cc')
-rw-r--r--www/htmlcxx/patches/patch-html_CharsetConverter.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/www/htmlcxx/patches/patch-html_CharsetConverter.cc b/www/htmlcxx/patches/patch-html_CharsetConverter.cc
new file mode 100644
index 00000000000..72dc5fa8a12
--- /dev/null
+++ b/www/htmlcxx/patches/patch-html_CharsetConverter.cc
@@ -0,0 +1,15 @@
+$NetBSD: patch-html_CharsetConverter.cc,v 1.1 2014/02/16 22:58:51 wiz Exp $
+
+Fix build on NetBSD.
+
+--- html/CharsetConverter.cc.orig 2011-05-15 17:32:10.000000000 +0000
++++ html/CharsetConverter.cc
+@@ -37,7 +37,7 @@ string CharsetConverter::convert(const s
+
+ size_t ret;
+ while (1) {
+- ret = iconv(mIconvDescriptor, const_cast<char**>(&inbuf), &inbytesleft, &outbuf, &outbytesleft);
++ ret = iconv(mIconvDescriptor, (const char**)(&inbuf), &inbytesleft, &outbuf, &outbytesleft);
+ if (ret == 0) break;
+ if (ret == (size_t)-1 && errno == E2BIG) return string();
+