diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-12-19 12:11:38 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-12-19 12:11:38 +0000 |
commit | 2c6cfe6853a30deb4af842aacc924fa298d0521a (patch) | |
tree | 7fcc409e499bb8e3d96522f7fc2393fc10e53db2 /wcsmbs | |
parent | 3ccb96cd41b38d0159bdf8aad229c3599864c65d (diff) | |
download | glibc-2c6cfe6853a30deb4af842aacc924fa298d0521a.tar.gz glibc-2c6cfe6853a30deb4af842aacc924fa298d0521a.tar.xz glibc-2c6cfe6853a30deb4af842aacc924fa298d0521a.zip |
Updated to fedora-glibc-20051219T1003 cvs/fedora-glibc-2_3_90-19
Diffstat (limited to 'wcsmbs')
-rw-r--r-- | wcsmbs/Makefile | 5 | ||||
-rw-r--r-- | wcsmbs/btowc.c | 22 | ||||
-rw-r--r-- | wcsmbs/mbrtowc.c | 13 | ||||
-rw-r--r-- | wcsmbs/mbsnrtowcs.c | 15 | ||||
-rw-r--r-- | wcsmbs/mbsrtowcs_l.c | 18 | ||||
-rw-r--r-- | wcsmbs/wcrtomb.c | 15 | ||||
-rw-r--r-- | wcsmbs/wcsmbsload.c | 10 | ||||
-rw-r--r-- | wcsmbs/wcsnrtombs.c | 22 | ||||
-rw-r--r-- | wcsmbs/wcsrtombs.c | 22 | ||||
-rw-r--r-- | wcsmbs/wcstol.c | 23 | ||||
-rw-r--r-- | wcsmbs/wcstol_l.c | 30 | ||||
-rw-r--r-- | wcsmbs/wcstoll.c | 25 | ||||
-rw-r--r-- | wcsmbs/wcstoll_l.c | 30 | ||||
-rw-r--r-- | wcsmbs/wcstoul.c | 23 | ||||
-rw-r--r-- | wcsmbs/wcstoul_l.c | 30 | ||||
-rw-r--r-- | wcsmbs/wcstoull.c | 25 | ||||
-rw-r--r-- | wcsmbs/wcstoull_l.c | 31 | ||||
-rw-r--r-- | wcsmbs/wctob.c | 9 |
18 files changed, 316 insertions, 52 deletions
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile index 4aab7e8d89..7446bda89e 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -47,7 +47,7 @@ include ../Rules CFLAGS-wcwidth.c = -I../wctype CFLAGS-wcswidth.c = -I../wctype -strtox-CFLAGS = -I../include -I../stdlib +strtox-CFLAGS = -I../include CFLAGS-wcstol.c = $(strtox-CFLAGS) CFLAGS-wcstoul.c = $(strtox-CFLAGS) CFLAGS-wcstoll.c = $(strtox-CFLAGS) @@ -64,6 +64,9 @@ CFLAGS-wcstold_l.c = $(strtox-CFLAGS) CFLAGS-wcstof_l.c = $(strtox-CFLAGS) CFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2 +# We need to find the default version of strtold_l in stdlib. +CPPFLAGS-wcstold_l.c = -I../stdlib + tst-btowc-ENV = LOCPATH=$(common-objpfx)localedata tst-mbrtowc-ENV = LOCPATH=$(common-objpfx)localedata tst-wcrtomb-ENV = LOCPATH=$(common-objpfx)localedata diff --git a/wcsmbs/btowc.c b/wcsmbs/btowc.c index 6add7ed8bb..6517d4f635 100644 --- a/wcsmbs/btowc.c +++ b/wcsmbs/btowc.c @@ -26,6 +26,8 @@ #include <wcsmbsload.h> #include <limits.h> +#include <sysdep.h> + wint_t __btowc (c) @@ -45,13 +47,17 @@ __btowc (c) /* Get the conversion functions. */ fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); + __gconv_btowc_fct btowc_fct = fcts->towc->__btowc_fct; if (__builtin_expect (fcts->towc_nsteps == 1, 1) - && __builtin_expect (fcts->towc->__btowc_fct != NULL, 1)) + && __builtin_expect (btowc_fct != NULL, 1)) { /* Use the shortcut function. */ - return DL_CALL_FCT (fcts->towc->__btowc_fct, - (fcts->towc, (unsigned char) c)); +#ifdef PTR_DEMANGLE + if (fcts->towc->__shlib_handle != NULL) + PTR_DEMANGLE (btowc_fct); +#endif + return DL_CALL_FCT (btowc_fct, (fcts->towc, (unsigned char) c)); } else { @@ -78,9 +84,13 @@ __btowc (c) /* Create the input string. */ inbuf[0] = c; - status = DL_CALL_FCT (fcts->towc->__fct, - (fcts->towc, &data, &inptr, inptr + 1, - NULL, &dummy, 0, 1)); + __gconv_fct fct = fcts->towc->__fct; +#ifdef PTR_DEMANGLE + if (fcts->towc->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + status = DL_CALL_FCT (fct, (fcts->towc, &data, &inptr, inptr + 1, + NULL, &dummy, 0, 1)); if (status != __GCONV_OK && status != __GCONV_FULL_OUTPUT && status != __GCONV_EMPTY_INPUT) diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c index eb2a312b7c..b534571736 100644 --- a/wcsmbs/mbrtowc.c +++ b/wcsmbs/mbrtowc.c @@ -18,13 +18,14 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <assert.h> #include <dlfcn.h> #include <errno.h> #include <gconv.h> #include <wchar.h> #include <wcsmbsload.h> -#include <assert.h> +#include <sysdep.h> #ifndef EILSEQ # define EILSEQ EINVAL @@ -73,9 +74,13 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) endbuf = inbuf + n; if (__builtin_expect (endbuf < inbuf, 0)) endbuf = (const unsigned char *) ~(uintptr_t) 0; - status = DL_CALL_FCT (fcts->towc->__fct, - (fcts->towc, &data, &inbuf, endbuf, - NULL, &dummy, 0, 1)); + __gconv_fct fct = fcts->towc->__fct; +#ifdef PTR_DEMANGLE + if (fcts->towc->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + status = DL_CALL_FCT (fct, (fcts->towc, &data, &inbuf, endbuf, + NULL, &dummy, 0, 1)); /* There must not be any problems with the conversion but illegal input characters. The output buffer must be large enough, otherwise the diff --git a/wcsmbs/mbsnrtowcs.c b/wcsmbs/mbsnrtowcs.c index ef5ca06e2f..8d0b9d3609 100644 --- a/wcsmbs/mbsnrtowcs.c +++ b/wcsmbs/mbsnrtowcs.c @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <assert.h> #include <dlfcn.h> #include <errno.h> #include <gconv.h> @@ -24,7 +25,7 @@ #include <wchar.h> #include <wcsmbsload.h> -#include <assert.h> +#include <sysdep.h> #ifndef EILSEQ # define EILSEQ EINVAL @@ -69,6 +70,11 @@ __mbsnrtowcs (dst, src, nmc, len, ps) /* Get the structure with the function pointers. */ towc = fcts->towc; + __gconv_fct fct = towc->__fct; +#ifdef PTR_DEMANGLE + if (towc->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif /* We have to handle DST == NULL special. */ if (dst == NULL) @@ -82,9 +88,8 @@ __mbsnrtowcs (dst, src, nmc, len, ps) { data.__outbuf = (unsigned char *) buf; - status = DL_CALL_FCT (towc->__fct, - (towc, &data, &inbuf, srcend, NULL, - &dummy, 0, 1)); + status = DL_CALL_FCT (fct, (towc, &data, &inbuf, srcend, NULL, + &dummy, 0, 1)); result += (wchar_t *) data.__outbuf - buf; } @@ -103,7 +108,7 @@ __mbsnrtowcs (dst, src, nmc, len, ps) data.__outbuf = (unsigned char *) dst; data.__outbufend = data.__outbuf + len * sizeof (wchar_t); - status = DL_CALL_FCT (towc->__fct, + status = DL_CALL_FCT (fct, (towc, &data, (const unsigned char **) src, srcend, NULL, &dummy, 0, 1)); diff --git a/wcsmbs/mbsrtowcs_l.c b/wcsmbs/mbsrtowcs_l.c index c44c8e5066..264c410c92 100644 --- a/wcsmbs/mbsrtowcs_l.c +++ b/wcsmbs/mbsrtowcs_l.c @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <assert.h> #include <ctype.h> #include <string.h> #include "wcsmbsload.h" @@ -28,7 +29,7 @@ #include <wchar.h> #include <wcsmbsload.h> -#include <assert.h> +#include <sysdep.h> #ifndef EILSEQ # define EILSEQ EINVAL @@ -63,6 +64,11 @@ __mbsrtowcs_l (dst, src, len, ps, l) /* Get the structure with the function pointers. */ towc = fcts->towc; + __gconv_fct fct = towc->__fct; +#ifdef PTR_DEMANGLE + if (towc->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif /* We have to handle DST == NULL special. */ if (dst == NULL) @@ -81,9 +87,8 @@ __mbsrtowcs_l (dst, src, len, ps, l) { data.__outbuf = (unsigned char *) buf; - status = DL_CALL_FCT (towc->__fct, - (towc, &data, &inbuf, srcend, NULL, - &non_reversible, 0, 1)); + status = DL_CALL_FCT (fct, (towc, &data, &inbuf, srcend, NULL, + &non_reversible, 0, 1)); result += (wchar_t *) data.__outbuf - buf; } @@ -116,9 +121,8 @@ __mbsrtowcs_l (dst, src, len, ps, l) worst case we need one input byte for one output wchar_t. */ srcend = srcp + __strnlen ((const char *) srcp, len) + 1; - status = DL_CALL_FCT (towc->__fct, - (towc, &data, &srcp, srcend, NULL, - &non_reversible, 0, 1)); + status = DL_CALL_FCT (fct, (towc, &data, &srcp, srcend, NULL, + &non_reversible, 0, 1)); if ((status != __GCONV_EMPTY_INPUT && status != __GCONV_INCOMPLETE_INPUT) /* Not all input read. */ diff --git a/wcsmbs/wcrtomb.c b/wcsmbs/wcrtomb.c index f7971e704b..aa51b6891b 100644 --- a/wcsmbs/wcrtomb.c +++ b/wcsmbs/wcrtomb.c @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <assert.h> #include <dlfcn.h> #include <errno.h> #include <gconv.h> @@ -24,7 +25,7 @@ #include <wchar.h> #include <wcsmbsload.h> -#include <assert.h> +#include <sysdep.h> #ifndef EILSEQ # define EILSEQ EINVAL @@ -65,15 +66,19 @@ __wcrtomb (char *s, wchar_t wc, mbstate_t *ps) /* Get the conversion functions. */ fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE)); + __gconv_fct fct = fcts->tomb->__fct; +#ifdef PTR_DEMANGLE + if (fcts->tomb->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif /* If WC is the NUL character we write into the output buffer the byte sequence necessary for PS to get into the initial state, followed by a NUL byte. */ if (wc == L'\0') { - status = DL_CALL_FCT (fcts->tomb->__fct, - (fcts->tomb, &data, NULL, NULL, - NULL, &dummy, 1, 1)); + status = DL_CALL_FCT (fct, (fcts->tomb, &data, NULL, NULL, + NULL, &dummy, 1, 1)); if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT) *data.__outbuf++ = '\0'; @@ -83,7 +88,7 @@ __wcrtomb (char *s, wchar_t wc, mbstate_t *ps) /* Do a normal conversion. */ const unsigned char *inbuf = (const unsigned char *) &wc; - status = DL_CALL_FCT (fcts->tomb->__fct, + status = DL_CALL_FCT (fct, (fcts->tomb, &data, &inbuf, inbuf + sizeof (wchar_t), NULL, &dummy, 0, 1)); } diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c index 1d7374b386..e82b1ffaff 100644 --- a/wcsmbs/wcsmbsload.c +++ b/wcsmbs/wcsmbsload.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998,1999,2000,2001,2002,2004 Free Software Foundation, Inc. +/* Copyright (C) 1998-2002,2004,2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -29,7 +29,7 @@ /* These are the descriptions for the default conversion functions. */ -static struct __gconv_step to_wc = +static const struct __gconv_step to_wc = { .__shlib_handle = NULL, .__modname = NULL, @@ -48,7 +48,7 @@ static struct __gconv_step to_wc = .__data = NULL }; -static struct __gconv_step to_mb = +static const struct __gconv_step to_mb = { .__shlib_handle = NULL, .__modname = NULL, @@ -71,9 +71,9 @@ static struct __gconv_step to_mb = /* For the default locale we only have to handle ANSI_X3.4-1968. */ const struct gconv_fcts __wcsmbs_gconv_fcts_c = { - .towc = &to_wc, + .towc = (struct __gconv_step *) &to_wc, .towc_nsteps = 1, - .tomb = &to_mb, + .tomb = (struct __gconv_step *) &to_mb, .tomb_nsteps = 1 }; diff --git a/wcsmbs/wcsnrtombs.c b/wcsmbs/wcsnrtombs.c index 0252b7fa23..171fc3c227 100644 --- a/wcsmbs/wcsnrtombs.c +++ b/wcsmbs/wcsnrtombs.c @@ -17,13 +17,14 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <assert.h> #include <dlfcn.h> #include <errno.h> #include <gconv.h> #include <wchar.h> #include <wcsmbsload.h> -#include <assert.h> +#include <sysdep.h> #ifndef EILSEQ # define EILSEQ EINVAL @@ -67,6 +68,11 @@ __wcsnrtombs (dst, src, nwc, len, ps) /* Get the structure with the function pointers. */ tomb = fcts->tomb; + __gconv_fct fct = tomb->__fct; +#ifdef PTR_DEMANGLE + if (tomb->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif /* We have to handle DST == NULL special. */ if (dst == NULL) @@ -82,10 +88,9 @@ __wcsnrtombs (dst, src, nwc, len, ps) { data.__outbuf = buf; - status = DL_CALL_FCT (tomb->__fct, - (tomb, &data, &inbuf, - (const unsigned char *) srcend, NULL, - &dummy, 0, 1)); + status = DL_CALL_FCT (fct, (tomb, &data, &inbuf, + (const unsigned char *) srcend, NULL, + &dummy, 0, 1)); /* Count the number of bytes. */ result += data.__outbuf - buf; @@ -107,10 +112,9 @@ __wcsnrtombs (dst, src, nwc, len, ps) data.__outbuf = (unsigned char *) dst; data.__outbufend = (unsigned char *) dst + len; - status = DL_CALL_FCT (tomb->__fct, - (tomb, &data, (const unsigned char **) src, - (const unsigned char *) srcend, NULL, - &dummy, 0, 1)); + status = DL_CALL_FCT (fct, (tomb, &data, (const unsigned char **) src, + (const unsigned char *) srcend, NULL, + &dummy, 0, 1)); /* Count the number of bytes. */ result = data.__outbuf - (unsigned char *) dst; diff --git a/wcsmbs/wcsrtombs.c b/wcsmbs/wcsrtombs.c index d41ca5366b..5973fd9303 100644 --- a/wcsmbs/wcsrtombs.c +++ b/wcsmbs/wcsrtombs.c @@ -17,6 +17,7 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <assert.h> #include <dlfcn.h> #include <errno.h> #include <stdlib.h> @@ -24,7 +25,7 @@ #include <wchar.h> #include <wcsmbsload.h> -#include <assert.h> +#include <sysdep.h> #ifndef EILSEQ # define EILSEQ EINVAL @@ -59,6 +60,11 @@ __wcsrtombs (dst, src, len, ps) /* Get the structure with the function pointers. */ tomb = fcts->tomb; + __gconv_fct fct = tomb->__fct; +#ifdef PTR_DEMANGLE + if (tomb->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif /* We have to handle DST == NULL special. */ if (dst == NULL) @@ -79,10 +85,9 @@ __wcsrtombs (dst, src, len, ps) { data.__outbuf = buf; - status = DL_CALL_FCT (tomb->__fct, - (tomb, &data, &inbuf, - (const unsigned char *) srcend, NULL, - &dummy, 0, 1)); + status = DL_CALL_FCT (fct, (tomb, &data, &inbuf, + (const unsigned char *) srcend, NULL, + &dummy, 0, 1)); /* Count the number of bytes. */ result += data.__outbuf - buf; @@ -108,10 +113,9 @@ __wcsrtombs (dst, src, len, ps) data.__outbuf = (unsigned char *) dst; data.__outbufend = (unsigned char *) dst + len; - status = DL_CALL_FCT (tomb->__fct, - (tomb, &data, (const unsigned char **) src, - (const unsigned char *) srcend, NULL, - &dummy, 0, 1)); + status = DL_CALL_FCT (fct, (tomb, &data, (const unsigned char **) src, + (const unsigned char *) srcend, NULL, + &dummy, 0, 1)); /* Count the number of bytes. */ result = data.__outbuf - (unsigned char *) dst; diff --git a/wcsmbs/wcstol.c b/wcsmbs/wcstol.c new file mode 100644 index 0000000000..b238d04b19 --- /dev/null +++ b/wcsmbs/wcstol.c @@ -0,0 +1,23 @@ +/* Function to parse a `long int' from text. + Copyright (C) 1996, 1997, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define USE_WIDE_CHAR 1 + +#include <stdlib/strtol.c> diff --git a/wcsmbs/wcstol_l.c b/wcsmbs/wcstol_l.c new file mode 100644 index 0000000000..3d3bf76ea6 --- /dev/null +++ b/wcsmbs/wcstol_l.c @@ -0,0 +1,30 @@ +/* Convert string representing a number to integer value, using given locale. + Copyright (C) 1997, 2002, 2004, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define __need_wchar_t +#include <stddef.h> +#include <locale.h> + +#define USE_WIDE_CHAR 1 + +extern long int ____wcstol_l_internal (const wchar_t *, wchar_t **, int, int, + __locale_t); + +#include <stdlib/strtol_l.c> diff --git a/wcsmbs/wcstoll.c b/wcsmbs/wcstoll.c new file mode 100644 index 0000000000..b666762da4 --- /dev/null +++ b/wcsmbs/wcstoll.c @@ -0,0 +1,25 @@ +/* Function to parse a `long long int' from text. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define QUAD 1 + +#include "wcstol.c" + +weak_alias (wcstoll, wcstoq) diff --git a/wcsmbs/wcstoll_l.c b/wcsmbs/wcstoll_l.c new file mode 100644 index 0000000000..f1a4ca1623 --- /dev/null +++ b/wcsmbs/wcstoll_l.c @@ -0,0 +1,30 @@ +/* Convert string representing a number to integer value, using given locale. + Copyright (C) 1997, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define __need_wchar_t +#include <stddef.h> +#include <locale.h> + +#define QUAD 1 + +extern long long int ____wcstoll_l_internal (const wchar_t *, wchar_t **, + int, int, __locale_t); + +#include <wcstol_l.c> diff --git a/wcsmbs/wcstoul.c b/wcsmbs/wcstoul.c new file mode 100644 index 0000000000..f25f7a9bff --- /dev/null +++ b/wcsmbs/wcstoul.c @@ -0,0 +1,23 @@ +/* Function to parse an `unsigned long int' from text. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define UNSIGNED 1 + +#include "wcstol.c" diff --git a/wcsmbs/wcstoul_l.c b/wcsmbs/wcstoul_l.c new file mode 100644 index 0000000000..25058de817 --- /dev/null +++ b/wcsmbs/wcstoul_l.c @@ -0,0 +1,30 @@ +/* Convert string representing a number to integer value, using given locale. + Copyright (C) 1997, 2002, 2004, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define __need_wchar_t +#include <stddef.h> +#include <locale.h> + +#define UNSIGNED 1 + +extern unsigned long int ____wcstoul_l_internal (const wchar_t *, wchar_t **, + int, int, __locale_t); + +#include "wcstol_l.c" diff --git a/wcsmbs/wcstoull.c b/wcsmbs/wcstoull.c new file mode 100644 index 0000000000..a69a103515 --- /dev/null +++ b/wcsmbs/wcstoull.c @@ -0,0 +1,25 @@ +/* Function to parse an `unsigned long long int' from text. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define QUAD 1 + +#include "wcstoul.c" + +weak_alias (wcstoull, wcstouq) diff --git a/wcsmbs/wcstoull_l.c b/wcsmbs/wcstoull_l.c new file mode 100644 index 0000000000..32bc3c4bb9 --- /dev/null +++ b/wcsmbs/wcstoull_l.c @@ -0,0 +1,31 @@ +/* Convert string representing a number to integer value, using given locale. + Copyright (C) 1997, 2002, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#define __need_wchar_t +#include <stddef.h> +#include <locale.h> + +#define UNSIGNED 1 + +extern unsigned long long int ____wcstoull_l_internal (const wchar_t *, + wchar_t **, int, int, + __locale_t); + +#include <wcstoll_l.c> diff --git a/wcsmbs/wctob.c b/wcsmbs/wctob.c index 0f241577a4..cbaac53367 100644 --- a/wcsmbs/wctob.c +++ b/wcsmbs/wctob.c @@ -24,6 +24,8 @@ #include <wchar.h> #include <wcsmbsload.h> +#include <sysdep.h> + int wctob (c) @@ -64,7 +66,12 @@ wctob (c) inbuf[0] = c; const unsigned char *argptr = (const unsigned char *) inptr; - status = DL_CALL_FCT (fcts->tomb->__fct, + __gconv_fct fct = fcts->tomb->__fct; +#ifdef PTR_DEMANGLE + if (fcts->tomb->__shlib_handle != NULL) + PTR_DEMANGLE (fct); +#endif + status = DL_CALL_FCT (fct, (fcts->tomb, &data, &argptr, argptr + sizeof (inbuf[0]), NULL, &dummy, 0, 1)); |