1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
1998-04-02 11:45  Ulrich Drepper  <drepper@cygnus.com>

	* 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
This commit is contained in:
Ulrich Drepper
1998-04-02 12:44:17 +00:00
parent d2374599d4
commit b60816b132
5 changed files with 95 additions and 22 deletions

View File

@ -1,6 +1,34 @@
1998-04-02 11:45 Ulrich Drepper <drepper@cygnus.com>
* 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 <drepper@cygnus.com> 1998-04-01 17:38 Ulrich Drepper <drepper@cygnus.com>
* 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_builtin.h: Add definitions for new builtins.
* iconv/gconv.h: Add prototypes for new builtins. * iconv/gconv.h: Add prototypes for new builtins.
@ -29,7 +57,7 @@
* iconv/gconv_conf.c (builtin_aliases): New variable. * iconv/gconv_conf.c (builtin_aliases): New variable.
(__gconv_read_conf): Add builtin aliases. (__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. noop macro before including gconv_builtin.h.
* iconv/gconv_builtin.h: Add alias names. * iconv/gconv_builtin.h: Add alias names.

View File

@ -48,15 +48,15 @@ alias US-ASCII// ANSI_X3.4-1968//
alias US// ANSI_X3.4-1968// alias US// ANSI_X3.4-1968//
alias IBM367// ANSI_X3.4-1968// alias IBM367// ANSI_X3.4-1968//
alias CP367// ANSI_X3.4-1968// alias CP367// ANSI_X3.4-1968//
module ANSI_X3.4-1968// ISO-10646/UCS4/ ISO646 1 module ANSI_X3.4-1968// ISO-10646/UCS4/ ISO646 2
module ISO-10646/UCS4/ ANSI_X3.4-1968// ISO646 1 module ISO-10646/UCS4/ ANSI_X3.4-1968// ISO646 2
alias ISO-IR-4// BS_4730// alias ISO-IR-4// BS_4730//
alias ISO646-GB// BS_4730// alias ISO646-GB// BS_4730//
alias GB// BS_4730// alias GB// BS_4730//
alias UK// BS_4730// alias UK// BS_4730//
module BS_4730// ISO-10646/UCS4/ ISO646 module BS_4730// ISO-10646/UCS4/ ISO646 2
module ISO-10646/UCS4/ BS_4730// ISO646 module ISO-10646/UCS4/ BS_4730// ISO646 2
# from to module cost # from to module cost
alias ISO-IR-100// ISO-8859-1// alias ISO-IR-100// ISO-8859-1//

View File

@ -18,6 +18,19 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ 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 <gconv.h> #include <gconv.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -25,13 +38,14 @@
/* Direction of the transformation. */ /* Direction of the transformation. */
enum direction enum direction
{ {
illegal, illegal_dir,
to_iso646, to_iso646,
from_iso646 from_iso646
}; };
enum variant enum variant
{ {
illegal_var,
US, /* ANSI_X3.4-1968 */ US, /* ANSI_X3.4-1968 */
GB, /* BS_4730 */ GB, /* BS_4730 */
}; };
@ -73,10 +87,13 @@ gconv_init (struct gconv_step *step, struct gconv_step_data *data)
var = GB; var = GB;
} }
else else
dir = illegal; {
dir = illegal_dir;
var = illegal_var;
}
result = GCONV_NOCONV; result = GCONV_NOCONV;
if (dir != illegal if (dir != illegal_dir
&& ((new_data && ((new_data
= (struct iso646_data *) malloc (sizeof (struct iso646_data))) = (struct iso646_data *) malloc (sizeof (struct iso646_data)))
!= NULL)) != NULL))
@ -167,11 +184,16 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
default: default:
*((wchar_t *) (outbuf + outwchars)) = *((wchar_t *) (outbuf + outwchars)) =
(unsigned char) inbuf[cnt]; (unsigned char) inbuf[cnt];
case '\x80' ... '\xff':
/* Illegal character. */
result = GCONV_ILLEGAL_INPUT;
goto out_from;
} }
++do_write; ++do_write;
outwchars += sizeof (wchar_t); outwchars += sizeof (wchar_t);
++cnt; ++cnt;
} }
out_from:
*inbufsize -= cnt; *inbufsize -= cnt;
data->outbufavail = outwchars; data->outbufavail = outwchars;
} }
@ -179,24 +201,47 @@ gconv (struct gconv_step *step, struct gconv_step_data *data,
{ {
size_t inwchars = *inbufsize; size_t inwchars = *inbufsize;
size_t outchars = data->outbufavail; size_t outchars = data->outbufavail;
char *outbuf = data->outbuf; unsigned char *outbuf = data->outbuf;
size_t cnt = 0; size_t cnt = 0;
while (inwchars >= cnt + sizeof (wchar_t) while (inwchars >= cnt + sizeof (wchar_t)
&& outchars < data->outbufsize) && outchars < data->outbufsize)
{ {
if (*((wchar_t *) (inbuf + cnt)) >= L'\0' switch (*((wchar_t *) (inbuf + cnt)))
&& *((wchar_t *) (inbuf + cnt)) <= L'\177') {
outbuf[outchars] = *((wchar_t *) (inbuf + cnt)); case 0x23:
else if (var == GB)
/* Here is where the transliteration would enter the goto out_to;
scene. */ outbuf[outchars] = 0x23;
break; 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; ++do_write;
++outchars; ++outchars;
cnt += sizeof (wchar_t); cnt += sizeof (wchar_t);
} }
out_to:
*inbufsize -= cnt; *inbufsize -= cnt;
data->outbufavail = outchars; data->outbufavail = outchars;

View File

@ -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 \ do-collate-test: sort-test.sh $(objpfx)collate-test $(objpfx)xfrm-test \
$(test-input:.ISO-8859-1=.in) $(test-input:.ISO-8859-1=.in)
$(SHELL) -e $< $(common-objpfx) $(test-input) $(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) $(SHELL) -e $< $(common-objpfx)
do-tst-locale: tst-locale.sh do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch do-collate-test
$(SHELL) -e $< $(common-objpfx)
do-tst-rpmatch: tst-rpmatch.sh $(objpfx)tst-rpmatch
$(SHELL) -e $< $(common-objpfx) $(SHELL) -e $< $(common-objpfx)
endif endif

View File

@ -99,7 +99,7 @@
names as their own. Because these are device dependent it is a good names as their own. Because these are device dependent it is a good
idea _NOT_ to issue them to random objects and hope. */ 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 * These 16 ioctl calls are protocol private