diff options
Diffstat (limited to 'wcsmbs')
-rw-r--r-- | wcsmbs/Makefile | 3 | ||||
-rw-r--r-- | wcsmbs/wchar.h | 18 | ||||
-rw-r--r-- | wcsmbs/wcscoll.c | 6 | ||||
-rw-r--r-- | wcsmbs/wcscoll_l.c | 21 | ||||
-rw-r--r-- | wcsmbs/wcsxfrm.c | 6 | ||||
-rw-r--r-- | wcsmbs/wcsxfrm_l.c | 21 | ||||
-rw-r--r-- | wcsmbs/wmemcpy.c | 30 |
7 files changed, 86 insertions, 19 deletions
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile index c296944fdd..929798da42 100644 --- a/wcsmbs/Makefile +++ b/wcsmbs/Makefile @@ -32,7 +32,8 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \ mbsnrtowcs wcsnrtombs \ wcstol wcstoul wcstoq wcstouq wcstod wcstold wcstof \ wcscoll wcsxfrm \ - wcwidth wcswidth + wcwidth wcswidth \ + wcscoll_l wcsxfrm_l include ../Rules diff --git a/wcsmbs/wchar.h b/wcsmbs/wchar.h index 689428bacf..597a03d735 100644 --- a/wcsmbs/wchar.h +++ b/wcsmbs/wchar.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -89,6 +89,22 @@ extern int wcscoll __P ((__const wchar_t *__s1, __const wchar_t *__s2)); `wcscoll' to the original strings. */ extern size_t wcsxfrm __P ((wchar_t *__s1, __const wchar_t *__s2, size_t __n)); +#ifdef __USE_GNU +/* Similar to the two functions above but take the information from + the provided locale and not the global locale. */ +# include <xlocale.h> + +/* Compare S1 and S2, both interpreted as appropriate to the + LC_COLLATE category of the given locale. */ +extern int __wcscoll_l __P ((__const wchar_t *__s1, __const wchar_t *__s2, + __locale_t loc)); +/* Transform S2 into array pointed to by S1 such that if wcscmp is + applied to two transformed strings the result is the as applying + `wcscoll' to the original strings. */ +extern size_t __wcsxfrm_l __P ((wchar_t *__s1, __const wchar_t *__s2, + size_t __n, __locale_t loc)); +#endif + /* Duplicate S, returning an identical malloc'd string. */ extern wchar_t *wcsdup __P ((__const wchar_t *__s)); diff --git a/wcsmbs/wcscoll.c b/wcsmbs/wcscoll.c index ba4adf00c4..9b1a8a4d38 100644 --- a/wcsmbs/wcscoll.c +++ b/wcsmbs/wcscoll.c @@ -21,7 +21,11 @@ #define STRING_TYPE wchar_t #define USTRING_TYPE wint_t -#define STRCOLL wcscoll +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define STRCOLL __wcscoll_l +#else +# define STRCOLL wcscoll +#endif #define STRCMP wcscmp #include "../string/strcoll.c" diff --git a/wcsmbs/wcscoll_l.c b/wcsmbs/wcscoll_l.c new file mode 100644 index 0000000000..b02f6a2fde --- /dev/null +++ b/wcsmbs/wcscoll_l.c @@ -0,0 +1,21 @@ +/* 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define USE_IN_EXTENDED_LOCALE_MODEL 1 +#include <wcscoll.c> diff --git a/wcsmbs/wcsxfrm.c b/wcsmbs/wcsxfrm.c index 0404c2d0b0..b899185aa5 100644 --- a/wcsmbs/wcsxfrm.c +++ b/wcsmbs/wcsxfrm.c @@ -23,7 +23,11 @@ #define STRING_TYPE wchar_t #define USTRING_TYPE wint_t #define L_(Ch) L##Ch -#define STRXFRM wcsxfrm +#ifdef USE_IN_EXTENDED_LOCALE_MODEL +# define STRXFRM __wcsxfrm_l +#else +# define STRXFRM wcsxfrm +#endif #define STRLEN wcslen #define STPNCPY __wcpncpy diff --git a/wcsmbs/wcsxfrm_l.c b/wcsmbs/wcsxfrm_l.c new file mode 100644 index 0000000000..9f97b9dfcd --- /dev/null +++ b/wcsmbs/wcsxfrm_l.c @@ -0,0 +1,21 @@ +/* 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 Library General Public License as + published by the Free Software Foundation; either version 2 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 + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#define USE_IN_EXTENDED_LOCALE_MODEL 1 +#include <wcsxfrm.c> diff --git a/wcsmbs/wmemcpy.c b/wcsmbs/wmemcpy.c index e469122197..6133a5a48d 100644 --- a/wcsmbs/wmemcpy.c +++ b/wcsmbs/wmemcpy.c @@ -1,21 +1,21 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. -This file is part of the GNU C Library. -Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu> +/* 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 Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 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 -Library General Public License for more details. + 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 + Library General Public License for more details. -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #include <wchar.h> #include <string.h> |