1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

Update environ_locale_charset gnulib patch

* gnulib-local/lib/localcharset.c.diff: Update to apply to current
  gnulib.  Lots of code duplication now, but oh well.
* lib/localcharset.c (environ_locale_charset): Update.
* lib/iconv_open-solaris.h:
* lib/iconv_open-osf.h:
* lib/iconv_open-irix.h:
* lib/iconv_open-hpux.h:
* lib/iconv_open-aix.h: Regenerate with gperf 3.1.
This commit is contained in:
Andy Wingo 2021-01-20 22:34:44 +01:00
parent a91b95cca2
commit 86e7a8b12b
7 changed files with 428 additions and 364 deletions

View file

@ -5,7 +5,7 @@ rationale.
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -544,3 +544,73 @@ locale_charset (void)
@@ -544,3 +544,120 @@ locale_charset (void)
return codeset;
}
@ -60,15 +60,62 @@ rationale.
+ codeset = "";
+
+ /* Resolve alias. */
+ for (aliases = get_charset_aliases ();
+ *aliases != '\0';
+ aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
+ if (strcmp (codeset, aliases) == 0
+ || (aliases[0] == '*' && aliases[1] == '\0'))
+ {
+# ifdef alias_table_defined
+ /* On some platforms, UTF-8 locales are the most frequently used ones.
+ Speed up the common case and slow down the less common cases by
+ testing for this case first. */
+# if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
+ if (strcmp (codeset, "UTF-8") == 0)
+ goto done_table_lookup;
+ else
+# endif
+ {
+ codeset = aliases + strlen (aliases) + 1;
+ break;
+ const struct table_entry * const table = alias_table;
+ size_t const table_size =
+ sizeof (alias_table) / sizeof (struct table_entry);
+ /* The table is sorted. Perform a binary search. */
+ size_t hi = table_size;
+ size_t lo = 0;
+ while (lo < hi)
+ {
+ /* Invariant:
+ for i < lo, strcmp (table[i].alias, codeset) < 0,
+ for i >= hi, strcmp (table[i].alias, codeset) > 0. */
+ size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+ int cmp = strcmp (table[mid].alias, codeset);
+ if (cmp < 0)
+ lo = mid + 1;
+ else if (cmp > 0)
+ hi = mid;
+ else
+ {
+ /* Found an i with
+ strcmp (table[i].alias, codeset) == 0. */
+ codeset = table[mid].canonical;
+ goto done_table_lookup;
+ }
+ }
+ }
+ if (0)
+ done_table_lookup: ;
+ else
+# endif
+ {
+ /* Did not find it in the table. */
+ /* On Mac OS X, all modern locales use the UTF-8 encoding.
+ BeOS and Haiku have a single locale, and it has UTF-8 encoding. */
+# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
+ codeset = "UTF-8";
+# else
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",
+ thus GNU libiconv would call this function a second time. */
+ if (codeset[0] == '\0')
+ codeset = "ASCII";
+# endif
+ }
+ }
+
+ /* Don't return an empty string. GNU libc and GNU libiconv interpret
+ the empty string as denoting "the locale's character encoding",

View file

@ -1,4 +1,4 @@
/* ANSI-C code produced by gperf version 3.0.3 */
/* ANSI-C code produced by gperf version 3.1 */
/* Command-line: gperf -m 10 ./iconv_open-aix.gperf */
/* Computed positions: -k'4,$' */
@ -26,10 +26,10 @@
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
#endif
#line 1 "./iconv_open-aix.gperf"
#line 17 "./iconv_open-aix.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 32
@ -47,7 +47,7 @@ inline
#endif
#endif
static unsigned int
mapping_hash (register const char *str, register unsigned int len)
mapping_hash (register const char *str, register size_t len)
{
static const unsigned char asso_values[] =
{
@ -156,91 +156,85 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 43 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"},
#line 42 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"},
#line 25 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"},
#line 59 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"},
#line 58 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"},
#line 41 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"},
#line 14 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"},
#line 27 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"},
#line 24 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"},
#line 19 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"},
#line 33 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"},
#line 40 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"},
#line 44 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "big5"},
#line 23 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"},
{-1},
#line 17 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"},
#line 22 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"},
#line 15 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"},
#line 31 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"},
#line 35 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"},
#line 20 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"},
#line 26 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"},
#line 37 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"},
#line 18 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
#line 29 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"},
#line 32 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"},
#line 39 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"},
#line 21 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"},
{-1},
#line 34 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"},
#line 16 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"},
#line 13 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"},
{-1}, {-1},
#line 38 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"},
{-1},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"},
#line 57 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"},
#line 30 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"},
#line 43 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"},
#line 40 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"},
#line 35 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"},
#line 49 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"},
#line 56 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"},
#line 60 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "big5"},
#line 39 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"},
{-1},
#line 33 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"},
#line 38 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"},
#line 31 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"},
#line 47 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"},
#line 51 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"},
#line 36 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"},
#line 42 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"},
#line 53 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"},
#line 34 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
#line 45 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"},
#line 48 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"},
#line 55 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"},
#line 37 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"},
{-1},
#line 50 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"},
#line 32 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"},
#line 29 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"},
{-1}, {-1},
#line 28 "./iconv_open-aix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"}
#line 54 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"},
{-1},
#line 46 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"},
#line 52 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
{-1}, {-1},
#line 44 "./iconv_open-aix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"}
};
#ifdef __GNUC__
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct mapping *
mapping_lookup (register const char *str, register unsigned int len)
mapping_lookup (register const char *str, register size_t len)
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = mapping_hash (str, len);
register unsigned int key = mapping_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
if (key <= MAX_HASH_VALUE)
{
register int o = mappings[key].standard_name;
if (o >= 0)

View file

@ -1,4 +1,4 @@
/* ANSI-C code produced by gperf version 3.0.3 */
/* ANSI-C code produced by gperf version 3.1 */
/* Command-line: gperf -m 10 ./iconv_open-hpux.gperf */
/* Computed positions: -k'4,$' */
@ -26,10 +26,10 @@
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
#endif
#line 1 "./iconv_open-hpux.gperf"
#line 17 "./iconv_open-hpux.gperf"
struct mapping { int standard_name; const char vendor_name[9 + 1]; };
#define TOTAL_KEYWORDS 44
@ -47,7 +47,7 @@ inline
#endif
#endif
static unsigned int
mapping_hash (register const char *str, register unsigned int len)
mapping_hash (register const char *str, register size_t len)
{
static const unsigned char asso_values[] =
{
@ -180,110 +180,104 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 40 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"},
#line 34 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"},
#line 35 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"},
#line 23 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "cp850"},
#line 49 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "tis620"},
#line 38 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"},
#line 16 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"},
#line 53 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"},
#line 13 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"},
#line 19 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"},
#line 39 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"},
#line 54 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "big5"},
#line 25 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp855"},
#line 41 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"},
#line 52 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"},
#line 26 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp857"},
#line 15 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"},
#line 20 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"},
#line 31 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str24, "cp866"},
#line 17 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"},
#line 27 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "cp861"},
#line 32 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "cp869"},
#line 33 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str28, "cp874"},
#line 29 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp864"},
#line 36 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
#line 21 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp437"},
#line 24 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "cp852"},
#line 22 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp775"},
#line 30 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp865"},
#line 51 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"},
#line 14 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"},
#line 55 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "sjis"},
#line 42 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"},
#line 56 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "utf8"},
#line 48 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "kana8"},
#line 43 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "roman8"},
#line 46 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"},
#line 50 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"},
#line 18 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"},
#line 51 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"},
#line 39 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "cp850"},
#line 65 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "tis620"},
#line 54 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"},
#line 32 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"},
#line 69 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"},
#line 29 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"},
#line 35 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"},
#line 55 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"},
#line 70 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "big5"},
#line 41 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "cp855"},
#line 57 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"},
#line 68 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"},
#line 42 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "cp857"},
#line 31 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"},
#line 36 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"},
#line 47 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "cp866"},
#line 33 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"},
#line 43 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "cp861"},
#line 48 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "cp869"},
#line 49 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "cp874"},
#line 45 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "greek8"},
#line 44 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"},
#line 28 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str48, "cp862"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "cp864"},
#line 52 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
#line 37 "./iconv_open-hpux.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"}
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "cp437"},
#line 40 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "cp852"},
#line 38 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "cp775"},
#line 46 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "cp865"},
#line 67 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"},
#line 30 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"},
#line 71 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "sjis"},
#line 58 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"},
#line 72 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "utf8"},
#line 64 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "kana8"},
#line 59 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "roman8"},
#line 62 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"},
#line 66 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"},
#line 34 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"},
#line 63 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"},
#line 61 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "greek8"},
#line 60 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"},
#line 44 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str48, "cp862"},
#line 53 "./iconv_open-hpux.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"}
};
#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct mapping *
mapping_lookup (register const char *str, register unsigned int len)
mapping_lookup (register const char *str, register size_t len)
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = mapping_hash (str, len);
register unsigned int key = mapping_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
if (key <= MAX_HASH_VALUE)
{
register int o = mappings[key].standard_name;
if (o >= 0)

View file

@ -1,4 +1,4 @@
/* ANSI-C code produced by gperf version 3.0.3 */
/* ANSI-C code produced by gperf version 3.1 */
/* Command-line: gperf -m 10 ./iconv_open-irix.gperf */
/* Computed positions: -k'1,$' */
@ -26,10 +26,10 @@
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
#endif
#line 1 "./iconv_open-irix.gperf"
#line 17 "./iconv_open-irix.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 19
@ -47,7 +47,7 @@ inline
#endif
#endif
static unsigned int
mapping_hash (register const char *str, register unsigned int len)
mapping_hash (register const char *str, register size_t len)
{
static const unsigned char asso_values[] =
{
@ -130,60 +130,54 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1},
#line 24 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"},
#line 40 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"},
#line 45 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"},
#line 44 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"},
#line 41 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"},
#line 46 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "sjis"},
#line 33 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"},
#line 38 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
#line 29 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"},
#line 28 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"},
#line 25 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"},
#line 43 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"},
#line 39 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"},
#line 30 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "sjis"},
#line 17 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"},
#line 22 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
#line 13 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"},
#line 27 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"},
#line 23 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"},
#line 14 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"},
#line 26 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"},
#line 21 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"},
#line 20 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"},
#line 19 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"},
#line 18 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"},
#line 16 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"},
#line 15 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"},
#line 42 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"},
#line 37 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"},
#line 36 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"},
#line 35 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"},
#line 34 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"},
#line 32 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"},
#line 31 "./iconv_open-irix.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"}
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"},
#line 47 "./iconv_open-irix.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"}
};
#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct mapping *
mapping_lookup (register const char *str, register unsigned int len)
mapping_lookup (register const char *str, register size_t len)
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = mapping_hash (str, len);
register unsigned int key = mapping_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
if (key <= MAX_HASH_VALUE)
{
register int o = mappings[key].standard_name;
if (o >= 0)

View file

@ -1,4 +1,4 @@
/* ANSI-C code produced by gperf version 3.0.3 */
/* ANSI-C code produced by gperf version 3.1 */
/* Command-line: gperf -m 10 ./iconv_open-osf.gperf */
/* Computed positions: -k'4,$' */
@ -26,10 +26,10 @@
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
#endif
#line 1 "./iconv_open-osf.gperf"
#line 17 "./iconv_open-osf.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 38
@ -47,7 +47,7 @@ inline
#endif
#endif
static unsigned int
mapping_hash (register const char *str, register unsigned int len)
mapping_hash (register const char *str, register size_t len)
{
static const unsigned char asso_values[] =
{
@ -168,101 +168,95 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1}, {-1},
#line 41 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"},
#line 24 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7, "cp775"},
#line 36 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"},
#line 47 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"},
#line 46 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"},
#line 50 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"},
#line 17 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"},
#line 22 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"},
#line 48 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "big5"},
#line 27 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "cp855"},
#line 44 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"},
#line 25 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "cp850"},
#line 31 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "cp865"},
#line 45 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"},
#line 43 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"},
#line 42 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"},
#line 20 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"},
#line 49 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"},
{-1},
#line 21 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"},
#line 19 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"},
#line 18 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
{-1},
#line 28 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str29, "cp857"},
#line 38 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
#line 33 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str31, "cp869"},
#line 35 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"},
#line 32 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str33, "cp866"},
#line 23 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str34, "cp437"},
#line 37 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"},
#line 14 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"},
#line 57 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"},
#line 40 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "cp775"},
#line 52 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"},
#line 63 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"},
#line 62 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"},
#line 66 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"},
#line 33 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"},
#line 38 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"},
#line 64 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "big5"},
#line 43 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "cp855"},
#line 60 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"},
#line 41 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "cp850"},
#line 47 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "cp865"},
#line 61 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"},
#line 59 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"},
#line 58 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"},
#line 36 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"},
#line 65 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"},
{-1},
#line 37 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"},
#line 35 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"},
#line 34 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str38, "cp874"},
#line 26 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str39, "cp852"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
{-1},
#line 44 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "cp857"},
#line 54 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
#line 49 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "cp869"},
#line 51 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"},
#line 48 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "cp866"},
#line 39 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"},
#line 13 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "cp437"},
#line 53 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"},
#line 30 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str42, "cp862"},
#line 16 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
{-1}, {-1},
#line 15 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"},
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"},
#line 56 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"},
#line 50 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "cp874"},
#line 42 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "cp852"},
#line 55 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"},
#line 29 "./iconv_open-osf.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str47, "cp861"}
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"},
#line 46 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "cp862"},
#line 32 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
{-1}, {-1},
#line 31 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"},
#line 45 "./iconv_open-osf.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "cp861"}
};
#ifdef __GNUC__
__inline
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct mapping *
mapping_lookup (register const char *str, register unsigned int len)
mapping_lookup (register const char *str, register size_t len)
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = mapping_hash (str, len);
register unsigned int key = mapping_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
if (key <= MAX_HASH_VALUE)
{
register int o = mappings[key].standard_name;
if (o >= 0)

View file

@ -1,4 +1,4 @@
/* ANSI-C code produced by gperf version 3.0.4 */
/* ANSI-C code produced by gperf version 3.1 */
/* Command-line: gperf -m 10 ./iconv_open-solaris.gperf */
/* Computed positions: -k'10' */
@ -26,10 +26,10 @@
&& ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
/* The character set is not based on ISO-646. */
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
#endif
#line 1 "./iconv_open-solaris.gperf"
#line 17 "./iconv_open-solaris.gperf"
struct mapping { int standard_name; const char vendor_name[10 + 1]; };
#define TOTAL_KEYWORDS 13
@ -47,7 +47,7 @@ inline
#endif
#endif
static unsigned int
mapping_hash (register const char *str, register unsigned int len)
mapping_hash (register const char *str, register size_t len)
{
static const unsigned char asso_values[] =
{
@ -78,7 +78,7 @@ mapping_hash (register const char *str, register unsigned int len)
20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20
};
register int hval = len;
register unsigned int hval = len;
switch (hval)
{
@ -132,49 +132,43 @@ static const struct stringpool_t stringpool_contents =
static const struct mapping mappings[] =
{
{-1}, {-1}, {-1}, {-1}, {-1},
#line 19 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str5, "646"},
#line 30 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"},
#line 18 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str7},
#line 35 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "646"},
#line 46 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"},
#line 34 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7},
{-1}, {-1},
#line 20 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"},
#line 29 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
#line 28 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"},
#line 27 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"},
#line 26 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
#line 25 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"},
#line 24 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"},
#line 23 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"},
#line 22 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"},
#line 21 "./iconv_open-solaris.gperf"
{(int)(long)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"}
#line 36 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"},
#line 45 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
#line 44 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"},
#line 43 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"},
#line 42 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
#line 41 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"},
#line 40 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"},
#line 39 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"},
#line 38 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"},
#line 37 "./iconv_open-solaris.gperf"
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"}
};
#ifdef __GNUC__
__inline
#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__))
#endif
#endif
const struct mapping *
mapping_lookup (register const char *str, register unsigned int len)
mapping_lookup (register const char *str, register size_t len)
{
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
register int key = mapping_hash (str, len);
register unsigned int key = mapping_hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
if (key <= MAX_HASH_VALUE)
{
register int o = mappings[key].standard_name;
if (o >= 0)

View file

@ -1208,15 +1208,62 @@ environ_locale_charset (void)
codeset = "";
/* Resolve alias. */
for (aliases = get_charset_aliases ();
*aliases != '\0';
aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
if (strcmp (codeset, aliases) == 0
|| (aliases[0] == '*' && aliases[1] == '\0'))
{
# ifdef alias_table_defined
/* On some platforms, UTF-8 locales are the most frequently used ones.
Speed up the common case and slow down the less common cases by
testing for this case first. */
# if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
if (strcmp (codeset, "UTF-8") == 0)
goto done_table_lookup;
else
# endif
{
codeset = aliases + strlen (aliases) + 1;
break;
const struct table_entry * const table = alias_table;
size_t const table_size =
sizeof (alias_table) / sizeof (struct table_entry);
/* The table is sorted. Perform a binary search. */
size_t hi = table_size;
size_t lo = 0;
while (lo < hi)
{
/* Invariant:
for i < lo, strcmp (table[i].alias, codeset) < 0,
for i >= hi, strcmp (table[i].alias, codeset) > 0. */
size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
int cmp = strcmp (table[mid].alias, codeset);
if (cmp < 0)
lo = mid + 1;
else if (cmp > 0)
hi = mid;
else
{
/* Found an i with
strcmp (table[i].alias, codeset) == 0. */
codeset = table[mid].canonical;
goto done_table_lookup;
}
}
}
if (0)
done_table_lookup: ;
else
# endif
{
/* Did not find it in the table. */
/* On Mac OS X, all modern locales use the UTF-8 encoding.
BeOS and Haiku have a single locale, and it has UTF-8 encoding. */
# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
codeset = "UTF-8";
# else
/* Don't return an empty string. GNU libc and GNU libiconv interpret
the empty string as denoting "the locale's character encoding",
thus GNU libiconv would call this function a second time. */
if (codeset[0] == '\0')
codeset = "ASCII";
# endif
}
}
/* Don't return an empty string. GNU libc and GNU libiconv interpret
the empty string as denoting "the locale's character encoding",