diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-04-13 15:01:09 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-04-13 15:01:09 +0000 |
commit | 2b47435322f026277a936c039c6ea45b975c2876 (patch) | |
tree | f6984d4da34bb384cbb74f637e75907789d3e523 /iconvdata/jis0208.h | |
parent | 40b4c81d4ec13a7a5acdeb1288f1d897b511b36c (diff) | |
download | glibc-2b47435322f026277a936c039c6ea45b975c2876.tar.gz |
Update.
1998-04-13 14:52 Ulrich Drepper <drepper@cygnus.com>
* iconvdata/cns11643.c: New file.
* iconvdata/cns11643.h: New file.
* iconvdata/cns11643l1.c: New file.
* iconvdata/cns11643l1.h: New file.
* iconvdata/euctw.c: New file.
* iconvdata/Makefile: Add rules for EUC-TW and CNS.
* iconvdata/gconv-modules: Likewise.
* iconvdata/eucjp.c: Several bug fixes and improvements.
* iconvdata/gb2312.h: Likewise.
* iconvdata/jis0201.h: Likewise.
* iconvdata/jis0208.h: Likewise.
* iconvdata/jis0212.h: Likewise.
Diffstat (limited to 'iconvdata/jis0208.h')
-rw-r--r-- | iconvdata/jis0208.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/iconvdata/jis0208.h b/iconvdata/jis0208.h index 7a4d8cd63f..9c90cf9071 100644 --- a/iconvdata/jis0208.h +++ b/iconvdata/jis0208.h @@ -1,5 +1,5 @@ /* Access functions for JISX0208 conversion. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -43,23 +43,23 @@ struct jisx0208_ucs_idx static inline wchar_t -jisx0208_to_ucs4 (char **s, size_t avail) +jisx0208_to_ucs4 (const char **s, size_t avail, unsigned char offset) { unsigned char ch = *(*s); unsigned char ch2; int idx; - if (ch <= 0x20 || ch > 0xea) + if (ch < offset || (ch - offset) <= 0x20 || (ch - offset) > 0xea) return UNKNOWN_10646_CHAR; if (avail < 2) return 0; ch2 = (*s)[1]; - if (ch2 <= 0x20 || ch2 >= 0x7f) + if (ch2 < offset || (ch2 - offset) <= 0x20 || (ch2 - offset) >= 0x7f) return UNKNOWN_10646_CHAR; - idx = (ch - 0x21) * 94 + (ch2 - 0x21); + idx = (ch - 0x21 - offset) * 94 + (ch2 - 0x21 - offset); if (idx >= 0x1e80) return UNKNOWN_10646_CHAR; @@ -70,7 +70,7 @@ jisx0208_to_ucs4 (char **s, size_t avail) static inline size_t -ucs4_to_jisx0208 (wchar_t wch, char **s, size_t avail) +ucs4_to_jisx0208 (wchar_t wch, char *s, size_t avail) { unsigned int ch = (unsigned int) wch; const char *cp = NULL; @@ -95,8 +95,8 @@ ucs4_to_jisx0208 (wchar_t wch, char **s, size_t avail) if (cp == NULL || cp[0] == '\0') return UNKNOWN_10646_CHAR; - *(*s)++ = cp[0]; - *(*s)++ = cp[1]; + s[0] = cp[0]; + s[1] = cp[1]; return 2; } |