From b60816b132df005889c2e563f935bddf110dfcb3 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 2 Apr 1998 12:44:17 +0000 Subject: [PATCH] Update. 1998-04-02 11:45 Ulrich Drepper * localedata/Makefile: Correct testsuite rules. * iconvdata/gconv-modules: Set cost of ISO646 module to 2. * iconvdata/iso646.c: Fix conversion from UCS4. * elf/ldsodefs.h: Mark internal function with internal_function. * elf/dl-addr.c: Likewise. * elf/dl-close.c: Likewise. * elf/dl-debug.c: Likewise. * elf/dl-deps.c: Likewise. * elf/dl-error.c: Likewise. * elf/dl-fini.c: Likewise. * elf/dl-init.c: Likewise. * elf/dl-load.c: Likewise. * elf/dl-lookup.c: Likewise. * elf/dl-object.c: Likewise. * elf/dl-open.c: Likewise. * elf/dl-profile.c: Likewise. * elf/dl-reloc.c: Likewise. * elf/dl-runtime.c: Likewise. * elf/dl-symbol.c: Likewise. * elf/dl-version.c: Likewise. * elf/dlerror.c: Likewise. * sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/i386/dl-machine.h: Likewise. * iconv/gconv_simple.c: New builtins for UCS en/decoding. * iconv/gconv_builtin.c (builtin_map): Define BUILTIN_ALIAS as an --- ChangeLog | 32 +++++++++++++++-- iconvdata/gconv-modules | 8 ++--- iconvdata/iso646.c | 67 +++++++++++++++++++++++++++++------ localedata/Makefile | 8 ++--- sysdeps/unix/sysv/linux/bits/ioctls.h | 2 +- 5 files changed, 95 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 052f2e9..3c06996 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,34 @@ +1998-04-02 11:45 Ulrich Drepper + + * localedata/Makefile: Correct testsuite rules. + + * iconvdata/gconv-modules: Set cost of ISO646 module to 2. + * iconvdata/iso646.c: Fix conversion from UCS4. + + * elf/ldsodefs.h: Mark internal function with internal_function. + * elf/dl-addr.c: Likewise. + * elf/dl-close.c: Likewise. + * elf/dl-debug.c: Likewise. + * elf/dl-deps.c: Likewise. + * elf/dl-error.c: Likewise. + * elf/dl-fini.c: Likewise. + * elf/dl-init.c: Likewise. + * elf/dl-load.c: Likewise. + * elf/dl-lookup.c: Likewise. + * elf/dl-object.c: Likewise. + * elf/dl-open.c: Likewise. + * elf/dl-profile.c: Likewise. + * elf/dl-reloc.c: Likewise. + * elf/dl-runtime.c: Likewise. + * elf/dl-symbol.c: Likewise. + * elf/dl-version.c: Likewise. + * elf/dlerror.c: Likewise. + * sysdeps/generic/dl-sysdep.c: Likewise. + * sysdeps/i386/dl-machine.h: Likewise. + 1998-04-01 17:38 Ulrich Drepper - * iconv/gconv?simple.c: New builtins for UCS en/decoding. + * iconv/gconv_simple.c: New builtins for UCS en/decoding. * iconv/gconv_builtin.h: Add definitions for new builtins. * iconv/gconv.h: Add prototypes for new builtins. @@ -29,7 +57,7 @@ * iconv/gconv_conf.c (builtin_aliases): New variable. (__gconv_read_conf): Add builtin aliases. - * iconv/gconv_builtin.c (builtin_map): Define BUILTIN?ALIAS as an + * iconv/gconv_builtin.c (builtin_map): Define BUILTIN_ALIAS as an noop macro before including gconv_builtin.h. * iconv/gconv_builtin.h: Add alias names. diff --git a/iconvdata/gconv-modules b/iconvdata/gconv-modules index adbf2f0..be03e96 100644 --- a/iconvdata/gconv-modules +++ b/iconvdata/gconv-modules @@ -48,15 +48,15 @@ alias US-ASCII// ANSI_X3.4-1968// alias US// ANSI_X3.4-1968// alias IBM367// ANSI_X3.4-1968// alias CP367// ANSI_X3.4-1968// -module ANSI_X3.4-1968// ISO-10646/UCS4/ ISO646 1 -module ISO-10646/UCS4/ ANSI_X3.4-1968// ISO646 1 +module ANSI_X3.4-1968// ISO-10646/UCS4/ ISO646 2 +module ISO-10646/UCS4/ ANSI_X3.4-1968// ISO646 2 alias ISO-IR-4// BS_4730// alias ISO646-GB// BS_4730// alias GB// BS_4730// alias UK// BS_4730// -module BS_4730// ISO-10646/UCS4/ ISO646 -module ISO-10646/UCS4/ BS_4730// ISO646 +module BS_4730// ISO-10646/UCS4/ ISO646 2 +module ISO-10646/UCS4/ BS_4730// ISO646 2 # from to module cost alias ISO-IR-100// ISO-8859-1// diff --git a/iconvdata/iso646.c b/iconvdata/iso646.c index db0c089..3b4864e 100644 --- a/iconvdata/iso646.c +++ b/iconvdata/iso646.c @@ -18,6 +18,19 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* The implementation of the conversion which can be performed by this + module are not very sophisticated and not tuned at all. There are + zillions of ISO 646 derivates and supporting them all in a separate + module is overkill since these coded character sets are hardly ever + used anymore (except ANSI_X3.4-1968 == ASCII, which is compatible + with ISO 8859-1). The European variants are superceded by the + various ISO 8859-? standards and the Asian variants are embedded in + larger character sets. Therefore this implementation is simply + here to make it possible to do the conversion if it is necessary. + The cost in the gconv-modules file is set to `2' and therefore + allows one to easily provide a tuned implementation in case this + proofs to be necessary. */ + #include #include #include @@ -25,13 +38,14 @@ /* Direction of the transformation. */ enum direction { - illegal, + illegal_dir, to_iso646, from_iso646 }; enum variant { + illegal_var, US, /* ANSI_X3.4-1968 */ GB, /* BS_4730 */ }; @@ -73,10 +87,13 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data) var = GB; } else - dir = illegal; + { + dir = illegal_dir; + var = illegal_var; + } result = GCONV_NOCONV; - if (dir != illegal + if (dir != illegal_dir && ((new_data = (struct iso646_data *) malloc (sizeof (struct iso646_data))) != NULL)) @@ -167,11 +184,16 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, default: *((wchar_t *) (outbuf + outwchars)) = (unsigned char) inbuf[cnt]; + case '\x80' ... '\xff': + /* Illegal character. */ + result = GCONV_ILLEGAL_INPUT; + goto out_from; } ++do_write; outwchars += sizeof (wchar_t); ++cnt; } + out_from: *inbufsize -= cnt; data->outbufavail = outwchars; } @@ -179,24 +201,47 @@ gconv (struct gconv_step *step, struct gconv_step_data *data, { size_t inwchars = *inbufsize; size_t outchars = data->outbufavail; - char *outbuf = data->outbuf; + unsigned char *outbuf = data->outbuf; size_t cnt = 0; while (inwchars >= cnt + sizeof (wchar_t) && outchars < data->outbufsize) { - if (*((wchar_t *) (inbuf + cnt)) >= L'\0' - && *((wchar_t *) (inbuf + cnt)) <= L'\177') - outbuf[outchars] = *((wchar_t *) (inbuf + cnt)); - else - /* Here is where the transliteration would enter the - scene. */ - break; + switch (*((wchar_t *) (inbuf + cnt))) + { + case 0x23: + if (var == GB) + goto out_to; + outbuf[outchars] = 0x23; + break; + case 0x75: + if (var == GB) + goto out_to; + outbuf[outchars] = 0x75; + break; + case 0xa3: + if (var != GB) + goto out_to; + outbuf[outchars] = 0x23; + break; + case 0x203e: + if (var != GB) + goto out_to; + outbuf[outchars] = 0x75; + break; + default: + if (*((wchar_t *) (inbuf + cnt)) > 0x7f) + goto out_to; + outbuf[outchars] = + (unsigned char) *((wchar_t *) (inbuf + cnt)); + break; + } ++do_write; ++outchars; cnt += sizeof (wchar_t); } + out_to: *inbufsize -= cnt; data->outbufavail = outchars; diff --git a/localedata/Makefile b/localedata/Makefile index c014543..dac6620 100644 --- a/localedata/Makefile +++ b/localedata/Makefile @@ -65,11 +65,11 @@ tests: do-collate-test do-tst-fmon do-tst-locale do-tst-rpmatch do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \ $(test-input:.ISO-8859-1=.in) $(SHELL) -e $< $(common-objpfx) $(test-input) -do-tst-fmon: tst-locale.sh $(objpfx)tst-fmon $(ld-test-srcs) +do-tst-fmon: tst-fmon.sh $(objpfx)tst-fmon tst-fmon.data + $(SHELL) -e $< $(common-objpfx) tst-fmon.data +do-tst-locale: tst-locale.sh $(ld-test-srcs) $(SHELL) -e $< $(common-objpfx) -do-tst-locale: tst-locale.sh - $(SHELL) -e $< $(common-objpfx) -do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch +do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-collate-test $(SHELL) -e $< $(common-objpfx) endif diff --git a/sysdeps/unix/sysv/linux/bits/ioctls.h b/sysdeps/unix/sysv/linux/bits/ioctls.h index 7208d3b..c103645 100644 --- a/sysdeps/unix/sysv/linux/bits/ioctls.h +++ b/sysdeps/unix/sysv/linux/bits/ioctls.h @@ -99,7 +99,7 @@ names as their own. Because these are device dependent it is a good idea _NOT_ to issue them to random objects and hope. */ -#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ +#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */ /* * These 16 ioctl calls are protocol private -- 2.7.4