diff --git a/src/system/libroot/posix/glibc/locale/mb_cur_max.c b/src/system/libroot/posix/glibc/locale/mb_cur_max.c deleted file mode 100644 index e94ac49418..0000000000 --- a/src/system/libroot/posix/glibc/locale/mb_cur_max.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Return number of characters in multibyte representation for current - character set. - Copyright (C) 1996, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include -#include -#include -#include "localeinfo.h" - - -size_t -weak_function -__ctype_get_mb_cur_max (void) -{ - return _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX); -} diff --git a/src/system/libroot/posix/glibc/stdlib/mblen.c b/src/system/libroot/posix/glibc/stdlib/mblen.c deleted file mode 100644 index 782bf51081..0000000000 --- a/src/system/libroot/posix/glibc/stdlib/mblen.c +++ /dev/null @@ -1,67 +0,0 @@ -/* Copyright (C) 1991, 1997, 1998, 1999, 2000 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 - 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. */ - -#include -#include -#include -#include -#include - - -/* Internal state. */ -static mbstate_t state; - -/* Return the length of the multibyte character (if there is one) - at S which is no longer than N characters. - The ISO C standard says that the `mblen' function must not change - the state of the `mbtowc' function. */ -int -mblen (const char *s, size_t n) -{ - int result; - - /* If S is NULL the function has to return null or not null - depending on the encoding having a state depending encoding or - not. */ - if (s == NULL) - { - /* Make sure we use the correct value. */ - update_conversion_ptrs (); - - /* Reset the state. */ - memset (&state, '\0', sizeof state); - - result = __wcsmbs_gconv_fcts.towc->__stateful; - } - else if (*s == '\0') - /* According to the ISO C 89 standard this is the expected behaviour. */ - result = 0; - else - { - memset (&state, '\0', sizeof state); - - result = __mbrtowc (NULL, s, n, &state); - - /* The `mbrtowc' functions tell us more than we need. Fold the -1 - and -2 result into -1. */ - if (result < 0) - result = -1; - } - - return result; -} diff --git a/src/system/libroot/posix/glibc/stdlib/mbtowc.c b/src/system/libroot/posix/glibc/stdlib/mbtowc.c deleted file mode 100644 index 323adcf599..0000000000 --- a/src/system/libroot/posix/glibc/stdlib/mbtowc.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 1991, 92, 95, 96, 97, 98, 99 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 - 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. */ - -#include -#include -#include -#include -#include - - -/* Common state for all non-restartable conversion functions. */ -mbstate_t __no_r_state; - -/* Convert the multibyte character at S, which is no longer - than N characters, to its `wchar_t' representation, placing - this n *PWC and returning its length. - - Attention: this function should NEVER be intentionally used. - The interface is completely stupid. The state is shared between - all conversion functions. You should use instead the restartable - version `mbrtowc'. */ -int -mbtowc (wchar_t *pwc, const char *s, size_t n) -{ - int result; - - /* If S is NULL the function has to return null or not null - depending on the encoding having a state depending encoding or - not. */ - if (s == NULL) - { - /* Make sure we use the correct value. */ - update_conversion_ptrs (); - - /* This is an extension in the Unix standard which does not directly - violate ISO C. */ - memset (&__no_r_state, '\0', sizeof __no_r_state); - - result = __wcsmbs_gconv_fcts.towc->__stateful; - } - else if (*s == '\0') - { - if (pwc != NULL) - *pwc = L'\0'; - result = 0; - } - else - { - result = __mbrtowc (pwc, s, n, &__no_r_state); - - /* The `mbrtowc' functions tell us more than we need. Fold the -1 - and -2 result into -1. */ - if (result < 0) - result = -1; - } - - return result; -} diff --git a/src/system/libroot/posix/glibc/stdlib/wctomb.c b/src/system/libroot/posix/glibc/stdlib/wctomb.c deleted file mode 100644 index 61305f8f0a..0000000000 --- a/src/system/libroot/posix/glibc/stdlib/wctomb.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Copyright (C) 1991, 92, 95, 96, 97, 98, 99 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 - 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. */ - -#include -#include -#include -#include -#include - - -extern mbstate_t __no_r_state; /* Defined in mbtowc.c. */ - -/* Convert WCHAR into its multibyte character representation, - putting this in S and returning its length. - - Attention: this function should NEVER be intentionally used. - The interface is completely stupid. The state is shared between - all conversion functions. You should use instead the restartable - version `wcrtomb'. */ -int -wctomb (char *s, wchar_t wchar) -{ - /* If S is NULL the function has to return null or not null - depending on the encoding having a state depending encoding or - not. */ - if (s == NULL) - { - /* Make sure we use the correct value. */ - update_conversion_ptrs (); - - /* This is an extension in the Unix standard which does not directly - violate ISO C. */ - memset (&__no_r_state, '\0', sizeof __no_r_state); - - return __wcsmbs_gconv_fcts.tomb->__stateful; - } - - return __wcrtomb (s, wchar, &__no_r_state); -} diff --git a/src/system/libroot/posix/glibc/wcsmbs/btowc.c b/src/system/libroot/posix/glibc/wcsmbs/btowc.c deleted file mode 100644 index eaa9d003e7..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/btowc.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include -#include -#include -#include -#include -#include -#include - - -wint_t -__btowc (c) - int c; -{ - wchar_t result; - struct __gconv_step_data data; - unsigned char inbuf[1]; - const unsigned char *inptr = inbuf; - size_t dummy; - int status; - - /* If the parameter does not fit into one byte or it is the EOF value - we can give the answer now. */ - if (c < SCHAR_MIN || c > UCHAR_MAX || c == EOF) - return WEOF; - - /* Tell where we want the result. */ - data.__outbuf = (unsigned char *) &result; - data.__outbufend = data.__outbuf + sizeof (wchar_t); - data.__invocation_counter = 0; - data.__internal_use = 1; - data.__flags = __GCONV_IS_LAST; - data.__statep = &data.__state; - data.__trans = NULL; - - /* Make sure we start in the initial state. */ - memset (&data.__state, '\0', sizeof (mbstate_t)); - - /* Make sure we use the correct function. */ - update_conversion_ptrs (); - - /* Create the input string. */ - inbuf[0] = c; - - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.towc->__fct, - (__wcsmbs_gconv_fcts.towc, &data, &inptr, inptr + 1, - NULL, &dummy, 0, 1)); - /* The conversion failed. */ - if (status != __GCONV_OK && status != __GCONV_FULL_OUTPUT - && status != __GCONV_EMPTY_INPUT) - result = WEOF; - - return result; -} -weak_alias (__btowc, btowc) diff --git a/src/system/libroot/posix/glibc/wcsmbs/mbrlen.c b/src/system/libroot/posix/glibc/wcsmbs/mbrlen.c deleted file mode 100644 index a173ea0f20..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/mbrlen.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper, - - 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. */ - -#include - -/* The mbrlen function has an internal shift state which gets used if - the PS parameter is NULL. */ -static mbstate_t internal; - - -size_t -__mbrlen (s, n, ps) - const char *s; - size_t n; - mbstate_t *ps; -{ - return __mbrtowc (NULL, s, n, ps ?: &internal); -} -libc_hidden_def (__mbrlen) -weak_alias (__mbrlen, mbrlen) diff --git a/src/system/libroot/posix/glibc/wcsmbs/mbrtowc.c b/src/system/libroot/posix/glibc/wcsmbs/mbrtowc.c deleted file mode 100644 index 965535fcd5..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/mbrtowc.c +++ /dev/null @@ -1,107 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include -#include -#include -#include -#include - -#include - -#ifndef EILSEQ -# define EILSEQ EINVAL -#endif - -/* This is the private state used if PS is NULL. */ -static mbstate_t state; - -size_t -__mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) -{ - wchar_t buf[1]; - struct __gconv_step_data data; - int status; - size_t result; - size_t dummy; - const unsigned char *inbuf; - char *outbuf = (char *) (pwc ?: buf); - - /* Set information for this step. */ - data.__invocation_counter = 0; - data.__internal_use = 1; - data.__flags = __GCONV_IS_LAST; - data.__statep = ps ?: &state; - data.__trans = NULL; - - /* A first special case is if S is NULL. This means put PS in the - initial state. */ - if (s == NULL) - { - outbuf = (char *) buf; - s = ""; - n = 1; - } - - /* Tell where we want the result. */ - data.__outbuf = outbuf; - data.__outbufend = outbuf + sizeof (wchar_t); - - /* Make sure we use the correct function. */ - update_conversion_ptrs (); - - /* Do a normal conversion. */ - inbuf = (const unsigned char *) s; - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.towc->__fct, - (__wcsmbs_gconv_fcts.towc, &data, &inbuf, inbuf + n, - 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 - definition of MB_CUR_MAX is not correct. All the other possible - errors also must not happen. */ - assert (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT - || status == __GCONV_ILLEGAL_INPUT - || status == __GCONV_INCOMPLETE_INPUT - || status == __GCONV_FULL_OUTPUT); - - if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT - || status == __GCONV_FULL_OUTPUT) - { - if (data.__outbuf != (unsigned char *) outbuf - && *(wchar_t *) outbuf == L'\0') - { - /* The converted character is the NUL character. */ - assert (__mbsinit (data.__statep)); - result = 0; - } - else - result = inbuf - (const unsigned char *) s; - } - else if (status == __GCONV_INCOMPLETE_INPUT) - result = (size_t) -2; - else - { - result = (size_t) -1; - __set_errno (EILSEQ); - } - - return result; -} -weak_alias (__mbrtowc, mbrtowc) diff --git a/src/system/libroot/posix/glibc/wcsmbs/mbsinit.c b/src/system/libroot/posix/glibc/wcsmbs/mbsinit.c deleted file mode 100644 index 5d740c85fc..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/mbsinit.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include -#include - -/* In GNU libc the conversion functions only can convert between the - fixed wide character representation and the multibyte - representation of the same character set. Since we use ISO 10646 - in UCS4 encoding for wide characters the best solution for - multibyte characters is the UTF8 encoding. I.e., the only state - information is a counter of the processed bytes so far and the - value collected so far. Especially, we don't have different shift - states. */ -int -__mbsinit (ps) - const mbstate_t *ps; -{ - return ps == NULL || ps->__count == 0; -} -weak_alias (__mbsinit, mbsinit) diff --git a/src/system/libroot/posix/glibc/wcsmbs/wcrtomb.c b/src/system/libroot/posix/glibc/wcsmbs/wcrtomb.c deleted file mode 100644 index 53e119b004..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/wcrtomb.c +++ /dev/null @@ -1,110 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include -#include -#include -#include -#include -#include - -#include - -#ifndef EILSEQ -# define EILSEQ EINVAL -#endif - - -/* This is the private state used if PS is NULL. */ -static mbstate_t state; - -size_t -__wcrtomb (char *s, wchar_t wc, mbstate_t *ps) -{ - char buf[MB_CUR_MAX]; - struct __gconv_step_data data; - int status; - size_t result; - size_t dummy; - - /* Set information for this step. */ - data.__invocation_counter = 0; - data.__internal_use = 1; - data.__flags = __GCONV_IS_LAST; - data.__statep = ps ?: &state; - data.__trans = NULL; - - /* A first special case is if S is NULL. This means put PS in the - initial state. */ - if (s == NULL) - { - s = buf; - wc = L'\0'; - } - - /* Tell where we want to have the result. */ - data.__outbuf = s; - data.__outbufend = s + MB_CUR_MAX; - - /* Make sure we use the correct function. */ - update_conversion_ptrs (); - - /* 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 (__wcsmbs_gconv_fcts.tomb->__fct, - (__wcsmbs_gconv_fcts.tomb, &data, NULL, NULL, - NULL, &dummy, 1, 1)); - - if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT) - *data.__outbuf++ = '\0'; - } - else - { - /* Do a normal conversion. */ - const unsigned char *inbuf = (const unsigned char *) &wc; - - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.tomb->__fct, - (__wcsmbs_gconv_fcts.tomb, &data, &inbuf, - inbuf + sizeof (wchar_t), 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 - definition of MB_CUR_MAX is not correct. All the other possible - errors also must not happen. */ - assert (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT - || status == __GCONV_ILLEGAL_INPUT - || status == __GCONV_INCOMPLETE_INPUT - || status == __GCONV_FULL_OUTPUT); - - if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT - || status == __GCONV_FULL_OUTPUT) - result = data.__outbuf - (unsigned char *) s; - else - { - result = (size_t) -1; - __set_errno (EILSEQ); - } - - return result; -} -weak_alias (__wcrtomb, wcrtomb) diff --git a/src/system/libroot/posix/glibc/wcsmbs/wcswidth.c b/src/system/libroot/posix/glibc/wcsmbs/wcswidth.c deleted file mode 100644 index 72c0d98c4e..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/wcswidth.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include "wcwidth.h" - -/* Determine number of column positions required for first N wide - characters (or fewer if S ends before this) in S. */ -int -wcswidth (const wchar_t *s, size_t n) -{ - int result = 0; - - while (n-- > 0 && *s != L'\0') - { - int now = internal_wcwidth (*s); - if (now == -1) - return -1; - result += now; - ++s; - } - - return result; -} diff --git a/src/system/libroot/posix/glibc/wcsmbs/wctob.c b/src/system/libroot/posix/glibc/wcsmbs/wctob.c deleted file mode 100644 index cd44bc6b32..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/wctob.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include -#include -#include -#include -#include -#include - - -int -wctob (c) - wint_t c; -{ - char buf[MB_LEN_MAX]; - struct __gconv_step_data data; - wchar_t inbuf[1]; - wchar_t *inptr = inbuf; - size_t dummy; - int status; - - if (c == WEOF) - return EOF; - - /* Tell where we want the result. */ - data.__outbuf = buf; - data.__outbufend = buf + MB_LEN_MAX; - data.__invocation_counter = 0; - data.__internal_use = 1; - data.__flags = __GCONV_IS_LAST; - data.__statep = &data.__state; - data.__trans = NULL; - - /* Make sure we start in the initial state. */ - memset (&data.__state, '\0', sizeof (mbstate_t)); - - /* Make sure we use the correct function. */ - update_conversion_ptrs (); - - /* Create the input string. */ - inbuf[0] = c; - - status = DL_CALL_FCT (__wcsmbs_gconv_fcts.tomb->__fct, - (__wcsmbs_gconv_fcts.tomb, &data, - (const unsigned char **) &inptr, - (const unsigned char *) &inbuf[1], - NULL, &dummy, 0, 1)); - - /* The conversion failed or the output is too long. */ - if ((status != __GCONV_OK && status != __GCONV_FULL_OUTPUT - && status != __GCONV_EMPTY_INPUT) - || data.__outbuf != (unsigned char *) (buf + 1)) - return EOF; - - return (unsigned char) buf[0]; -} diff --git a/src/system/libroot/posix/glibc/wcsmbs/wcwidth.c b/src/system/libroot/posix/glibc/wcsmbs/wcwidth.c deleted file mode 100644 index 82dd0201df..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/wcwidth.c +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include "wcwidth.h" - -/* Determine number of column positions required for CH. */ -int -wcwidth (wchar_t ch) -{ - return internal_wcwidth (ch); -} diff --git a/src/system/libroot/posix/glibc/wcsmbs/wcwidth.h b/src/system/libroot/posix/glibc/wcsmbs/wcwidth.h deleted file mode 100644 index c24dee9126..0000000000 --- a/src/system/libroot/posix/glibc/wcsmbs/wcwidth.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Internal header containing implementation of wcwidth() function. - Copyright (C) 1996,1997,1999,2000,2001,2002 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ulrich Drepper , 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. */ - -#include -#include -#include "../wctype/wchar-lookup.h" -#include "../locale/localeinfo.h" - -/* Table containing width information. */ -extern const char *__ctype32_width attribute_hidden; - -static __inline int -internal_wcwidth (wchar_t wc) -{ - unsigned char res; - - /* The tables have been prepared in such a way that - 1. wc == L'\0' yields res = 0, - 2. !iswprint (wc) implies res = '\xff'. */ - res = wcwidth_table_lookup (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_WIDTH), wc); - - return res == (unsigned char) '\xff' ? -1 : (int) res; -}