diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-09-13 09:12:02 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-09-13 09:12:02 +0000 |
commit | c0d99958f9f329400d25040b3d422fa937522b65 (patch) | |
tree | 2c9b3c78d4ee07ffb167b2112e89eff799dc509f /iconvdata/iso-ir-165.h | |
parent | 875fc7830131521c46413a69543d962b5337d6ca (diff) | |
download | glibc-c0d99958f9f329400d25040b3d422fa937522b65.zip glibc-c0d99958f9f329400d25040b3d422fa937522b65.tar.gz glibc-c0d99958f9f329400d25040b3d422fa937522b65.tar.bz2 |
Update.
* iconvdata/Makefile (modules): Add ISO-2022-CN-EXT.
(distribute): Add iso-2022-cn-ext.c.
Add definitions to compile the new module.
* iconvdata/gconv-modules: Add entries for ISO-2022-CN-EXT.
* iconvdata/iso-2022-cn-ext.c: New file.
* iconvdata/iso-ir-165.h (isoir165_to_ucs4): Renamed from
ucs4_from_isoir165. Increment input pointer if successful.
Diffstat (limited to 'iconvdata/iso-ir-165.h')
-rw-r--r-- | iconvdata/iso-ir-165.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/iconvdata/iso-ir-165.h b/iconvdata/iso-ir-165.h index 062661d..21655fa 100644 --- a/iconvdata/iso-ir-165.h +++ b/iconvdata/iso-ir-165.h @@ -40,10 +40,11 @@ extern const uint16_t __isoir165_to_tab[ISOIR165_FROMSIZE]; /* XXX If we at some point need an offset value to decode the byte sequences another parameter can be added. */ static inline uint32_t -ucs4_from_isoir165 (const char **s, size_t avail) +isoir165_to_ucs4 (const unsigned char **s, size_t avail) { unsigned char ch = *(*s); unsigned char ch2; + uint32_t res; if (ch <= 0x20 || ch >= 0x7f) return __UNKNOWN_10646_CHAR; @@ -55,8 +56,12 @@ ucs4_from_isoir165 (const char **s, size_t avail) if (ch2 <= 0x20 || ch2 >= 0x7f) return __UNKNOWN_10646_CHAR; - return (__isoir165_to_tab[(ch - 0x21) * 94 + (ch2 - 0x21)] - ?: __UNKNOWN_10646_CHAR); + res = __isoir165_to_tab[(ch - 0x21) * 94 + (ch2 - 0x21)]; + if (res == 0) + return __UNKNOWN_10646_CHAR; + + *s += 2; + return res; } |