Description: Require iconv by default otherwise it builds with no charset support
Author: John-Mark Bell <jmb@netsurf-browser.org>
Applied-Upstream: http://source.netsurf-browser.org/trunk/libparserutils/?revision=12215
Last-Update: 2011-04-21
Index: netsurf-2.7/libparserutils-0.1.0/test/regression/filter-badenc-segv.c
===================================================================
--- netsurf-2.7/libparserutils-0.1.0/test/regression/filter-badenc-segv.c	(revision 12214)
+++ netsurf-2.7/libparserutils-0.1.0/test/regression/filter-badenc-segv.c	(revision 12215)
@@ -20,7 +20,7 @@
 	parserutils_filter_optparams params;
 	parserutils_error expected;
 
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 	expected = PARSERUTILS_OK;
 #else
 	expected = PARSERUTILS_BADENCODING;
Index: netsurf-2.7/libparserutils-0.1.0/Makefile.config
===================================================================
--- netsurf-2.7/libparserutils-0.1.0/Makefile.config	(revision 12214)
+++ netsurf-2.7/libparserutils-0.1.0/Makefile.config	(revision 12215)
@@ -1,7 +1,7 @@
 # Configuration Makefile fragment
 
-# Use iconv directly in the input filter
-# CFLAGS := $(CFLAGS) -DWITH_ICONV_FILTER
+# Disable use of iconv in the input filter
+# CFLAGS := $(CFLAGS) -DWITHOUT_ICONV_FILTER
 
 # Cater for local configuration changes
 -include Makefile.config.override
Index: netsurf-2.7/libparserutils-0.1.0/src/input/filter.c
===================================================================
--- netsurf-2.7/libparserutils-0.1.0/src/input/filter.c	(revision 12214)
+++ netsurf-2.7/libparserutils-0.1.0/src/input/filter.c	(revision 12215)
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 #include <iconv.h>
 #endif
 
@@ -22,7 +22,7 @@
 
 /** Input filter */
 struct parserutils_filter {
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 	iconv_t cd;			/**< Iconv conversion descriptor */
 	uint16_t int_enc;		/**< The internal encoding */
 #else
@@ -73,7 +73,7 @@
 	if (f == NULL)
 		return PARSERUTILS_NOMEM;
 
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 	f->cd = (iconv_t) -1;
 	f->int_enc = parserutils_charset_mibenum_from_name(
 			int_enc, strlen(int_enc));
@@ -96,7 +96,7 @@
 		return error;
 	}
 
-#ifndef WITH_ICONV_FILTER
+#ifdef WITHOUT_ICONV_FILTER
 	error = parserutils_charset_codec_create(int_enc, alloc, pw, 
 			&f->write_codec);
 	if (error != PARSERUTILS_OK) {
@@ -125,7 +125,7 @@
 	if (input == NULL)
 		return PARSERUTILS_BADPARM;
 
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 	if (input->cd != (iconv_t) -1) {
 		iconv_close(input->cd);
 		input->cd = (iconv_t) -1;
@@ -193,7 +193,7 @@
 			output == NULL || *output == NULL || outlen == NULL)
 		return PARSERUTILS_BADPARM;
 
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 	if (iconv(input->cd, (void *) data, len, 
 			(char **) output, outlen) == (size_t) -1) {
 		switch (errno) {
@@ -314,7 +314,7 @@
 	if (input == NULL)
 		return PARSERUTILS_BADPARM;
 
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 	iconv(input->cd, NULL, 0, NULL, 0);
 #else
 	/* Clear pivot buffer leftovers */
@@ -349,7 +349,7 @@
 	if (input == NULL)
 		return PARSERUTILS_BADPARM;
 
-#ifndef WITH_ICONV_FILTER
+#ifdef WITHOUT_ICONV_FILTER
 	input->read_codec = NULL;
 	input->write_codec = NULL;
 #endif
@@ -386,7 +386,7 @@
 	if (input->settings.encoding == mibenum)
 		return PARSERUTILS_OK;
 
-#ifdef WITH_ICONV_FILTER
+#ifndef WITHOUT_ICONV_FILTER
 	if (input->cd != (iconv_t) -1) {
 		iconv_close(input->cd);
 		input->cd = (iconv_t) -1;
Index: netsurf-2.7/libparserutils-0.1.0/README
===================================================================
--- netsurf-2.7/libparserutils-0.1.0/README	(revision 12214)
+++ netsurf-2.7/libparserutils-0.1.0/README	(revision 12215)
@@ -24,8 +24,10 @@
     + Pkg-config (for the testcases)
     + doxygen (for the API documentation)
 
-  For enhanced charset support, LibParserUtils may also be configured to use
-  an iconv() implementation, see the "Enabling iconv() support" section, below.
+  For enhanced charset support, LibParserUtils requires an iconv() 
+  implementation. If you don't have an implementation of iconv(),
+  this requirement may be disabled: see the "Disabling iconv() 
+  support" section, below.
 
 Compilation
 -----------
@@ -100,10 +102,11 @@
 
   The test driver code in test/ may also provide some useful pointers.
 
-Enabling iconv() support
-------------------------
+Disabling iconv() support
+-------------------------
 
-  By default, libparserutils only supports the following character sets:
+  Without iconv() support enabled, libparserutils only supports the 
+  following character sets:
 
     + UTF-16 (platform-native endian)
     + UTF-8
@@ -111,19 +114,10 @@
     + Windows-125n
     + US-ASCII
 
-  Support for more character sets may be enabled through the use of iconv().
-  To enable iconv() support in libparserutils, do the following:
+  To disable iconv() support in libparserutils, do the following:
 
-  		$ echo "CFLAGS += -DWITH_ICONV_FILTER" \
+  		$ echo "CFLAGS += -DWITHOUT_ICONV_FILTER" \
 				>build/Makefile.config.override
 
   Then build libparserutils as normal.
 
-A note on character set aliases
--------------------------------
-
-  Libparserutils uses an external mapping file to encode relationships between
-  character set names. This is the "Aliases" file. A copy may be found at
-  test/data/Aliases. The path to this file is required when calling
-  parserutils_initialise().
-
