diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/Depend b/ap/libc/glibc/glibc-2.23/wcsmbs/Depend
new file mode 100644
index 0000000..f3e1156
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/Depend
@@ -0,0 +1 @@
+localedata
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/Makefile b/ap/libc/glibc/glibc-2.23/wcsmbs/Makefile
new file mode 100644
index 0000000..8b599f7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/Makefile
@@ -0,0 +1,101 @@
+# Copyright (C) 1995-2016 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, see
+# <http://www.gnu.org/licenses/>.
+
+#
+#	Sub-makefile for wcsmbs portion of the library.
+#
+subdir	:= wcsmbs
+
+include ../Makeconfig
+
+headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h
+
+routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+	    wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+	    wmemcmp wmemcpy wmemmove wmemset wcpcpy wcpncpy wmempcpy \
+	    btowc wctob mbsinit \
+	    mbrlen mbrtowc wcrtomb mbsrtowcs wcsrtombs \
+	    mbsnrtowcs wcsnrtombs wcsnlen wcschrnul \
+	    wcstol wcstoul wcstoll wcstoull wcstod wcstold wcstof \
+	    wcstol_l wcstoul_l wcstoll_l wcstoull_l \
+	    wcstod_l wcstold_l wcstof_l \
+	    wcstod_nan wcstold_nan wcstof_nan \
+	    wcscoll wcsxfrm \
+	    wcwidth wcswidth \
+	    wcscoll_l wcsxfrm_l \
+	    wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
+	    wcsmbsload mbsrtowcs_l \
+	    isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \
+	    isoc99_swscanf isoc99_vswscanf \
+	    mbrtoc16 c16rtomb
+
+strop-tests :=  wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy wcsnlen \
+		wcpcpy wcsncpy wcpncpy wcscat wcsncat wcschrnul wcsspn wcspbrk \
+		wcscspn wmemchr wmemset
+tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
+	 tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \
+	 tst-c16c32-1 wcsatcliff tst-wcstol-locale tst-wcstod-nan-locale \
+	 $(addprefix test-,$(strop-tests))
+
+include ../Rules
+
+ifeq ($(run-built-tests),yes)
+LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 hr_HR.ISO-8859-2 \
+	   ja_JP.EUC-JP zh_TW.EUC-TW tr_TR.UTF-8 tr_TR.ISO-8859-9
+include ../gen-locales.mk
+
+$(objpfx)tst-btowc.out: $(gen-locales)
+$(objpfx)tst-c16c32-1.out: $(gen-locales)
+$(objpfx)tst-mbrtowc.out: $(gen-locales)
+$(objpfx)tst-mbrtowc2.out: $(gen-locales)
+$(objpfx)tst-wcrtomb.out: $(gen-locales)
+$(objpfx)wcsmbs-tst1.out: $(gen-locales)
+$(objpfx)tst-wcstol-locale.out: $(gen-locales)
+$(objpfx)tst-wcstod-nan-locale.out: $(gen-locales)
+endif
+
+CFLAGS-wcwidth.c = -I../wctype
+CFLAGS-wcswidth.c = -I../wctype
+
+strtox-CFLAGS = -I../include
+CFLAGS-wcstol.c = $(strtox-CFLAGS)
+CFLAGS-wcstoul.c = $(strtox-CFLAGS)
+CFLAGS-wcstoll.c = $(strtox-CFLAGS)
+CFLAGS-wcstoull.c = $(strtox-CFLAGS)
+CFLAGS-wcstod.c = $(strtox-CFLAGS)
+CFLAGS-wcstold.c = $(strtox-CFLAGS)
+CFLAGS-wcstof.c = $(strtox-CFLAGS)
+CFLAGS-wcstol_l.c = $(strtox-CFLAGS)
+CFLAGS-wcstoul_l.c = $(strtox-CFLAGS)
+CFLAGS-wcstoll_l.c = $(strtox-CFLAGS)
+CFLAGS-wcstoull_l.c = $(strtox-CFLAGS)
+CFLAGS-wcstod_l.c = $(strtox-CFLAGS)
+CFLAGS-wcstold_l.c = $(strtox-CFLAGS)
+CFLAGS-wcstof_l.c = $(strtox-CFLAGS)
+CPPFLAGS-tst-wchar-h.c = -D_FORTIFY_SOURCE=2
+
+CFLAGS-isoc99_wscanf.c += -fexceptions
+CFLAGS-isoc99_fwscanf.c += -fexceptions
+CFLAGS-isoc99_vwscanf.c += -fexceptions
+CFLAGS-isoc99_vfwscanf.c += -fexceptions
+
+CPPFLAGS += $(libio-mtsafe)
+
+# We need to find the default version of strtold_l in stdlib.
+CPPFLAGS-wcstold_l.c = -I../stdlib
+
+$(objpfx)tst-wcstod-nan-locale: $(libm)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/Versions b/ap/libc/glibc/glibc-2.23/wcsmbs/Versions
new file mode 100644
index 0000000..1ff5ff3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/Versions
@@ -0,0 +1,34 @@
+libc {
+  GLIBC_2.0 {
+    # functions used in inline functions or macros
+     __mbrlen; __mbrtowc; __wcsto*_internal;
+
+    # b*
+    btowc;
+
+    # w*
+    wcpcpy; wcpncpy; wcrtomb; wcscat; wcschr; wcscmp; wcscoll;
+    wcscpy; wcscspn; wcsdup; wcslen; wcsncat; wcsncmp;
+    wcsncpy; wcsnrtombs; wcspbrk; wcsrchr; wcsrtombs; wcsspn; wcsstr;
+    wcstod; wcstof; wcstok; wcstol; wcstold; wcstoq; wcstoul;
+    wcstouq; wcswidth; wcsxfrm; wctob;
+
+    wmemchr; wmemcmp; wmemcpy; wmemmove; wmemset;
+  }
+  GLIBC_2.1 {
+    # w*
+    wcscasecmp; wcsncasecmp; wcsnlen; wcstoll;
+    wcstoimax; wcstoumax; wcstoull; wcswcs; wmemrtombs; wmemrtowcs;
+  }
+  GLIBC_2.2 {
+    # w*
+    wcschrnul; wmempcpy;
+  }
+  GLIBC_2.7 {
+    __isoc99_fwscanf; __isoc99_swscanf; __isoc99_vfwscanf; __isoc99_vswscanf;
+    __isoc99_vwscanf; __isoc99_wscanf;
+  }
+  GLIBC_2.16 {
+    c16rtomb; c32rtomb; mbrtoc16; mbrtoc32;
+  }
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/bits/wchar-ldbl.h b/ap/libc/glibc/glibc-2.23/wcsmbs/bits/wchar-ldbl.h
new file mode 100644
index 0000000..d6c28c5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/bits/wchar-ldbl.h
@@ -0,0 +1,74 @@
+/* -mlong-double-64 compatibility mode for <wchar.h> functions.
+   Copyright (C) 2006-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _WCHAR_H
+# error "Never include <bits/wchar-ldbl.h> directly; use <wchar.h> instead."
+#endif
+
+#if defined __USE_ISOC95 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_C99
+__LDBL_REDIR_DECL (fwprintf);
+__LDBL_REDIR_DECL (wprintf);
+__LDBL_REDIR_DECL (swprintf);
+__LDBL_REDIR_DECL (vfwprintf);
+__LDBL_REDIR_DECL (vwprintf);
+__LDBL_REDIR_DECL (vswprintf);
+# if defined __USE_ISOC99 && !defined __USE_GNU \
+     && !defined __REDIRECT \
+     && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (fwscanf, __nldbl___isoc99_fwscanf)
+__LDBL_REDIR1_DECL (wscanf, __nldbl___isoc99_wscanf)
+__LDBL_REDIR1_DECL (swscanf, __nldbl___isoc99_swscanf)
+# else
+__LDBL_REDIR_DECL (fwscanf);
+__LDBL_REDIR_DECL (wscanf);
+__LDBL_REDIR_DECL (swscanf);
+# endif
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+__LDBL_REDIR1_DECL (wcstold, wcstod);
+# if !defined __USE_GNU && !defined __REDIRECT \
+     && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+__LDBL_REDIR1_DECL (vfwscanf, __nldbl___isoc99_vfwscanf)
+__LDBL_REDIR1_DECL (vwscanf, __nldbl___isoc99_vwscanf)
+__LDBL_REDIR1_DECL (vswscanf, __nldbl___isoc99_vswscanf)
+# else
+__LDBL_REDIR_DECL (vfwscanf);
+__LDBL_REDIR_DECL (vwscanf);
+__LDBL_REDIR_DECL (vswscanf);
+# endif
+__END_NAMESPACE_C99
+#endif
+
+#ifdef __USE_GNU
+__LDBL_REDIR1_DECL (wcstold_l, wcstod_l);
+#endif
+
+#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+__LDBL_REDIR_DECL (__swprintf_chk)
+__LDBL_REDIR_DECL (__vswprintf_chk)
+# if __USE_FORTIFY_LEVEL > 1
+__LDBL_REDIR_DECL (__fwprintf_chk)
+__LDBL_REDIR_DECL (__wprintf_chk)
+__LDBL_REDIR_DECL (__vfwprintf_chk)
+__LDBL_REDIR_DECL (__vwprintf_chk)
+# endif
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/bits/wchar2.h b/ap/libc/glibc/glibc-2.23/wcsmbs/bits/wchar2.h
new file mode 100644
index 0000000..ccf8dc9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/bits/wchar2.h
@@ -0,0 +1,593 @@
+/* Checking macros for wchar functions.
+   Copyright (C) 2005-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _WCHAR_H
+# error "Never include <bits/wchar2.h> directly; use <wchar.h> instead."
+#endif
+
+
+extern wchar_t *__wmemcpy_chk (wchar_t *__restrict __s1,
+			       const wchar_t *__restrict __s2, size_t __n,
+			       size_t __ns1) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmemcpy_alias,
+				(wchar_t *__restrict __s1,
+				 const wchar_t *__restrict __s2, size_t __n),
+				wmemcpy);
+extern wchar_t *__REDIRECT_NTH (__wmemcpy_chk_warn,
+				(wchar_t *__restrict __s1,
+				 const wchar_t *__restrict __s2, size_t __n,
+				 size_t __ns1), __wmemcpy_chk)
+     __warnattr ("wmemcpy called with length bigger than size of destination "
+		 "buffer");
+
+__fortify_function wchar_t *
+__NTH (wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+		size_t __n))
+{
+  if (__bos0 (__s1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n))
+	return __wmemcpy_chk (__s1, __s2, __n,
+			      __bos0 (__s1) / sizeof (wchar_t));
+
+      if (__n > __bos0 (__s1) / sizeof (wchar_t))
+	return __wmemcpy_chk_warn (__s1, __s2, __n,
+				   __bos0 (__s1) / sizeof (wchar_t));
+    }
+  return __wmemcpy_alias (__s1, __s2, __n);
+}
+
+
+extern wchar_t *__wmemmove_chk (wchar_t *__s1, const wchar_t *__s2,
+				size_t __n, size_t __ns1) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmemmove_alias, (wchar_t *__s1,
+						   const wchar_t *__s2,
+						   size_t __n), wmemmove);
+extern wchar_t *__REDIRECT_NTH (__wmemmove_chk_warn,
+				(wchar_t *__s1, const wchar_t *__s2,
+				 size_t __n, size_t __ns1), __wmemmove_chk)
+     __warnattr ("wmemmove called with length bigger than size of destination "
+		 "buffer");
+
+__fortify_function wchar_t *
+__NTH (wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n))
+{
+  if (__bos0 (__s1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n))
+	return __wmemmove_chk (__s1, __s2, __n,
+			       __bos0 (__s1) / sizeof (wchar_t));
+
+      if (__n > __bos0 (__s1) / sizeof (wchar_t))
+	return __wmemmove_chk_warn (__s1, __s2, __n,
+				    __bos0 (__s1) / sizeof (wchar_t));
+    }
+  return __wmemmove_alias (__s1, __s2, __n);
+}
+
+
+#ifdef __USE_GNU
+extern wchar_t *__wmempcpy_chk (wchar_t *__restrict __s1,
+				const wchar_t *__restrict __s2, size_t __n,
+				size_t __ns1) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmempcpy_alias,
+				(wchar_t *__restrict __s1,
+				 const wchar_t *__restrict __s2,
+				 size_t __n), wmempcpy);
+extern wchar_t *__REDIRECT_NTH (__wmempcpy_chk_warn,
+				(wchar_t *__restrict __s1,
+				 const wchar_t *__restrict __s2, size_t __n,
+				 size_t __ns1), __wmempcpy_chk)
+     __warnattr ("wmempcpy called with length bigger than size of destination "
+		 "buffer");
+
+__fortify_function wchar_t *
+__NTH (wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2,
+		 size_t __n))
+{
+  if (__bos0 (__s1) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n))
+	return __wmempcpy_chk (__s1, __s2, __n,
+			       __bos0 (__s1) / sizeof (wchar_t));
+
+      if (__n > __bos0 (__s1) / sizeof (wchar_t))
+	return __wmempcpy_chk_warn (__s1, __s2, __n,
+				    __bos0 (__s1) / sizeof (wchar_t));
+    }
+  return __wmempcpy_alias (__s1, __s2, __n);
+}
+#endif
+
+
+extern wchar_t *__wmemset_chk (wchar_t *__s, wchar_t __c, size_t __n,
+			       size_t __ns) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
+						  size_t __n), wmemset);
+extern wchar_t *__REDIRECT_NTH (__wmemset_chk_warn,
+				(wchar_t *__s, wchar_t __c, size_t __n,
+				 size_t __ns), __wmemset_chk)
+     __warnattr ("wmemset called with length bigger than size of destination "
+		 "buffer");
+
+__fortify_function wchar_t *
+__NTH (wmemset (wchar_t *__s, wchar_t __c, size_t __n))
+{
+  if (__bos0 (__s) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n))
+	return __wmemset_chk (__s, __c, __n, __bos0 (__s) / sizeof (wchar_t));
+
+      if (__n > __bos0 (__s) / sizeof (wchar_t))
+	return __wmemset_chk_warn (__s, __c, __n,
+				   __bos0 (__s) / sizeof (wchar_t));
+    }
+  return __wmemset_alias (__s, __c, __n);
+}
+
+
+extern wchar_t *__wcscpy_chk (wchar_t *__restrict __dest,
+			      const wchar_t *__restrict __src,
+			      size_t __n) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcscpy_alias,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src), wcscpy);
+
+__fortify_function wchar_t *
+__NTH (wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+{
+  if (__bos (__dest) != (size_t) -1)
+    return __wcscpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+  return __wcscpy_alias (__dest, __src);
+}
+
+
+extern wchar_t *__wcpcpy_chk (wchar_t *__restrict __dest,
+			      const wchar_t *__restrict __src,
+			      size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcpcpy_alias,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src), wcpcpy);
+
+__fortify_function wchar_t *
+__NTH (wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+{
+  if (__bos (__dest) != (size_t) -1)
+    return __wcpcpy_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+  return __wcpcpy_alias (__dest, __src);
+}
+
+
+extern wchar_t *__wcsncpy_chk (wchar_t *__restrict __dest,
+			       const wchar_t *__restrict __src, size_t __n,
+			       size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcsncpy_alias,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src,
+				 size_t __n), wcsncpy);
+extern wchar_t *__REDIRECT_NTH (__wcsncpy_chk_warn,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src,
+				 size_t __n, size_t __destlen), __wcsncpy_chk)
+     __warnattr ("wcsncpy called with length bigger than size of destination "
+		 "buffer");
+
+__fortify_function wchar_t *
+__NTH (wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+		size_t __n))
+{
+  if (__bos (__dest) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n))
+	return __wcsncpy_chk (__dest, __src, __n,
+			      __bos (__dest) / sizeof (wchar_t));
+      if (__n > __bos (__dest) / sizeof (wchar_t))
+	return __wcsncpy_chk_warn (__dest, __src, __n,
+				   __bos (__dest) / sizeof (wchar_t));
+    }
+  return __wcsncpy_alias (__dest, __src, __n);
+}
+
+
+extern wchar_t *__wcpncpy_chk (wchar_t *__restrict __dest,
+			       const wchar_t *__restrict __src, size_t __n,
+			       size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcpncpy_alias,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src,
+				 size_t __n), wcpncpy);
+extern wchar_t *__REDIRECT_NTH (__wcpncpy_chk_warn,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src,
+				 size_t __n, size_t __destlen), __wcpncpy_chk)
+     __warnattr ("wcpncpy called with length bigger than size of destination "
+		 "buffer");
+
+__fortify_function wchar_t *
+__NTH (wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+		size_t __n))
+{
+  if (__bos (__dest) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n))
+	return __wcpncpy_chk (__dest, __src, __n,
+			      __bos (__dest) / sizeof (wchar_t));
+      if (__n > __bos (__dest) / sizeof (wchar_t))
+	return __wcpncpy_chk_warn (__dest, __src, __n,
+				   __bos (__dest) / sizeof (wchar_t));
+    }
+  return __wcpncpy_alias (__dest, __src, __n);
+}
+
+
+extern wchar_t *__wcscat_chk (wchar_t *__restrict __dest,
+			      const wchar_t *__restrict __src,
+			      size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcscat_alias,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src), wcscat);
+
+__fortify_function wchar_t *
+__NTH (wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src))
+{
+  if (__bos (__dest) != (size_t) -1)
+    return __wcscat_chk (__dest, __src, __bos (__dest) / sizeof (wchar_t));
+  return __wcscat_alias (__dest, __src);
+}
+
+
+extern wchar_t *__wcsncat_chk (wchar_t *__restrict __dest,
+			       const wchar_t *__restrict __src,
+			       size_t __n, size_t __destlen) __THROW;
+extern wchar_t *__REDIRECT_NTH (__wcsncat_alias,
+				(wchar_t *__restrict __dest,
+				 const wchar_t *__restrict __src,
+				 size_t __n), wcsncat);
+
+__fortify_function wchar_t *
+__NTH (wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src,
+		size_t __n))
+{
+  if (__bos (__dest) != (size_t) -1)
+    return __wcsncat_chk (__dest, __src, __n,
+			  __bos (__dest) / sizeof (wchar_t));
+  return __wcsncat_alias (__dest, __src, __n);
+}
+
+
+extern int __swprintf_chk (wchar_t *__restrict __s, size_t __n,
+			   int __flag, size_t __s_len,
+			   const wchar_t *__restrict __format, ...)
+     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 6))) */;
+
+extern int __REDIRECT_NTH_LDBL (__swprintf_alias,
+				(wchar_t *__restrict __s, size_t __n,
+				 const wchar_t *__restrict __fmt, ...),
+				swprintf);
+
+#ifdef __va_arg_pack
+__fortify_function int
+__NTH (swprintf (wchar_t *__restrict __s, size_t __n,
+		 const wchar_t *__restrict __fmt, ...))
+{
+  if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+    return __swprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
+			   __bos (__s) / sizeof (wchar_t),
+			   __fmt, __va_arg_pack ());
+  return __swprintf_alias (__s, __n, __fmt, __va_arg_pack ());
+}
+#elif !defined __cplusplus
+/* XXX We might want to have support in gcc for swprintf.  */
+# define swprintf(s, n, ...) \
+  (__bos (s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1			      \
+   ? __swprintf_chk (s, n, __USE_FORTIFY_LEVEL - 1,			      \
+		     __bos (s) / sizeof (wchar_t), __VA_ARGS__)		      \
+   : swprintf (s, n, __VA_ARGS__))
+#endif
+
+extern int __vswprintf_chk (wchar_t *__restrict __s, size_t __n,
+			    int __flag, size_t __s_len,
+			    const wchar_t *__restrict __format,
+			    __gnuc_va_list __arg)
+     __THROW /* __attribute__ ((__format__ (__wprintf__, 5, 0))) */;
+
+extern int __REDIRECT_NTH_LDBL (__vswprintf_alias,
+				(wchar_t *__restrict __s, size_t __n,
+				 const wchar_t *__restrict __fmt,
+				 __gnuc_va_list __ap), vswprintf);
+
+__fortify_function int
+__NTH (vswprintf (wchar_t *__restrict __s, size_t __n,
+		  const wchar_t *__restrict __fmt, __gnuc_va_list __ap))
+{
+  if (__bos (__s) != (size_t) -1 || __USE_FORTIFY_LEVEL > 1)
+    return __vswprintf_chk (__s, __n,  __USE_FORTIFY_LEVEL - 1,
+			    __bos (__s) / sizeof (wchar_t), __fmt, __ap);
+  return __vswprintf_alias (__s, __n, __fmt, __ap);
+}
+
+
+#if __USE_FORTIFY_LEVEL > 1
+
+extern int __fwprintf_chk (__FILE *__restrict __stream, int __flag,
+			   const wchar_t *__restrict __format, ...);
+extern int __wprintf_chk (int __flag, const wchar_t *__restrict __format,
+			  ...);
+extern int __vfwprintf_chk (__FILE *__restrict __stream, int __flag,
+			    const wchar_t *__restrict __format,
+			    __gnuc_va_list __ap);
+extern int __vwprintf_chk (int __flag, const wchar_t *__restrict __format,
+			   __gnuc_va_list __ap);
+
+# ifdef __va_arg_pack
+__fortify_function int
+wprintf (const wchar_t *__restrict __fmt, ...)
+{
+  return __wprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __va_arg_pack ());
+}
+
+__fortify_function int
+fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __fmt, ...)
+{
+  return __fwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
+			 __va_arg_pack ());
+}
+# elif !defined __cplusplus
+#  define wprintf(...) \
+  __wprintf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+#  define fwprintf(stream, ...) \
+  __fwprintf_chk (stream, __USE_FORTIFY_LEVEL - 1, __VA_ARGS__)
+# endif
+
+__fortify_function int
+vwprintf (const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
+{
+  return __vwprintf_chk (__USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+
+__fortify_function int
+vfwprintf (__FILE *__restrict __stream,
+	   const wchar_t *__restrict __fmt, __gnuc_va_list __ap)
+{
+  return __vfwprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);
+}
+
+#endif
+
+extern wchar_t *__fgetws_chk (wchar_t *__restrict __s, size_t __size, int __n,
+			      __FILE *__restrict __stream) __wur;
+extern wchar_t *__REDIRECT (__fgetws_alias,
+			    (wchar_t *__restrict __s, int __n,
+			     __FILE *__restrict __stream), fgetws) __wur;
+extern wchar_t *__REDIRECT (__fgetws_chk_warn,
+			    (wchar_t *__restrict __s, size_t __size, int __n,
+			     __FILE *__restrict __stream), __fgetws_chk)
+     __wur __warnattr ("fgetws called with bigger size than length "
+		       "of destination buffer");
+
+__fortify_function __wur wchar_t *
+fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+{
+  if (__bos (__s) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n) || __n <= 0)
+	return __fgetws_chk (__s, __bos (__s) / sizeof (wchar_t),
+			     __n, __stream);
+
+      if ((size_t) __n > __bos (__s) / sizeof (wchar_t))
+	return __fgetws_chk_warn (__s, __bos (__s) / sizeof (wchar_t),
+				  __n, __stream);
+    }
+  return __fgetws_alias (__s, __n, __stream);
+}
+
+#ifdef __USE_GNU
+extern wchar_t *__fgetws_unlocked_chk (wchar_t *__restrict __s, size_t __size,
+				       int __n, __FILE *__restrict __stream)
+  __wur;
+extern wchar_t *__REDIRECT (__fgetws_unlocked_alias,
+			    (wchar_t *__restrict __s, int __n,
+			     __FILE *__restrict __stream), fgetws_unlocked)
+  __wur;
+extern wchar_t *__REDIRECT (__fgetws_unlocked_chk_warn,
+			    (wchar_t *__restrict __s, size_t __size, int __n,
+			     __FILE *__restrict __stream),
+			    __fgetws_unlocked_chk)
+     __wur __warnattr ("fgetws_unlocked called with bigger size than length "
+		       "of destination buffer");
+
+__fortify_function __wur wchar_t *
+fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
+{
+  if (__bos (__s) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__n) || __n <= 0)
+	return __fgetws_unlocked_chk (__s, __bos (__s) / sizeof (wchar_t),
+				      __n, __stream);
+
+      if ((size_t) __n > __bos (__s) / sizeof (wchar_t))
+	return __fgetws_unlocked_chk_warn (__s, __bos (__s) / sizeof (wchar_t),
+					   __n, __stream);
+    }
+  return __fgetws_unlocked_alias (__s, __n, __stream);
+}
+#endif
+
+
+extern size_t __wcrtomb_chk (char *__restrict __s, wchar_t __wchar,
+			     mbstate_t *__restrict __p,
+			     size_t __buflen) __THROW __wur;
+extern size_t __REDIRECT_NTH (__wcrtomb_alias,
+			      (char *__restrict __s, wchar_t __wchar,
+			       mbstate_t *__restrict __ps), wcrtomb) __wur;
+
+__fortify_function __wur size_t
+__NTH (wcrtomb (char *__restrict __s, wchar_t __wchar,
+		mbstate_t *__restrict __ps))
+{
+  /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
+     But this would only disturb the namespace.  So we define our own
+     version here.  */
+#define __WCHAR_MB_LEN_MAX	16
+#if defined MB_LEN_MAX && MB_LEN_MAX != __WCHAR_MB_LEN_MAX
+# error "Assumed value of MB_LEN_MAX wrong"
+#endif
+  if (__bos (__s) != (size_t) -1 && __WCHAR_MB_LEN_MAX > __bos (__s))
+    return __wcrtomb_chk (__s, __wchar, __ps, __bos (__s));
+  return __wcrtomb_alias (__s, __wchar, __ps);
+}
+
+
+extern size_t __mbsrtowcs_chk (wchar_t *__restrict __dst,
+			       const char **__restrict __src,
+			       size_t __len, mbstate_t *__restrict __ps,
+			       size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__mbsrtowcs_alias,
+			      (wchar_t *__restrict __dst,
+			       const char **__restrict __src,
+			       size_t __len, mbstate_t *__restrict __ps),
+			      mbsrtowcs);
+extern size_t __REDIRECT_NTH (__mbsrtowcs_chk_warn,
+			      (wchar_t *__restrict __dst,
+			       const char **__restrict __src,
+			       size_t __len, mbstate_t *__restrict __ps,
+			       size_t __dstlen), __mbsrtowcs_chk)
+     __warnattr ("mbsrtowcs called with dst buffer smaller than len "
+		 "* sizeof (wchar_t)");
+
+__fortify_function size_t
+__NTH (mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+		  size_t __len, mbstate_t *__restrict __ps))
+{
+  if (__bos (__dst) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__len))
+	return __mbsrtowcs_chk (__dst, __src, __len, __ps,
+				__bos (__dst) / sizeof (wchar_t));
+
+      if (__len > __bos (__dst) / sizeof (wchar_t))
+	return __mbsrtowcs_chk_warn (__dst, __src, __len, __ps,
+				     __bos (__dst) / sizeof (wchar_t));
+    }
+  return __mbsrtowcs_alias (__dst, __src, __len, __ps);
+}
+
+
+extern size_t __wcsrtombs_chk (char *__restrict __dst,
+			       const wchar_t **__restrict __src,
+			       size_t __len, mbstate_t *__restrict __ps,
+			       size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__wcsrtombs_alias,
+			      (char *__restrict __dst,
+			       const wchar_t **__restrict __src,
+			       size_t __len, mbstate_t *__restrict __ps),
+			      wcsrtombs);
+extern size_t __REDIRECT_NTH (__wcsrtombs_chk_warn,
+			      (char *__restrict __dst,
+			       const wchar_t **__restrict __src,
+			       size_t __len, mbstate_t *__restrict __ps,
+			       size_t __dstlen), __wcsrtombs_chk)
+    __warnattr ("wcsrtombs called with dst buffer smaller than len");
+
+__fortify_function size_t
+__NTH (wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
+		  size_t __len, mbstate_t *__restrict __ps))
+{
+  if (__bos (__dst) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__len))
+	return __wcsrtombs_chk (__dst, __src, __len, __ps, __bos (__dst));
+
+      if (__len > __bos (__dst))
+	return __wcsrtombs_chk_warn (__dst, __src, __len, __ps, __bos (__dst));
+    }
+  return __wcsrtombs_alias (__dst, __src, __len, __ps);
+}
+
+
+#ifdef __USE_GNU
+extern size_t __mbsnrtowcs_chk (wchar_t *__restrict __dst,
+				const char **__restrict __src, size_t __nmc,
+				size_t __len, mbstate_t *__restrict __ps,
+				size_t __dstlen) __THROW;
+extern size_t __REDIRECT_NTH (__mbsnrtowcs_alias,
+			      (wchar_t *__restrict __dst,
+			       const char **__restrict __src, size_t __nmc,
+			       size_t __len, mbstate_t *__restrict __ps),
+			      mbsnrtowcs);
+extern size_t __REDIRECT_NTH (__mbsnrtowcs_chk_warn,
+			      (wchar_t *__restrict __dst,
+			       const char **__restrict __src, size_t __nmc,
+			       size_t __len, mbstate_t *__restrict __ps,
+			       size_t __dstlen), __mbsnrtowcs_chk)
+     __warnattr ("mbsnrtowcs called with dst buffer smaller than len "
+		 "* sizeof (wchar_t)");
+
+__fortify_function size_t
+__NTH (mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src,
+		   size_t __nmc, size_t __len, mbstate_t *__restrict __ps))
+{
+  if (__bos (__dst) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__len))
+	return __mbsnrtowcs_chk (__dst, __src, __nmc, __len, __ps,
+				 __bos (__dst) / sizeof (wchar_t));
+
+      if (__len > __bos (__dst) / sizeof (wchar_t))
+	return __mbsnrtowcs_chk_warn (__dst, __src, __nmc, __len, __ps,
+				      __bos (__dst) / sizeof (wchar_t));
+    }
+  return __mbsnrtowcs_alias (__dst, __src, __nmc, __len, __ps);
+}
+
+
+extern size_t __wcsnrtombs_chk (char *__restrict __dst,
+				const wchar_t **__restrict __src,
+				size_t __nwc, size_t __len,
+				mbstate_t *__restrict __ps, size_t __dstlen)
+     __THROW;
+extern size_t __REDIRECT_NTH (__wcsnrtombs_alias,
+			      (char *__restrict __dst,
+			       const wchar_t **__restrict __src,
+			       size_t __nwc, size_t __len,
+			       mbstate_t *__restrict __ps), wcsnrtombs);
+extern size_t __REDIRECT_NTH (__wcsnrtombs_chk_warn,
+			      (char *__restrict __dst,
+			       const wchar_t **__restrict __src,
+			       size_t __nwc, size_t __len,
+			       mbstate_t *__restrict __ps,
+			       size_t __dstlen), __wcsnrtombs_chk)
+     __warnattr ("wcsnrtombs called with dst buffer smaller than len");
+
+__fortify_function size_t
+__NTH (wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src,
+		   size_t __nwc, size_t __len, mbstate_t *__restrict __ps))
+{
+  if (__bos (__dst) != (size_t) -1)
+    {
+      if (!__builtin_constant_p (__len))
+	return __wcsnrtombs_chk (__dst, __src, __nwc, __len, __ps,
+				 __bos (__dst));
+
+      if (__len > __bos (__dst))
+	return __wcsnrtombs_chk_warn (__dst, __src, __nwc, __len, __ps,
+				      __bos (__dst));
+    }
+  return __wcsnrtombs_alias (__dst, __src, __nwc, __len, __ps);
+}
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/btowc.c b/ap/libc/glibc/glibc-2.23/wcsmbs/btowc.c
new file mode 100644
index 0000000..e9d3fd2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/btowc.c
@@ -0,0 +1,100 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <dlfcn.h>
+#include <gconv.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+#include <limits.h>
+
+#include <sysdep.h>
+
+
+wint_t
+__btowc (int c)
+{
+  const struct gconv_fcts *fcts;
+
+  /* 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;
+
+  /* We know that only ASCII compatible encodings are used for the
+     locale and that the wide character encoding is ISO 10646.  */
+  if (isascii (c))
+    return (wint_t) 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 (btowc_fct != NULL, 1))
+    {
+      /* Use the shortcut function.  */
+#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
+    {
+      /* Fall back to the slow but generic method.  */
+      wchar_t result;
+      struct __gconv_step_data data;
+      unsigned char inbuf[1];
+      const unsigned char *inptr = inbuf;
+      size_t dummy;
+      int status;
+
+      /* 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;
+
+      /* Make sure we start in the initial state.  */
+      memset (&data.__state, '\0', sizeof (mbstate_t));
+
+      /* Create the input string.  */
+      inbuf[0] = c;
+
+      __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)
+	/* The conversion failed.  */
+	result = WEOF;
+
+      return result;
+    }
+}
+weak_alias (__btowc, btowc)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/c16rtomb.c b/ap/libc/glibc/glibc-2.23/wcsmbs/c16rtomb.c
new file mode 100644
index 0000000..ce43409
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/c16rtomb.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <uchar.h>
+#include <wchar.h>
+
+
+/* This is the private state used if PS is NULL.  */
+static mbstate_t state;
+
+size_t
+c16rtomb (char *s, char16_t c16, mbstate_t *ps)
+{
+  // XXX The ISO C 11 spec I have does not say anything about handling
+  // XXX surrogates in this interface.
+  return wcrtomb (s, c16, ps ?: &state);
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_fwscanf.c b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_fwscanf.c
new file mode 100644
index 0000000..0e9148b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_fwscanf.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libioP.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+
+/* Read formatted input from STREAM according to the format string FORMAT.  */
+/* VARARGS2 */
+int
+__isoc99_fwscanf (FILE *stream, const wchar_t *format, ...)
+{
+  va_list arg;
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stream);
+  stream->_flags2 |= _IO_FLAGS2_SCANF_STD;
+
+  va_start (arg, format);
+  done = _IO_vfwscanf (stream, format, arg, NULL);
+  va_end (arg);
+
+  _IO_release_lock (stream);
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_swscanf.c b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_swscanf.c
new file mode 100644
index 0000000..b023f5d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_swscanf.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <libioP.h>
+#include <wchar.h>
+
+/* Read formatted input from S, according to the format string FORMAT.  */
+/* VARARGS2 */
+int
+__isoc99_swscanf (const wchar_t *s, const wchar_t *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __isoc99_vswscanf (s, format, arg);
+  va_end (arg);
+
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vfwscanf.c b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vfwscanf.c
new file mode 100644
index 0000000..59ec197
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vfwscanf.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libioP.h>
+#include <stdio.h>
+#include <wchar.h>
+
+/* Read formatted input from STREAM according to the format string FORMAT.  */
+/* VARARGS2 */
+int
+__isoc99_vfwscanf (FILE *stream, const wchar_t *format, _IO_va_list args)
+{
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stream);
+  stream->_flags2 |= _IO_FLAGS2_SCANF_STD;
+  done = _IO_vfwscanf (stream, format, args, NULL);
+  _IO_release_lock (stream);
+  return done;
+}
+libc_hidden_def (__isoc99_vfwscanf)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vswscanf.c b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vswscanf.c
new file mode 100644
index 0000000..b7effb0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vswscanf.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1993-2016 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, see
+   <http://www.gnu.org/licenses/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include <libioP.h>
+#include <wchar.h>
+#include "../libio/strfile.h"
+
+int
+__isoc99_vswscanf (const wchar_t *string, const wchar_t *format,
+		   _IO_va_list args)
+{
+  int ret;
+  _IO_strfile sf;
+  struct _IO_wide_data wd;
+#ifdef _IO_MTSAFE_IO
+  sf._sbf._f._lock = NULL;
+#endif
+  _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, 0, &wd, &_IO_wstr_jumps);
+  _IO_fwide (&sf._sbf._f, 1);
+  _IO_wstr_init_static (&sf._sbf._f, (wchar_t *)string, 0, NULL);
+  sf._sbf._f._flags2 |= _IO_FLAGS2_SCANF_STD;
+  ret = _IO_vfwscanf ((_IO_FILE *) &sf._sbf, format, args, NULL);
+  return ret;
+}
+libc_hidden_def (__isoc99_vswscanf)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vwscanf.c b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vwscanf.c
new file mode 100644
index 0000000..661c25c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_vwscanf.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <libioP.h>
+#include <stdio.h>
+#include <wchar.h>
+
+/* Read formatted input from STDIN according to the format string FORMAT.  */
+/* VARARGS2 */
+int
+__isoc99_vwscanf (const wchar_t *format, _IO_va_list args)
+{
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stdin);
+  stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
+  done = _IO_vfwscanf (stdin, format, args, NULL);
+  _IO_release_lock (stdin);
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_wscanf.c b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_wscanf.c
new file mode 100644
index 0000000..621edd8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/isoc99_wscanf.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <libioP.h>
+#include <wchar.h>
+
+
+/* Read formatted input from stdin according to the format string FORMAT.  */
+/* VARARGS1 */
+int
+__isoc99_wscanf (const wchar_t *format, ...)
+{
+  va_list arg;
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stdin);
+  stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
+
+  va_start (arg, format);
+  done = _IO_vfwscanf (stdin, format, arg, NULL);
+  va_end (arg);
+
+  _IO_release_lock (stdin);
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/mbrlen.c b/ap/libc/glibc/glibc-2.23/wcsmbs/mbrlen.c
new file mode 100644
index 0000000..905c5b2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/mbrlen.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+/* The mbrlen function has an internal shift state which gets used if
+   the PS parameter is NULL.  */
+static mbstate_t internal;
+
+
+size_t
+__mbrlen (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/ap/libc/glibc/glibc-2.23/wcsmbs/mbrtoc16.c b/ap/libc/glibc/glibc-2.23/wcsmbs/mbrtoc16.c
new file mode 100644
index 0000000..3defdc3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/mbrtoc16.c
@@ -0,0 +1,154 @@
+/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gmail.com>, 2011.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <gconv.h>
+#include <uchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+#ifndef EILSEQ
+# define EILSEQ EINVAL
+#endif
+
+
+/* This is the private state used if PS is NULL.  */
+static mbstate_t state;
+
+size_t
+mbrtoc16 (char16_t *pc16, const char *s, size_t n, mbstate_t *ps)
+{
+  if (ps == NULL)
+    ps = &state;
+
+  /* The standard text does not say that S being NULL means the state
+     is reset even if the second half of a surrogate still have to be
+     returned.  In fact, the error code description indicates
+     otherwise.  Therefore always first try to return a second
+     half.  */
+  if (ps->__count & 0x80000000)
+    {
+      /* We have to return the second word for a surrogate.  */
+      ps->__count &= 0x7fffffff;
+      *pc16 = ps->__value.__wch;
+      ps->__value.__wch = L'\0';
+      return (size_t) -3;
+    }
+
+  wchar_t wc;
+  struct __gconv_step_data data;
+  int status;
+  size_t result;
+  size_t dummy;
+  const unsigned char *inbuf, *endbuf;
+  unsigned char *outbuf = (unsigned char *) &wc;
+  const struct gconv_fcts *fcts;
+
+  /* Set information for this step.  */
+  data.__invocation_counter = 0;
+  data.__internal_use = 1;
+  data.__flags = __GCONV_IS_LAST;
+  data.__statep = ps;
+
+  /* A first special case is if S is NULL.  This means put PS in the
+     initial state.  */
+  if (s == NULL)
+    {
+      pc16 = NULL;
+      s = "";
+      n = 1;
+    }
+
+  if (n == 0)
+    return (size_t) -2;
+
+  /* Tell where we want the result.  */
+  data.__outbuf = outbuf;
+  data.__outbufend = outbuf + sizeof (wchar_t);
+
+  /* Get the conversion functions.  */
+  fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+
+  /* Do a normal conversion.  */
+  inbuf = (const unsigned char *) s;
+  endbuf = inbuf + n;
+  if (__glibc_unlikely (endbuf < inbuf))
+    {
+      endbuf = (const unsigned char *) ~(uintptr_t) 0;
+      if (endbuf == inbuf)
+	goto ilseq;
+    }
+  __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
+     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 = inbuf - (const unsigned char *) s;
+
+      if (wc < 0x10000)
+	{
+	  if (pc16 != NULL)
+	    *pc16 = wc;
+
+	  if (data.__outbuf != outbuf && wc == L'\0')
+	    {
+	      /* The converted character is the NUL character.  */
+	      assert (__mbsinit (data.__statep));
+	      result = 0;
+	    }
+	}
+      else
+	{
+	  /* This is a surrogate.  */
+	  if (pc16 != NULL)
+	    *pc16 = 0xd7c0 + (wc >> 10);
+
+	  ps->__count |= 0x80000000;
+	  ps->__value.__wch = 0xdc00 + (wc & 0x3ff);
+	}
+    }
+  else if (status == __GCONV_INCOMPLETE_INPUT)
+    result = (size_t) -2;
+  else
+    {
+    ilseq:
+      result = (size_t) -1;
+      __set_errno (EILSEQ);
+    }
+
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/mbrtowc.c b/ap/libc/glibc/glibc-2.23/wcsmbs/mbrtowc.c
new file mode 100644
index 0000000..63426d1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/mbrtowc.c
@@ -0,0 +1,129 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <gconv.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+#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, *endbuf;
+  unsigned char *outbuf = (unsigned char *) (pwc ?: buf);
+  const struct gconv_fcts *fcts;
+
+  /* Set information for this step.  */
+  data.__invocation_counter = 0;
+  data.__internal_use = 1;
+  data.__flags = __GCONV_IS_LAST;
+  data.__statep = ps ?: &state;
+
+  /* A first special case is if S is NULL.  This means put PS in the
+     initial state.  */
+  if (s == NULL)
+    {
+      outbuf = (unsigned char *) buf;
+      s = "";
+      n = 1;
+    }
+
+  if (n == 0)
+    return (size_t) -2;
+
+  /* Tell where we want the result.  */
+  data.__outbuf = outbuf;
+  data.__outbufend = outbuf + sizeof (wchar_t);
+
+  /* Get the conversion functions.  */
+  fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+
+  /* Do a normal conversion.  */
+  inbuf = (const unsigned char *) s;
+  endbuf = inbuf + n;
+  if (__glibc_unlikely (endbuf < inbuf))
+    {
+      endbuf = (const unsigned char *) ~(uintptr_t) 0;
+      if (endbuf == inbuf)
+	goto ilseq;
+    }
+  __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
+     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
+    {
+    ilseq:
+      result = (size_t) -1;
+      __set_errno (EILSEQ);
+    }
+
+  return result;
+}
+libc_hidden_def (__mbrtowc)
+weak_alias (__mbrtowc, mbrtowc)
+libc_hidden_weak (mbrtowc)
+
+/* There should be no difference between the UTF-32 handling required
+   by mbrtoc32 and the wchar_t handling which has long since been
+   implemented in mbrtowc.  */
+weak_alias (__mbrtowc, mbrtoc32)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/mbsinit.c b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsinit.c
new file mode 100644
index 0000000..0ea2d61
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsinit.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <string.h>
+#include <wchar.h>
+
+#undef mbsinit
+#undef __mbsinit
+
+/* 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 (const mbstate_t *ps)
+{
+  return ps == NULL || ps->__count == 0;
+}
+weak_alias (__mbsinit, mbsinit)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/mbsnrtowcs.c b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsnrtowcs.c
new file mode 100644
index 0000000..58540b4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsnrtowcs.c
@@ -0,0 +1,143 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <gconv.h>
+#include <string.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+#ifndef EILSEQ
+# define EILSEQ EINVAL
+#endif
+
+
+/* This is the private state used if PS is NULL.  */
+static mbstate_t state;
+
+/* This is a non-standard function but it is very useful in the
+   implementation of stdio because we have to deal with unterminated
+   buffers.  At most NMC bytes will be converted.  */
+size_t
+__mbsnrtowcs (wchar_t *dst, const char **src, size_t nmc, size_t len,
+	      mbstate_t *ps)
+{
+  const unsigned char *srcend;
+  struct __gconv_step_data data;
+  size_t result;
+  int status;
+  struct __gconv_step *towc;
+  size_t dummy;
+  const struct gconv_fcts *fcts;
+
+  /* Tell where we want the result.  */
+  data.__invocation_counter = 0;
+  data.__internal_use = 1;
+  data.__flags = __GCONV_IS_LAST;
+  data.__statep = ps ?: &state;
+
+  if (nmc == 0)
+    return 0;
+  srcend = (const unsigned char *) *src + __strnlen (*src, nmc - 1) + 1;
+
+  /* Get the conversion functions.  */
+  fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+
+  /* 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)
+    {
+      mbstate_t temp_state;
+      wchar_t buf[64];		/* Just an arbitrary size.  */
+      const unsigned char *inbuf = (const unsigned char *) *src;
+
+      temp_state = *data.__statep;
+      data.__statep = &temp_state;
+
+      result = 0;
+      data.__outbufend = (unsigned char *) buf + sizeof (buf);
+      do
+	{
+	  data.__outbuf = (unsigned char *) buf;
+
+	  status = DL_CALL_FCT (fct, (towc, &data, &inbuf, srcend, NULL,
+				      &dummy, 0, 1));
+
+	  result += (wchar_t *) data.__outbuf - buf;
+	}
+      while (status == __GCONV_FULL_OUTPUT);
+
+      if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	  && ((wchar_t *) data.__outbuf)[-1] == L'\0')
+	/* Don't count the NUL character in.  */
+	--result;
+    }
+  else
+    {
+      /* This code is based on the safe assumption that all internal
+	 multi-byte encodings use the NUL byte only to mark the end
+	 of the string.  */
+      data.__outbuf = (unsigned char *) dst;
+      data.__outbufend = data.__outbuf + len * sizeof (wchar_t);
+
+      status = DL_CALL_FCT (fct,
+			    (towc, &data, (const unsigned char **) src, srcend,
+			     NULL, &dummy, 0, 1));
+
+      result = (wchar_t *) data.__outbuf - dst;
+
+      /* We have to determine whether the last character converted
+	 is the NUL character.  */
+      if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	  && (assert (result > 0),
+	      ((wchar_t *) dst)[result - 1] == L'\0'))
+	{
+	  assert (__mbsinit (data.__statep));
+	  *src = NULL;
+	  --result;
+	}
+    }
+
+  /* There must not be any problems with the conversion but illegal input
+     characters.  */
+  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_FULL_OUTPUT
+      && status != __GCONV_EMPTY_INPUT && status != __GCONV_INCOMPLETE_INPUT)
+    {
+      result = (size_t) -1;
+      __set_errno (EILSEQ);
+    }
+
+  return result;
+}
+weak_alias (__mbsnrtowcs, mbsnrtowcs)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/mbsrtowcs.c b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsrtowcs.c
new file mode 100644
index 0000000..36dfbd8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsrtowcs.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include <locale/localeinfo.h>
+
+
+/* This is the private state used if PS is NULL.  */
+static mbstate_t state;
+
+size_t
+__mbsrtowcs (wchar_t *dst, const char **src, size_t len, mbstate_t *ps)
+{
+  return __mbsrtowcs_l (dst, src, len, ps ?: &state, _NL_CURRENT_LOCALE);
+}
+weak_alias (__mbsrtowcs, mbsrtowcs)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/mbsrtowcs_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsrtowcs_l.c
new file mode 100644
index 0000000..90392b6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/mbsrtowcs_l.c
@@ -0,0 +1,163 @@
+/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 2002.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <ctype.h>
+#include <string.h>
+#include "wcsmbsload.h"
+#include <dlfcn.h>
+#include <errno.h>
+#include <gconv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+#ifndef EILSEQ
+# define EILSEQ EINVAL
+#endif
+
+
+size_t
+attribute_hidden
+__mbsrtowcs_l (wchar_t *dst, const char **src, size_t len, mbstate_t *ps,
+	       __locale_t l)
+{
+  struct __gconv_step_data data;
+  size_t result;
+  int status;
+  struct __gconv_step *towc;
+  size_t non_reversible;
+  const struct gconv_fcts *fcts;
+
+  /* Tell where we want the result.  */
+  data.__invocation_counter = 0;
+  data.__internal_use = 1;
+  data.__flags = __GCONV_IS_LAST;
+  data.__statep = ps;
+
+  /* Get the conversion functions.  */
+  fcts = get_gconv_fcts (l->__locales[LC_CTYPE]);
+
+  /* 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)
+    {
+      mbstate_t temp_state;
+      wchar_t buf[64];		/* Just an arbitrary size.  */
+      const unsigned char *inbuf = (const unsigned char *) *src;
+      const unsigned char *srcend = inbuf + strlen (*src) + 1;
+
+      temp_state = *data.__statep;
+      data.__statep = &temp_state;
+
+      result = 0;
+      data.__outbufend = (unsigned char *) buf + sizeof (buf);
+      do
+	{
+	  data.__outbuf = (unsigned char *) buf;
+
+	  status = DL_CALL_FCT (fct, (towc, &data, &inbuf, srcend, NULL,
+				      &non_reversible, 0, 1));
+
+	  result += (wchar_t *) data.__outbuf - buf;
+	}
+      while (status == __GCONV_FULL_OUTPUT);
+
+      if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	{
+	  /* There better should be a NUL wide char at the end.  */
+	  assert (((wchar_t *) data.__outbuf)[-1] == L'\0');
+	  /* Don't count the NUL character in.  */
+	  --result;
+	}
+    }
+  else
+    {
+      /* This code is based on the safe assumption that all internal
+	 multi-byte encodings use the NUL byte only to mark the end
+	 of the string.  */
+      const unsigned char *srcp = (const unsigned char *) *src;
+      const unsigned char *srcend;
+
+      data.__outbuf = (unsigned char *) dst;
+      data.__outbufend = data.__outbuf + len * sizeof (wchar_t);
+
+      status = __GCONV_FULL_OUTPUT;
+
+      while (len > 0)
+	{
+	  /* Pessimistic guess as to how much input we can use.  In the
+	     worst case we need one input byte for one output wchar_t.  */
+	  srcend = srcp + __strnlen ((const char *) srcp, len) + 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.  */
+	      || srcp != srcend
+	      /* Reached the end of the input.  */
+	      || srcend[-1] == '\0')
+	    break;
+
+	  len = (wchar_t *) data.__outbufend - (wchar_t *) data.__outbuf;
+	}
+
+      /* Make the end if the input known to the caller.  */
+      *src = (const char *) srcp;
+
+      result = (wchar_t *) data.__outbuf - dst;
+
+      /* We have to determine whether the last character converted
+	 is the NUL character.  */
+      if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	  && ((wchar_t *) dst)[result - 1] == L'\0')
+	{
+	  assert (result > 0);
+	  assert (__mbsinit (data.__statep));
+	  *src = NULL;
+	  --result;
+	}
+    }
+
+  /* There must not be any problems with the conversion but illegal input
+     characters.  */
+  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_FULL_OUTPUT
+      && status != __GCONV_EMPTY_INPUT && status != __GCONV_INCOMPLETE_INPUT)
+    {
+      result = (size_t) -1;
+      __set_errno (EILSEQ);
+    }
+
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcpcpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcpcpy.c
new file mode 100644
index 0000000..1abb242
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcpcpy.c
@@ -0,0 +1,20 @@
+/* Test wcspcpy functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-stpcpy.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcpncpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcpncpy.c
new file mode 100644
index 0000000..ef02f34
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcpncpy.c
@@ -0,0 +1,20 @@
+/* Test wcpncpy functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-stpncpy.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscat.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscat.c
new file mode 100644
index 0000000..1a298ca
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscat.c
@@ -0,0 +1,20 @@
+/* Test wcscat functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strcat.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcschr.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcschr.c
new file mode 100644
index 0000000..be0abf7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcschr.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strchr.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcschrnul.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcschrnul.c
new file mode 100644
index 0000000..1290fe3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcschrnul.c
@@ -0,0 +1,20 @@
+/* Test wcschrnul functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strchrnul.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscmp.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscmp.c
new file mode 100644
index 0000000..aa18c30
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strcmp.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscpy.c
new file mode 100644
index 0000000..b7cad53
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscpy.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strcpy.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscspn.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscspn.c
new file mode 100644
index 0000000..ae32abc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcscspn.c
@@ -0,0 +1,20 @@
+/* Test wcscspn functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strcspn.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcslen.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcslen.c
new file mode 100644
index 0000000..496fa18
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcslen.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strlen.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncat.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncat.c
new file mode 100644
index 0000000..924455c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncat.c
@@ -0,0 +1,20 @@
+/* Test wcsncat functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strncat.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncmp.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncmp.c
new file mode 100644
index 0000000..07757d8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strncmp.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncpy.c
new file mode 100644
index 0000000..31ddfcf
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsncpy.c
@@ -0,0 +1,20 @@
+/* Test wcsncpy functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strncpy.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsnlen.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsnlen.c
new file mode 100644
index 0000000..eb535db
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsnlen.c
@@ -0,0 +1,20 @@
+/* Test wcsnlen function.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strnlen.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcspbrk.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcspbrk.c
new file mode 100644
index 0000000..2d5fdcc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcspbrk.c
@@ -0,0 +1,20 @@
+/* Test wcspbrk functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strpbrk.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsrchr.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsrchr.c
new file mode 100644
index 0000000..95a5568
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsrchr.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strrchr.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsspn.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsspn.c
new file mode 100644
index 0000000..bf74cf1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wcsspn.c
@@ -0,0 +1,20 @@
+/* Test wcsspn functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-strspn.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemchr.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemchr.c
new file mode 100644
index 0000000..998b951
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemchr.c
@@ -0,0 +1,20 @@
+/* Test wmemchr functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-memchr.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemcmp.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemcmp.c
new file mode 100644
index 0000000..73bc4b7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemcmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-memcmp.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemset.c b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemset.c
new file mode 100644
index 0000000..6a45686
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/test-wmemset.c
@@ -0,0 +1,20 @@
+/* Test wmemset functions.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define WIDE 1
+#include "../string/test-memset.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-btowc.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-btowc.c
new file mode 100644
index 0000000..ba0521b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-btowc.c
@@ -0,0 +1,177 @@
+/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <locale.h>
+#include <stdio.h>
+#include <wchar.h>
+
+
+/* Currently selected locale.  */
+static const char *current_locale;
+
+
+/* Test which should succeed.  */
+static int
+ok_test (int c, wint_t expwc)
+{
+  wint_t wc = btowc (c);
+
+  if (wc != expwc)
+    {
+      printf ("%s: btowc('%c') failed, returned L'\\x%x' instead of L'\\x%x'\n",
+	      current_locale, c, wc, expwc);
+      return 1;
+    }
+
+  return 0;
+}
+
+/* Test which should fail.  */
+static int
+fail_test (int c)
+{
+  wint_t wc = btowc (c);
+
+  if (wc != WEOF)
+    {
+      printf ("%s: btowc('%c') succeded, returned L'\\x%x' instead of WEOF\n",
+	      current_locale, c, wc);
+      return 1;
+    }
+
+  return 0;
+}
+
+
+/* Test EOF handling.  */
+static int
+eof_test (void)
+{
+  wint_t wc = btowc (EOF);
+  if (wc != WEOF)
+    {
+      printf ("%s: btowc(EOF) returned L'\\x%x', not WEOF\n",
+	      current_locale, wc);
+    }
+
+  return 0;
+}
+
+
+/* Test the btowc() function for a few locales with known character sets.  */
+static int
+do_test (void)
+{
+  int result = 0;
+
+  current_locale = setlocale (LC_ALL, "en_US.ANSI_X3.4-1968");
+  if (current_locale == NULL)
+    {
+      puts ("cannot set locale \"en_US.ANSI_X3.4-1968\"");
+      result = 1;
+    }
+  else
+    {
+      int c;
+
+      for (c = 0; c < 128; ++c)
+	result |= ok_test (c, c);
+
+      for (c = 128; c < 256; ++c)
+	result |= fail_test (c);
+
+      result |= eof_test ();
+    }
+
+  current_locale = setlocale (LC_ALL, "de_DE.ISO-8859-1");
+  if (current_locale == NULL)
+    {
+      puts ("cannot set locale \"de_DE.ISO-8859-1\"");
+      result = 1;
+    }
+  else
+    {
+      int c;
+
+      for (c = 0; c < 256; ++c)
+	result |= ok_test (c, c);
+
+      result |= eof_test ();
+    }
+
+  current_locale = setlocale (LC_ALL, "de_DE.UTF-8");
+  if (current_locale == NULL)
+    {
+      puts ("cannot set locale \"de_DE.UTF-8\"");
+      result = 1;
+    }
+  else
+    {
+      int c;
+
+      for (c = 0; c < 128; ++c)
+	result |= ok_test (c, c);
+
+      for (c = 128; c < 256; ++c)
+	result |= fail_test (c);
+
+      result |= eof_test ();
+    }
+
+  current_locale = setlocale (LC_ALL, "hr_HR.ISO-8859-2");
+  if (current_locale == NULL)
+    {
+      puts ("cannot set locale \"hr_HR.ISO-8859-2\"");
+      result = 1;
+    }
+  else
+    {
+      static const wint_t upper_half[] =
+      {
+	0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7, 0x00A8,
+	0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B, 0x00B0,
+	0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7, 0x00B8,
+	0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C, 0x0154,
+	0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7, 0x010C,
+	0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E, 0x0110,
+	0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7, 0x0158,
+	0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF, 0x0155,
+	0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7, 0x010D,
+	0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F, 0x0111,
+	0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7, 0x0159,
+	0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9
+      };
+      int c;
+
+      for (c = 0; c < 161; ++c)
+	result |= ok_test (c, c);
+
+      for (c = 161; c < 256; ++c)
+	result |= ok_test (c, upper_half[c - 161]);
+
+      result |= eof_test ();
+    }
+
+  if (result == 0)
+    puts ("all OK");
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-c16c32-1.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-c16c32-1.c
new file mode 100644
index 0000000..3b1c1d6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-c16c32-1.c
@@ -0,0 +1,131 @@
+#include <inttypes.h>
+#include <locale.h>
+#include <stdio.h>
+#include <uchar.h>
+#include <stdint.h>
+
+static int
+do_test (void)
+{
+  if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
+    {
+      puts ("cannot set locale");
+      return 1;
+    }
+
+  int result = 0;
+
+  char32_t c32 = 48;
+  do
+    {
+      if (c32 >= 0xd800 && c32 <= 0xe000)
+	continue;
+
+      char buf[20];
+      size_t n1 = c32rtomb (buf, c32, NULL);
+      if (n1 <= 0)
+	{
+	  printf ("c32rtomb for U'\\x%" PRIx32 "' failed\n", (uint32_t) c32);
+	  result = 1;
+	  continue;
+	}
+
+      char32_t c32out;
+      size_t n2 = mbrtoc32 (&c32out, buf, n1, NULL);
+      if ((ssize_t) n2 < 0)
+	{
+	  printf ("mbrtoc32 for U'\\x%" PRIx32 "' failed\n", (uint32_t) c32);
+	  result = 1;
+	  continue;
+	}
+      if (n2 != n1)
+	{
+	  printf ("mbrtoc32 for U'\\x%" PRIx32 "' consumed %zu bytes, not %zu\n",
+		  (uint32_t) c32, n2, n1);
+	  result = 1;
+	}
+      else if (c32out != c32)
+	{
+	  printf ("mbrtoc32 for U'\\x%" PRIx32 "' produced U'\\x%" PRIx32 "\n",
+		  (uint32_t) c32, (uint32_t) c32out);
+	  result = 1;
+	}
+
+      char16_t c16;
+      size_t n3 = mbrtoc16 (&c16, buf, n1, NULL);
+      if (n3 != n1)
+	{
+	  printf ("mbrtoc16 for U'\\x%" PRIx32 "' did not consume all bytes\n",
+		  (uint32_t) c32);
+	  result = 1;
+	  continue;
+	}
+      if (c32 < 0x10000)
+	{
+	  if (c16 != c32)
+	    {
+	      printf ("mbrtoc16 for U'\\x%" PRIx32 "' produce u'\\x%" PRIx16 "'\n",
+		      (uint32_t) c32, (uint16_t) c16);
+	      result = 1;
+	      continue;
+	    }
+	}
+      else
+	{
+	  buf[0] = '1';
+	  char16_t c16_2;
+	  size_t n4 = mbrtoc16 (&c16_2, buf, 1, NULL);
+	  if (n4 != (size_t) -3)
+	    {
+	      printf ("second mbrtoc16 for U'\\x%" PRIx32 "' did not return -3\n",
+		      (uint32_t) c32);
+	      result = 1;
+	      continue;
+	    }
+
+	  if (c32 != (((uint32_t) (c16 - 0xd7c0)) << 10) + (c16_2 - 0xdc00))
+	    {
+	      printf ("mbrtoc16 for U'\\x%" PRIx32 "' returns U'\\x%" PRIx32 "\n",
+		      (uint32_t) c32,
+		      (((uint32_t) (c16 - 0xd7c0)) << 10) + (c16_2 - 0xdc00));
+	      result = 1;
+	      continue;
+	    }
+	}
+
+      buf[0] = '\0';
+      char16_t c16_nul;
+      n3 = mbrtoc16 (&c16_nul, buf, n1, NULL);
+      if (n3 != 0)
+	{
+	  printf ("mbrtoc16 for '\\0' returns %zd\n", n3);
+	  result = 1;
+	  continue;
+	}
+
+      if (c32 < 0x10000)
+	{
+	  size_t n5 = c16rtomb (buf, c16, NULL);
+	  if ((ssize_t) n5 < 0)
+	    {
+	      printf ("c16rtomb for U'\\x%" PRIx32 "' failed with %zd\n",
+		      (uint32_t) c32, n5);
+	      result = 1;
+	      continue;
+	    }
+	  if (n5 != n1)
+	    {
+	      printf ("c16rtomb for U'\\x%" PRIx32 "' produced %zu bytes instead of %zu bytes\n",
+		      (uint32_t) c32, n5, n1);
+	      result = 1;
+	      continue;
+	    }
+	}
+    }
+  while ((c32 += 0x1111) <= U'\x12000');
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbrtowc.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbrtowc.c
new file mode 100644
index 0000000..4017ac5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbrtowc.c
@@ -0,0 +1,235 @@
+/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* We always want assert to be fully defined.  */
+#undef NDEBUG
+#include <assert.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+
+static int check_ascii (const char *locname);
+
+/* UTF-8 single byte feeding test for mbrtowc(),
+   contributed by Markus Kuhn <mkuhn@acm.org>.  */
+static int
+utf8_test_1 (void)
+{
+  wchar_t wc;
+  mbstate_t s;
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, "\xE2", 1, &s) == (size_t) -2);	/* 1st byte processed */
+  assert (mbrtowc (&wc, "\x89", 1, &s) == (size_t) -2);	/* 2nd byte processed */
+  assert (wc == 42);		/* no value has not been stored into &wc yet */
+  assert (mbrtowc (&wc, "\xA0", 1, &s) == 1);	/* 3nd byte processed */
+  assert (wc == 0x2260);	/* E2 89 A0 = U+2260 (not equal) decoded correctly */
+  assert (mbrtowc (&wc, "", 1, &s) == 0);	/* test final byte processing */
+  assert (wc == 0);		/* test final byte decoding */
+
+  /* The following test is by Al Viro <aviro@redhat.com>.  */
+  const char str[] = "\xe0\xa0\x80";
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, str, 1, &s) == -2);
+  assert (mbrtowc (&wc, str + 1, 2, &s) == 2);
+  assert (wc == 0x800);
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, str, 3, &s) == 3);
+  assert (wc == 0x800);
+
+  return 0;
+}
+
+/* Test for NUL byte processing via empty string.  */
+static int
+utf8_test_2 (void)
+{
+  wchar_t wc;
+  mbstate_t s;
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (NULL, "", 1, &s) == 0); /* valid terminator */
+  assert (mbsinit (&s));
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, "\xE2", 1, &s) == (size_t) -2);	/* 1st byte processed */
+  assert (mbrtowc (NULL, "", 1, &s) == (size_t) -1); /* invalid terminator */
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, "\xE2", 1, &s) == (size_t) -2);	/* 1st byte processed */
+  assert (mbrtowc (&wc, "\x89", 1, &s) == (size_t) -2);	/* 2nd byte processed */
+  assert (mbrtowc (NULL, "", 1, &s) == (size_t) -1); /* invalid terminator */
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, "\xE2", 1, &s) == (size_t) -2);	/* 1st byte processed */
+  assert (mbrtowc (&wc, "\x89", 1, &s) == (size_t) -2);	/* 2nd byte processed */
+  assert (mbrtowc (&wc, "\xA0", 1, &s) == 1);	/* 3nd byte processed */
+  assert (mbrtowc (NULL, "", 1, &s) == 0); /* valid terminator */
+  assert (mbsinit (&s));
+
+  return 0;
+}
+
+/* Test for NUL byte processing via NULL string.  */
+static int
+utf8_test_3 (void)
+{
+  wchar_t wc;
+  mbstate_t s;
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (NULL, NULL, 0, &s) == 0); /* valid terminator */
+  assert (mbsinit (&s));
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, "\xE2", 1, &s) == (size_t) -2);	/* 1st byte processed */
+  assert (mbrtowc (NULL, NULL, 0, &s) == (size_t) -1); /* invalid terminator */
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, "\xE2", 1, &s) == (size_t) -2);	/* 1st byte processed */
+  assert (mbrtowc (&wc, "\x89", 1, &s) == (size_t) -2);	/* 2nd byte processed */
+  assert (mbrtowc (NULL, NULL, 0, &s) == (size_t) -1); /* invalid terminator */
+
+  wc = 42;			/* arbitrary number */
+  memset (&s, 0, sizeof (s));	/* get s into initial state */
+  assert (mbrtowc (&wc, "\xE2", 1, &s) == (size_t) -2);	/* 1st byte processed */
+  assert (mbrtowc (&wc, "\x89", 1, &s) == (size_t) -2);	/* 2nd byte processed */
+  assert (mbrtowc (&wc, "\xA0", 1, &s) == 1);	/* 3nd byte processed */
+  assert (mbrtowc (NULL, NULL, 0, &s) == 0); /* valid terminator */
+  assert (mbsinit (&s));
+
+  return 0;
+}
+
+static int
+utf8_test (void)
+{
+  const char *locale = "de_DE.UTF-8";
+  int error = 0;
+
+  if (!setlocale (LC_CTYPE, locale))
+    {
+      fprintf (stderr, "locale '%s' not available!\n", locale);
+      exit (1);
+    }
+
+  error |= utf8_test_1 ();
+  error |= utf8_test_2 ();
+  error |= utf8_test_3 ();
+
+  return error;
+}
+
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  /* Check mapping of ASCII range for some character sets which have
+     ASCII as a subset.  For those the wide char generated must have
+     the same value.  */
+  setlocale (LC_ALL, "C");
+  result |= check_ascii (setlocale (LC_ALL, NULL));
+
+  setlocale (LC_ALL, "de_DE.UTF-8");
+  result |= check_ascii (setlocale (LC_ALL, NULL));
+  result |= utf8_test ();
+
+  setlocale (LC_ALL, "ja_JP.EUC-JP");
+  result |= check_ascii (setlocale (LC_ALL, NULL));
+
+  return result;
+}
+
+
+static int
+check_ascii (const char *locname)
+{
+  int c;
+  int res = 0;
+
+  printf ("Testing locale \"%s\":\n", locname);
+
+  for (c = 0; c <= 127; ++c)
+    {
+      char buf[MB_CUR_MAX];
+      wchar_t wc = 0xffffffff;
+      mbstate_t s;
+      size_t n, i;
+
+      for (i = 0; i < MB_CUR_MAX; ++i)
+	buf[i] = c + i;
+
+      memset (&s, '\0', sizeof (s));
+
+      n = mbrtowc (&wc, buf, MB_CUR_MAX, &s);
+      if (n == (size_t) -1)
+	{
+	  printf ("%s: '\\x%x': encoding error\n", locname, c);
+	  ++res;
+	}
+      else if (n == (size_t) -2)
+	{
+	  printf ("%s: '\\x%x': incomplete character\n", locname, c);
+	  ++res;
+	}
+      else if (n == 0 && c != 0)
+	{
+	  printf ("%s: '\\x%x': 0 returned\n", locname, c);
+	  ++res;
+	}
+      else if (n != 0 && c == 0)
+	{
+	  printf ("%s: '\\x%x': not 0 returned\n", locname, c);
+	  ++res;
+	}
+      else if (c != 0 && n != 1)
+	{
+	  printf ("%s: '\\x%x': not 1 returned\n", locname, c);
+	  ++res;
+	}
+      else if (wc != (wchar_t) c)
+	{
+	  printf ("%s: '\\x%x': wc != L'\\x%x'\n", locname, c, c);
+	  ++res;
+	}
+    }
+
+  printf (res == 1 ? "%d error\n" : "%d errors\n", res);
+
+  return res != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbrtowc2.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbrtowc2.c
new file mode 100644
index 0000000..67d8e29
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbrtowc2.c
@@ -0,0 +1,67 @@
+/* Derived from the test case in http://sourceware.org/bugzilla/show_bug.cgi?id=714 */
+#include <locale.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+
+
+static struct
+{
+  const char *chp;
+  size_t nchp;
+  const char *loc;
+} tests[] =
+{
+  { (const char[]) { 0x8F, 0xA2, 0xAF }, 3, "ja_JP.EUC-JP" },
+  { (const char[]) { 0xD1, 0xA5 }, 2, "ja_JP.EUC-JP" },
+  { (const char[]) { 0x8E, 0xA5 }, 2, "ja_JP.EUC-JP" },
+  { (const char[]) { 0x8E, 0xA2, 0xA1, 0xA1 }, 4, "zh_TW.EUC-TW" },
+  { (const char[]) { 0xA1, 0xA1 }, 2, "zh_TW.EUC-TW" },
+  { (const char[]) { 0xE3, 0x80, 0x80 }, 3, "de_DE.UTF-8" },
+  { (const char[]) { 0xC3, 0xA4 }, 2, "de_DE.UTF-8" }
+};
+#define ntests (sizeof (tests) / sizeof (tests[0]))
+
+
+static int t (const char *ch, size_t nch, const char *loc);
+
+static int
+do_test (void)
+{
+  int r = 0;
+  for (int i = 0; i < ntests; ++i)
+    r |= t (tests[i].chp, tests[i].nchp, tests[i].loc);
+  return r;
+}
+
+static int
+t (const char *ch, size_t nch, const char *loc)
+{
+  int i;
+  wchar_t wch;
+  wchar_t wch2;
+  mbstate_t mbs;
+  int n = 0;
+
+  setlocale (LC_ALL, loc);
+
+  memset (&mbs, '\0', sizeof (mbstate_t));
+  for (i = 0; i < nch; i++)
+    {
+      n = mbrtowc (&wch, ch + i, 1, &mbs);
+      if (n >= 0)
+	break;
+    }
+  printf ("n = %d, count = %d, wch = %08lX\n", n, i, (unsigned long int) wch);
+
+  memset (&mbs, '\0', sizeof (mbstate_t));
+  n = mbrtowc (&wch2, ch, nch, &mbs);
+  printf ("n = %d, wch = %08lX\n", n, (unsigned long int) wch2);
+
+  int ret = n != nch || i + 1 != nch || n != nch || wch != wch2;
+  puts (ret ? "FAIL\n" : "OK\n");
+  return ret;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbsrtowcs.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbsrtowcs.c
new file mode 100644
index 0000000..38eb1ed
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-mbsrtowcs.c
@@ -0,0 +1,67 @@
+/* Test NUL handling of mbsrtowcs.
+   Copyright (C) 2004-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2004.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+
+static int
+do_test (void)
+{
+  const unsigned char buf[] = { 'a', 'b', '\0', 'c', 'd', '\0', 'e' };
+  wchar_t out[sizeof (buf)];
+  memset (out, '\xff', sizeof (out));
+
+  mbstate_t state;
+  memset (&state, '\0', sizeof (state));
+
+  const char *in = (const char *) buf;
+  size_t n = mbsrtowcs (out, &in, sizeof (out) / sizeof (wchar_t), &state);
+
+  int result = 0;
+  if (n != 2)
+    {
+      printf ("n = %zu, expected 2\n", n);
+      result = 1;
+    }
+  if (in != NULL)
+    {
+      printf ("in = %p, expected NULL\n", in);
+      result = 1;
+    }
+  if (out[0] != L'a')
+    {
+      printf ("out[0] = L'%lc', expected L'a'\n", (wint_t) out[0]);
+      result = 1;
+    }
+  if (out[1] != L'b')
+    {
+      printf ("out[1] = L'%lc', expected L'b'\n", (wint_t) out[1]);
+      result = 1;
+    }
+  if (out[2] != L'\0')
+    {
+      printf ("out[2] = L'%lc', expected L'\\0'\n", (wint_t) out[2]);
+      result = 1;
+    }
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wchar-h.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wchar-h.c
new file mode 100644
index 0000000..fd2ad56
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wchar-h.c
@@ -0,0 +1,12 @@
+#include <stdlib.h>
+#include <wchar.h>
+
+static int
+do_test (void)
+{
+  mbstate_t x;
+  return sizeof (x) - sizeof (mbstate_t);
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcpncpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcpncpy.c
new file mode 100644
index 0000000..9585f6b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcpncpy.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2003-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 2003.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <wchar.h>
+
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  const wchar_t src[] = L"0";
+  wchar_t dest[21];
+  wmemset (dest, L'\0', 10);
+  wchar_t *endp = wcpncpy (dest, src, 2);
+  if (wcscmp (dest, src) != 0)
+    {
+      result = 1;
+      puts ("L\"0\" string test failed");
+    }
+  if (endp != dest + 1)
+    {
+      result = 1;
+      puts ("return value of L\"0\" string call incorrect");
+    }
+
+  const wchar_t src2[] = L"abc";
+  endp = wcpncpy (dest, src2, 2);
+  if (endp != dest + 2)
+    {
+      result = 1;
+      puts ("return value of limited call incorrect");
+    }
+
+  const wchar_t src3[] = L"";
+  endp = wcpncpy (dest, src3, 2);
+  if (endp != dest)
+    {
+      result = 1;
+      puts ("return value of empty string call incorrect");
+    }
+
+  const wchar_t src4[] = L"abcdefghijklmnopqrstuvwxyz";
+  endp = wcpncpy (dest, src4, 2);
+  if (endp != dest + 2)
+    {
+      result = 1;
+      puts ("return value of long string call incorrect");
+    }
+
+  const wchar_t src5[] = L"ab";
+  endp = wcpncpy (dest, src5, 20);
+  if (endp != dest + 2)
+    {
+      result = 1;
+      puts ("return value of large limit call incorrect");
+    }
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcrtomb.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcrtomb.c
new file mode 100644
index 0000000..4cf19fc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcrtomb.c
@@ -0,0 +1,97 @@
+/* Copyright (C) 2000-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+
+static int check_ascii (const char *locname);
+
+
+static int
+do_test (void)
+{
+  int result = 0;
+
+  /* Check mapping of ASCII range for some character sets which have
+     ASCII as a subset.  For those the wide char generated must have
+     the same value.  */
+  setlocale (LC_ALL, "C");
+  result |= check_ascii (setlocale (LC_ALL, NULL));
+
+  setlocale (LC_ALL, "de_DE.UTF-8");
+  result |= check_ascii (setlocale (LC_ALL, NULL));
+
+  setlocale (LC_ALL, "ja_JP.EUC-JP");
+  result |= check_ascii (setlocale (LC_ALL, NULL));
+
+  return result;
+}
+
+
+static int
+check_ascii (const char *locname)
+{
+  wchar_t wc;
+  int res = 0;
+
+  printf ("Testing locale \"%s\":\n", locname);
+
+  for (wc = 0; wc <= 127; ++wc)
+    {
+      char buf[2 * MB_CUR_MAX];
+      mbstate_t s;
+      size_t n;
+
+      memset (buf, '\xff', sizeof (buf));
+      memset (&s, '\0', sizeof (s));
+
+      n = wcrtomb (buf, wc, &s);
+      if (n == (size_t) -1)
+	{
+	  printf ("%s: '\\x%x': encoding error\n", locname, (int) wc);
+	  ++res;
+	}
+      else if (n == 0)
+	{
+	  printf ("%s: '\\x%x': 0 returned\n", locname, (int) wc);
+	  ++res;
+	}
+      else if (n != 1)
+	{
+	  printf ("%s: '\\x%x': not 1 returned\n", locname, (int) wc);
+	  ++res;
+	}
+      else if (wc != (wchar_t) buf[0])
+	{
+	  printf ("%s: L'\\x%x': buf[0] != '\\x%x'\n", locname, (int) wc,
+		  (int) wc);
+	  ++res;
+	}
+    }
+
+  printf (res == 1 ? "%d error\n" : "%d errors\n", res);
+
+  return res != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcsnlen.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcsnlen.c
new file mode 100644
index 0000000..7d58876
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcsnlen.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stdio.h>
+#include <wchar.h>
+
+#define TEST(Str, Max, Exp) \
+  n = wcsnlen (L##Str, Max);						      \
+  if (n != Exp)								      \
+    {									      \
+      result = 1;							      \
+      printf ("wcsnlen (L\"%s\", %d) = %d, not %d\n", Str, Max, n, Exp);      \
+    }
+
+static int
+do_test (void)
+{
+  int result = 0;
+  int n;
+
+  TEST ("0123456789", 0, 0);
+  TEST ("0123456789", 1, 1);
+  TEST ("0123456789", 2, 2);
+  TEST ("0123456789", 3, 3);
+  TEST ("0123456789", 4, 4);
+  TEST ("0123456789", 5, 5);
+  TEST ("0123456789", 6, 6);
+  TEST ("0123456789", 7, 7);
+  TEST ("0123456789", 8, 8);
+  TEST ("0123456789", 9, 9);
+
+  TEST ("01234", 9, 5);
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstod-nan-locale.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstod-nan-locale.c
new file mode 100644
index 0000000..41c91c4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstod-nan-locale.c
@@ -0,0 +1,25 @@
+/* Test strtod functions work with all ASCII letters in NAN(...) in
+   Turkish locales (bug 19266).  Wide string version.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define CHAR wchar_t
+#define SFMT "L\"%ls\""
+#define FNPFX wcsto
+#define L_(C) L ## C
+
+#include "../stdlib/tst-strtod-nan-locale-main.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstof.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstof.c
new file mode 100644
index 0000000..576a58c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstof.c
@@ -0,0 +1,26 @@
+#define _GNU_SOURCE 1
+#include <wchar.h>
+#include <stdio.h>
+#include <string.h>
+#include <wctype.h>
+
+static int
+do_test (void)
+{
+  int result = 0;
+  char buf[100];
+  wchar_t tmp[3];
+  tmp[0] = '8';
+  tmp[1] = '1';
+  tmp[2] = 0;
+
+  snprintf (buf, 100, "%S = %f", tmp, wcstof (tmp, NULL));
+  printf ("\"%s\" -> %s\n", buf,
+	  strcmp (buf, "81 = 81.000000") == 0 ? "okay" : "buggy");
+  result |= strcmp (buf, "81 = 81.000000") != 0;
+
+  return result;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstol-locale.c b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstol-locale.c
new file mode 100644
index 0000000..c50cb5c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/tst-wcstol-locale.c
@@ -0,0 +1,25 @@
+/* Test strtol functions work with all ASCII letters in Turkish
+   locales (bug 19242).  Wide string version.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define CHAR wchar_t
+#define SFMT "L\"%ls\""
+#define FNPFX wcsto
+#define L_(C) L ## C
+
+#include "../stdlib/tst-strtol-locale-main.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/uchar.h b/ap/libc/glibc/glibc-2.23/wcsmbs/uchar.h
new file mode 100644
index 0000000..ce92b25
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/uchar.h
@@ -0,0 +1,83 @@
+/* Copyright (C) 2011-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+/*
+ *      ISO C11 Standard: 7.28
+ *	Unicode utilities	<uchar.h>
+ */
+
+#ifndef _UCHAR_H
+#define _UCHAR_H	1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+#define __need_mbstate_t
+#include <wchar.h>
+
+#ifndef __mbstate_t_defined
+__BEGIN_NAMESPACE_C99
+/* Public type.  */
+typedef __mbstate_t mbstate_t;
+__END_NAMESPACE_C99
+# define __mbstate_t_defined 1
+#endif
+
+
+#if defined __GNUC__ && !defined __USE_ISOCXX11
+/* Define the 16-bit and 32-bit character types.  Use the information
+   provided by the compiler.  */
+# if !defined __CHAR16_TYPE__ || !defined __CHAR32_TYPE__
+#  if defined __STDC_VERSION__ && __STDC_VERSION__ < 201000L
+#   error "<uchar.h> requires ISO C11 mode"
+#  else
+#   error "definitions of __CHAR16_TYPE__ and/or __CHAR32_TYPE__ missing"
+#  endif
+# endif
+typedef __CHAR16_TYPE__ char16_t;
+typedef __CHAR32_TYPE__ char32_t;
+#endif
+
+
+__BEGIN_DECLS
+
+/* Write char16_t representation of multibyte character pointed
+   to by S to PC16.  */
+extern size_t mbrtoc16 (char16_t *__restrict __pc16,
+			const char *__restrict __s, size_t __n,
+			mbstate_t *__restrict __p) __THROW;
+
+/* Write multibyte representation of char16_t C16 to S.  */
+extern size_t c16rtomb (char *__restrict __s, char16_t __c16,
+			mbstate_t *__restrict __ps) __THROW;
+
+
+
+/* Write char32_t representation of multibyte character pointed
+   to by S to PC32.  */
+extern size_t mbrtoc32 (char32_t *__restrict __pc32,
+			const char *__restrict __s, size_t __n,
+			mbstate_t *__restrict __p) __THROW;
+
+/* Write multibyte representation of char32_t C32 to S.  */
+extern size_t c32rtomb (char *__restrict __s, char32_t __c32,
+			mbstate_t *__restrict __ps) __THROW;
+
+__END_DECLS
+
+#endif	/* uchar.h */
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wchar.h b/ap/libc/glibc/glibc-2.23/wcsmbs/wchar.h
new file mode 100644
index 0000000..e413416
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wchar.h
@@ -0,0 +1,903 @@
+/* Copyright (C) 1995-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+/*
+ *      ISO C99 Standard: 7.24
+ *	Extended multibyte and wide character utilities	<wchar.h>
+ */
+
+#ifndef _WCHAR_H
+
+#if !defined __need_mbstate_t && !defined __need_wint_t
+# define _WCHAR_H 1
+# include <features.h>
+#endif
+
+#ifdef _WCHAR_H
+/* Get FILE definition.  */
+# define __need___FILE
+# if defined __USE_UNIX98 || defined __USE_XOPEN2K
+#  define __need_FILE
+# endif
+# include <stdio.h>
+/* Get va_list definition.  */
+# define __need___va_list
+# include <stdarg.h>
+
+# include <bits/wchar.h>
+
+/* Get size_t, wchar_t, wint_t and NULL from <stddef.h>.  */
+# define __need_size_t
+# define __need_wchar_t
+# define __need_NULL
+#endif
+#if defined _WCHAR_H || defined __need_wint_t || !defined __WINT_TYPE__
+# undef __need_wint_t
+# define __need_wint_t
+# include <stddef.h>
+
+/* We try to get wint_t from <stddef.h>, but not all GCC versions define it
+   there.  So define it ourselves if it remains undefined.  */
+# ifndef _WINT_T
+/* Integral type unchanged by default argument promotions that can
+   hold any value corresponding to members of the extended character
+   set, as well as at least one value that does not correspond to any
+   member of the extended character set.  */
+#  define _WINT_T
+typedef unsigned int wint_t;
+# else
+/* Work around problems with the <stddef.h> file which doesn't put
+   wint_t in the std namespace.  */
+#  if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES \
+      && defined __WINT_TYPE__
+__BEGIN_NAMESPACE_STD
+typedef __WINT_TYPE__ wint_t;
+__END_NAMESPACE_STD
+#  endif
+# endif
+
+/* Tell the caller that we provide correct C++ prototypes.  */
+# if defined __cplusplus && __GNUC_PREREQ (4, 4)
+#  define __CORRECT_ISO_CPP_WCHAR_H_PROTO
+# endif
+#endif
+
+#if (defined _WCHAR_H || defined __need_mbstate_t) && !defined ____mbstate_t_defined
+# define ____mbstate_t_defined	1
+/* Conversion state information.  */
+typedef struct
+{
+  int __count;
+  union
+  {
+# ifdef __WINT_TYPE__
+    __WINT_TYPE__ __wch;
+# else
+    wint_t __wch;
+# endif
+    char __wchb[4];
+  } __value;		/* Value so far.  */
+} __mbstate_t;
+#endif
+#undef __need_mbstate_t
+
+
+/* The rest of the file is only used if used if __need_mbstate_t is not
+   defined.  */
+#ifdef _WCHAR_H
+
+# ifndef __mbstate_t_defined
+__BEGIN_NAMESPACE_C99
+/* Public type.  */
+typedef __mbstate_t mbstate_t;
+__END_NAMESPACE_C99
+#  define __mbstate_t_defined 1
+# endif
+
+#ifdef __USE_GNU
+__USING_NAMESPACE_C99(mbstate_t)
+#endif
+
+#ifndef WCHAR_MIN
+/* These constants might also be defined in <inttypes.h>.  */
+# define WCHAR_MIN __WCHAR_MIN
+# define WCHAR_MAX __WCHAR_MAX
+#endif
+
+#ifndef WEOF
+# define WEOF (0xffffffffu)
+#endif
+
+/* For XPG4 compliance we have to define the stuff from <wctype.h> here
+   as well.  */
+#if defined __USE_XOPEN && !defined __USE_UNIX98
+# include <wctype.h>
+#endif
+
+
+__BEGIN_DECLS
+
+__BEGIN_NAMESPACE_STD
+/* This incomplete type is defined in <time.h> but needed here because
+   of `wcsftime'.  */
+struct tm;
+__END_NAMESPACE_STD
+/* XXX We have to clean this up at some point.  Since tm is in the std
+   namespace but wcsftime is in __c99 the type wouldn't be found
+   without inserting it in the global namespace.  */
+__USING_NAMESPACE_STD(tm)
+
+
+__BEGIN_NAMESPACE_STD
+/* Copy SRC to DEST.  */
+extern wchar_t *wcscpy (wchar_t *__restrict __dest,
+			const wchar_t *__restrict __src)
+     __THROW __nonnull ((1, 2));
+
+/* Copy no more than N wide-characters of SRC to DEST.  */
+extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
+			 const wchar_t *__restrict __src, size_t __n)
+     __THROW __nonnull ((1, 2));
+
+/* Append SRC onto DEST.  */
+extern wchar_t *wcscat (wchar_t *__restrict __dest,
+			const wchar_t *__restrict __src)
+     __THROW __nonnull ((1, 2));
+/* Append no more than N wide-characters of SRC onto DEST.  */
+extern wchar_t *wcsncat (wchar_t *__restrict __dest,
+			 const wchar_t *__restrict __src, size_t __n)
+     __THROW __nonnull ((1, 2));
+
+/* Compare S1 and S2.  */
+extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+/* Compare N wide-characters of S1 and S2.  */
+extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     __THROW __attribute_pure__ __nonnull ((1, 2));
+__END_NAMESPACE_STD
+
+#ifdef __USE_XOPEN2K8
+/* Compare S1 and S2, ignoring case.  */
+extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) __THROW;
+
+/* Compare no more than N chars of S1 and S2, ignoring case.  */
+extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2,
+			size_t __n) __THROW;
+
+/* Similar to the two functions above but take the information from
+   the provided locale and not the global locale.  */
+# include <xlocale.h>
+
+extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
+			 __locale_t __loc) __THROW;
+
+extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2,
+			  size_t __n, __locale_t __loc) __THROW;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Compare S1 and S2, both interpreted as appropriate to the
+   LC_COLLATE category of the current locale.  */
+extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW;
+/* 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 (wchar_t *__restrict __s1,
+		       const wchar_t *__restrict __s2, size_t __n) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_XOPEN2K8
+/* Similar to the two functions above but take the information from
+   the provided locale and not the global locale.  */
+
+/* Compare S1 and S2, both interpreted as appropriate to the
+   LC_COLLATE category of the given locale.  */
+extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2,
+		      __locale_t __loc) __THROW;
+
+/* 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 (wchar_t *__s1, const wchar_t *__s2,
+			 size_t __n, __locale_t __loc) __THROW;
+
+/* Duplicate S, returning an identical malloc'd string.  */
+extern wchar_t *wcsdup (const wchar_t *__s) __THROW __attribute_malloc__;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Find the first occurrence of WC in WCS.  */
+#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
+     __THROW __asm ("wcschr") __attribute_pure__;
+extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc)
+     __THROW __asm ("wcschr") __attribute_pure__;
+#else
+extern wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc)
+     __THROW __attribute_pure__;
+#endif
+/* Find the last occurrence of WC in WCS.  */
+#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc)
+     __THROW __asm ("wcsrchr") __attribute_pure__;
+extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc)
+     __THROW __asm ("wcsrchr") __attribute_pure__;
+#else
+extern wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc)
+     __THROW __attribute_pure__;
+#endif
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* This function is similar to `wcschr'.  But it returns a pointer to
+   the closing NUL wide character in case C is not found in S.  */
+extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc)
+     __THROW __attribute_pure__;
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Return the length of the initial segmet of WCS which
+   consists entirely of wide characters not in REJECT.  */
+extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject)
+     __THROW __attribute_pure__;
+/* Return the length of the initial segmet of WCS which
+   consists entirely of wide characters in  ACCEPT.  */
+extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept)
+     __THROW __attribute_pure__;
+/* Find the first occurrence in WCS of any character in ACCEPT.  */
+#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept)
+     __THROW __asm ("wcspbrk") __attribute_pure__;
+extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs,
+				     const wchar_t *__accept)
+     __THROW __asm ("wcspbrk") __attribute_pure__;
+#else
+extern wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept)
+     __THROW __attribute_pure__;
+#endif
+/* Find the first occurrence of NEEDLE in HAYSTACK.  */
+#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle)
+     __THROW __asm ("wcsstr") __attribute_pure__;
+extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack,
+				    const wchar_t *__needle)
+     __THROW __asm ("wcsstr") __attribute_pure__;
+#else
+extern wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle)
+     __THROW __attribute_pure__;
+#endif
+
+/* Divide WCS into tokens separated by characters in DELIM.  */
+extern wchar_t *wcstok (wchar_t *__restrict __s,
+			const wchar_t *__restrict __delim,
+			wchar_t **__restrict __ptr) __THROW;
+
+/* Return the number of wide characters in S.  */
+extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__;
+__END_NAMESPACE_STD
+
+#ifdef __USE_XOPEN
+/* Another name for `wcsstr' from XPG4.  */
+# ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle)
+     __THROW __asm ("wcswcs") __attribute_pure__;
+extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack,
+				    const wchar_t *__needle)
+     __THROW __asm ("wcswcs") __attribute_pure__;
+# else
+extern wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle)
+     __THROW __attribute_pure__;
+# endif
+#endif
+
+#ifdef __USE_XOPEN2K8
+/* Return the number of wide characters in S, but at most MAXLEN.  */
+extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen)
+     __THROW __attribute_pure__;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Search N wide characters of S for C.  */
+#ifdef __CORRECT_ISO_CPP_WCHAR_H_PROTO
+extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
+     __THROW __asm ("wmemchr") __attribute_pure__;
+extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c,
+				     size_t __n)
+     __THROW __asm ("wmemchr") __attribute_pure__;
+#else
+extern wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n)
+     __THROW __attribute_pure__;
+#endif
+
+/* Compare N wide characters of S1 and S2.  */
+extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     __THROW __attribute_pure__;
+
+/* Copy N wide characters of SRC to DEST.  */
+extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
+			 const wchar_t *__restrict __s2, size_t __n) __THROW;
+
+/* Copy N wide characters of SRC to DEST, guaranteeing
+   correct behavior for overlapping strings.  */
+extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n)
+     __THROW;
+
+/* Set N wide characters of S to C.  */
+extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_GNU
+/* Copy N wide characters of SRC to DEST and return pointer to following
+   wide character.  */
+extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
+			  const wchar_t *__restrict __s2, size_t __n)
+     __THROW;
+#endif
+
+
+__BEGIN_NAMESPACE_STD
+/* Determine whether C constitutes a valid (one-byte) multibyte
+   character.  */
+extern wint_t btowc (int __c) __THROW;
+
+/* Determine whether C corresponds to a member of the extended
+   character set whose multibyte representation is a single byte.  */
+extern int wctob (wint_t __c) __THROW;
+
+/* Determine whether PS points to an object representing the initial
+   state.  */
+extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__;
+
+/* Write wide character representation of multibyte character pointed
+   to by S to PWC.  */
+extern size_t mbrtowc (wchar_t *__restrict __pwc,
+		       const char *__restrict __s, size_t __n,
+		       mbstate_t *__restrict __p) __THROW;
+
+/* Write multibyte representation of wide character WC to S.  */
+extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
+		       mbstate_t *__restrict __ps) __THROW;
+
+/* Return number of bytes in multibyte character pointed to by S.  */
+extern size_t __mbrlen (const char *__restrict __s, size_t __n,
+			mbstate_t *__restrict __ps) __THROW;
+extern size_t mbrlen (const char *__restrict __s, size_t __n,
+		      mbstate_t *__restrict __ps) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_EXTERN_INLINES
+/* Define inline function as optimization.  */
+
+/* We can use the BTOWC and WCTOB optimizations since we know that all
+   locales must use ASCII encoding for the values in the ASCII range
+   and because the wchar_t encoding is always ISO 10646.  */
+extern wint_t __btowc_alias (int __c) __asm ("btowc");
+__extern_inline wint_t
+__NTH (btowc (int __c))
+{ return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
+	  ? (wint_t) __c : __btowc_alias (__c)); }
+
+extern int __wctob_alias (wint_t __c) __asm ("wctob");
+__extern_inline int
+__NTH (wctob (wint_t __wc))
+{ return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
+	  ? (int) __wc : __wctob_alias (__wc)); }
+
+__extern_inline size_t
+__NTH (mbrlen (const char *__restrict __s, size_t __n,
+	       mbstate_t *__restrict __ps))
+{ return (__ps != NULL
+	  ? mbrtowc (NULL, __s, __n, __ps) : __mbrlen (__s, __n, NULL)); }
+#endif
+
+__BEGIN_NAMESPACE_STD
+/* Write wide character representation of multibyte character string
+   SRC to DST.  */
+extern size_t mbsrtowcs (wchar_t *__restrict __dst,
+			 const char **__restrict __src, size_t __len,
+			 mbstate_t *__restrict __ps) __THROW;
+
+/* Write multibyte character representation of wide character string
+   SRC to DST.  */
+extern size_t wcsrtombs (char *__restrict __dst,
+			 const wchar_t **__restrict __src, size_t __len,
+			 mbstate_t *__restrict __ps) __THROW;
+__END_NAMESPACE_STD
+
+
+#ifdef	__USE_XOPEN2K8
+/* Write wide character representation of at most NMC bytes of the
+   multibyte character string SRC to DST.  */
+extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
+			  const char **__restrict __src, size_t __nmc,
+			  size_t __len, mbstate_t *__restrict __ps) __THROW;
+
+/* Write multibyte character representation of at most NWC characters
+   from the wide character string SRC to DST.  */
+extern size_t wcsnrtombs (char *__restrict __dst,
+			  const wchar_t **__restrict __src,
+			  size_t __nwc, size_t __len,
+			  mbstate_t *__restrict __ps) __THROW;
+#endif	/* use POSIX 2008 */
+
+
+/* The following functions are extensions found in X/Open CAE.  */
+#ifdef __USE_XOPEN
+/* Determine number of column positions required for C.  */
+extern int wcwidth (wchar_t __c) __THROW;
+
+/* Determine number of column positions required for first N wide
+   characters (or fewer if S ends before this) in S.  */
+extern int wcswidth (const wchar_t *__s, size_t __n) __THROW;
+#endif	/* Use X/Open.  */
+
+
+__BEGIN_NAMESPACE_STD
+/* Convert initial portion of the wide string NPTR to `double'
+   representation.  */
+extern double wcstod (const wchar_t *__restrict __nptr,
+		      wchar_t **__restrict __endptr) __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Likewise for `float' and `long double' sizes of floating-point numbers.  */
+extern float wcstof (const wchar_t *__restrict __nptr,
+		     wchar_t **__restrict __endptr) __THROW;
+extern long double wcstold (const wchar_t *__restrict __nptr,
+			    wchar_t **__restrict __endptr) __THROW;
+__END_NAMESPACE_C99
+#endif /* C99 */
+
+
+__BEGIN_NAMESPACE_STD
+/* Convert initial portion of wide string NPTR to `long int'
+   representation.  */
+extern long int wcstol (const wchar_t *__restrict __nptr,
+			wchar_t **__restrict __endptr, int __base) __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long int'
+   representation.  */
+extern unsigned long int wcstoul (const wchar_t *__restrict __nptr,
+				  wchar_t **__restrict __endptr, int __base)
+     __THROW;
+__END_NAMESPACE_STD
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Convert initial portion of wide string NPTR to `long long int'
+   representation.  */
+__extension__
+extern long long int wcstoll (const wchar_t *__restrict __nptr,
+			      wchar_t **__restrict __endptr, int __base)
+     __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long long int'
+   representation.  */
+__extension__
+extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr,
+					wchar_t **__restrict __endptr,
+					int __base) __THROW;
+__END_NAMESPACE_C99
+#endif /* ISO C99.  */
+
+#ifdef __USE_GNU
+/* Convert initial portion of wide string NPTR to `long long int'
+   representation.  */
+__extension__
+extern long long int wcstoq (const wchar_t *__restrict __nptr,
+			     wchar_t **__restrict __endptr, int __base)
+     __THROW;
+
+/* Convert initial portion of wide string NPTR to `unsigned long long int'
+   representation.  */
+__extension__
+extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr,
+				       wchar_t **__restrict __endptr,
+				       int __base) __THROW;
+#endif /* Use GNU.  */
+
+#ifdef __USE_GNU
+/* The concept of one static locale per category is not very well
+   thought out.  Many applications will need to process its data using
+   information from several different locales.  Another application is
+   the implementation of the internationalization handling in the
+   upcoming ISO C++ standard library.  To support this another set of
+   the functions using locale data exist which have an additional
+   argument.
+
+   Attention: all these functions are *not* standardized in any form.
+   This is a proof-of-concept implementation.  */
+
+/* Structure for reentrant locale using functions.  This is an
+   (almost) opaque type for the user level programs.  */
+# include <xlocale.h>
+
+/* Special versions of the functions above which take the locale to
+   use as an additional parameter.  */
+extern long int wcstol_l (const wchar_t *__restrict __nptr,
+			  wchar_t **__restrict __endptr, int __base,
+			  __locale_t __loc) __THROW;
+
+extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr,
+				    wchar_t **__restrict __endptr,
+				    int __base, __locale_t __loc) __THROW;
+
+__extension__
+extern long long int wcstoll_l (const wchar_t *__restrict __nptr,
+				wchar_t **__restrict __endptr,
+				int __base, __locale_t __loc) __THROW;
+
+__extension__
+extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr,
+					  wchar_t **__restrict __endptr,
+					  int __base, __locale_t __loc)
+     __THROW;
+
+extern double wcstod_l (const wchar_t *__restrict __nptr,
+			wchar_t **__restrict __endptr, __locale_t __loc)
+     __THROW;
+
+extern float wcstof_l (const wchar_t *__restrict __nptr,
+		       wchar_t **__restrict __endptr, __locale_t __loc)
+     __THROW;
+
+extern long double wcstold_l (const wchar_t *__restrict __nptr,
+			      wchar_t **__restrict __endptr,
+			      __locale_t __loc) __THROW;
+#endif	/* use GNU */
+
+
+#ifdef __USE_XOPEN2K8
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in
+   DEST.  */
+extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
+			const wchar_t *__restrict __src) __THROW;
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+   the last character written into DEST.  */
+extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
+			 const wchar_t *__restrict __src, size_t __n)
+     __THROW;
+
+
+/* Wide character I/O functions.  */
+
+/* Like OPEN_MEMSTREAM, but the stream is wide oriented and produces
+   a wide character string.  */
+extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW;
+#endif
+
+#if defined __USE_ISOC95 || defined __USE_UNIX98
+__BEGIN_NAMESPACE_STD
+
+/* Select orientation for stream.  */
+extern int fwide (__FILE *__fp, int __mode) __THROW;
+
+
+/* Write formatted output to STREAM.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int fwprintf (__FILE *__restrict __stream,
+		     const wchar_t *__restrict __format, ...)
+     /* __attribute__ ((__format__ (__wprintf__, 2, 3))) */;
+/* Write formatted output to stdout.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int wprintf (const wchar_t *__restrict __format, ...)
+     /* __attribute__ ((__format__ (__wprintf__, 1, 2))) */;
+/* Write formatted output of at most N characters to S.  */
+extern int swprintf (wchar_t *__restrict __s, size_t __n,
+		     const wchar_t *__restrict __format, ...)
+     __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 4))) */;
+
+/* Write formatted output to S from argument list ARG.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int vfwprintf (__FILE *__restrict __s,
+		      const wchar_t *__restrict __format,
+		      __gnuc_va_list __arg)
+     /* __attribute__ ((__format__ (__wprintf__, 2, 0))) */;
+/* Write formatted output to stdout from argument list ARG.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int vwprintf (const wchar_t *__restrict __format,
+		     __gnuc_va_list __arg)
+     /* __attribute__ ((__format__ (__wprintf__, 1, 0))) */;
+/* Write formatted output of at most N character to S from argument
+   list ARG.  */
+extern int vswprintf (wchar_t *__restrict __s, size_t __n,
+		      const wchar_t *__restrict __format,
+		      __gnuc_va_list __arg)
+     __THROW /* __attribute__ ((__format__ (__wprintf__, 3, 0))) */;
+
+
+/* Read formatted input from STREAM.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int fwscanf (__FILE *__restrict __stream,
+		    const wchar_t *__restrict __format, ...)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+/* Read formatted input from stdin.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int wscanf (const wchar_t *__restrict __format, ...)
+     /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
+/* Read formatted input from S.  */
+extern int swscanf (const wchar_t *__restrict __s,
+		    const wchar_t *__restrict __format, ...)
+     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+
+# if defined __USE_ISOC99 && !defined __USE_GNU \
+     && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+     && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+#  ifdef __REDIRECT
+/* For strict ISO C99 or POSIX compliance disallow %as, %aS and %a[
+   GNU extension which conflicts with valid %a followed by letter
+   s, S or [.  */
+extern int __REDIRECT (fwscanf, (__FILE *__restrict __stream,
+				 const wchar_t *__restrict __format, ...),
+		       __isoc99_fwscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+extern int __REDIRECT (wscanf, (const wchar_t *__restrict __format, ...),
+		       __isoc99_wscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 1, 2))) */;
+extern int __REDIRECT_NTH (swscanf, (const wchar_t *__restrict __s,
+				     const wchar_t *__restrict __format,
+				     ...), __isoc99_swscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 3))) */;
+#  else
+extern int __isoc99_fwscanf (__FILE *__restrict __stream,
+			     const wchar_t *__restrict __format, ...);
+extern int __isoc99_wscanf (const wchar_t *__restrict __format, ...);
+extern int __isoc99_swscanf (const wchar_t *__restrict __s,
+			     const wchar_t *__restrict __format, ...)
+     __THROW;
+#   define fwscanf __isoc99_fwscanf
+#   define wscanf __isoc99_wscanf
+#   define swscanf __isoc99_swscanf
+#  endif
+# endif
+
+__END_NAMESPACE_STD
+#endif /* Use ISO C95, C99 and Unix98. */
+
+#ifdef __USE_ISOC99
+__BEGIN_NAMESPACE_C99
+/* Read formatted input from S into argument list ARG.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int vfwscanf (__FILE *__restrict __s,
+		     const wchar_t *__restrict __format,
+		     __gnuc_va_list __arg)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+/* Read formatted input from stdin into argument list ARG.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int vwscanf (const wchar_t *__restrict __format,
+		    __gnuc_va_list __arg)
+     /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
+/* Read formatted input from S into argument list ARG.  */
+extern int vswscanf (const wchar_t *__restrict __s,
+		     const wchar_t *__restrict __format,
+		     __gnuc_va_list __arg)
+     __THROW /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+
+# if !defined __USE_GNU \
+     && (!defined __LDBL_COMPAT || !defined __REDIRECT) \
+     && (defined __STRICT_ANSI__ || defined __USE_XOPEN2K)
+#  ifdef __REDIRECT
+extern int __REDIRECT (vfwscanf, (__FILE *__restrict __s,
+				  const wchar_t *__restrict __format,
+				  __gnuc_va_list __arg), __isoc99_vfwscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+extern int __REDIRECT (vwscanf, (const wchar_t *__restrict __format,
+				 __gnuc_va_list __arg), __isoc99_vwscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 1, 0))) */;
+extern int __REDIRECT_NTH (vswscanf, (const wchar_t *__restrict __s,
+				      const wchar_t *__restrict __format,
+				      __gnuc_va_list __arg), __isoc99_vswscanf)
+     /* __attribute__ ((__format__ (__wscanf__, 2, 0))) */;
+#  else
+extern int __isoc99_vfwscanf (__FILE *__restrict __s,
+			      const wchar_t *__restrict __format,
+			      __gnuc_va_list __arg);
+extern int __isoc99_vwscanf (const wchar_t *__restrict __format,
+			     __gnuc_va_list __arg);
+extern int __isoc99_vswscanf (const wchar_t *__restrict __s,
+			      const wchar_t *__restrict __format,
+			      __gnuc_va_list __arg) __THROW;
+#   define vfwscanf __isoc99_vfwscanf
+#   define vwscanf __isoc99_vwscanf
+#   define vswscanf __isoc99_vswscanf
+#  endif
+# endif
+
+__END_NAMESPACE_C99
+#endif /* Use ISO C99. */
+
+
+__BEGIN_NAMESPACE_STD
+/* Read a character from STREAM.
+
+   These functions are possible cancellation points and therefore not
+   marked with __THROW.  */
+extern wint_t fgetwc (__FILE *__stream);
+extern wint_t getwc (__FILE *__stream);
+
+/* Read a character from stdin.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern wint_t getwchar (void);
+
+
+/* Write a character to STREAM.
+
+   These functions are possible cancellation points and therefore not
+   marked with __THROW.  */
+extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
+extern wint_t putwc (wchar_t __wc, __FILE *__stream);
+
+/* Write a character to stdout.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern wint_t putwchar (wchar_t __wc);
+
+
+/* Get a newline-terminated wide character string of finite length
+   from STREAM.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
+			__FILE *__restrict __stream);
+
+/* Write a string to STREAM.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern int fputws (const wchar_t *__restrict __ws,
+		   __FILE *__restrict __stream);
+
+
+/* Push a character back onto the input buffer of STREAM.
+
+   This function is a possible cancellation point and therefore not
+   marked with __THROW.  */
+extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
+__END_NAMESPACE_STD
+
+
+#ifdef __USE_GNU
+/* These are defined to be equivalent to the `char' functions defined
+   in POSIX.1:1996.
+
+   These functions are not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation they are cancellation points and
+   therefore not marked with __THROW.  */
+extern wint_t getwc_unlocked (__FILE *__stream);
+extern wint_t getwchar_unlocked (void);
+
+/* This is the wide character version of a GNU extension.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern wint_t fgetwc_unlocked (__FILE *__stream);
+
+/* Faster version when locking is not necessary.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
+
+/* These are defined to be equivalent to the `char' functions defined
+   in POSIX.1:1996.
+
+   These functions are not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation they are cancellation points and
+   therefore not marked with __THROW.  */
+extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
+extern wint_t putwchar_unlocked (wchar_t __wc);
+
+
+/* This function does the same as `fgetws' but does not lock the stream.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
+				 __FILE *__restrict __stream);
+
+/* This function does the same as `fputws' but does not lock the stream.
+
+   This function is not part of POSIX and therefore no official
+   cancellation point.  But due to similarity with an POSIX interface
+   or due to the implementation it is a cancellation point and
+   therefore not marked with __THROW.  */
+extern int fputws_unlocked (const wchar_t *__restrict __ws,
+			    __FILE *__restrict __stream);
+#endif
+
+
+__BEGIN_NAMESPACE_C99
+/* Format TP into S according to FORMAT.
+   Write no more than MAXSIZE wide characters and return the number
+   of wide characters written, or 0 if it would exceed MAXSIZE.  */
+extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
+			const wchar_t *__restrict __format,
+			const struct tm *__restrict __tp) __THROW;
+__END_NAMESPACE_C99
+
+# ifdef __USE_GNU
+# include <xlocale.h>
+
+/* Similar to `wcsftime' but takes the information from
+   the provided locale and not the global locale.  */
+extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
+			  const wchar_t *__restrict __format,
+			  const struct tm *__restrict __tp,
+			  __locale_t __loc) __THROW;
+# endif
+
+/* The X/Open standard demands that most of the functions defined in
+   the <wctype.h> header must also appear here.  This is probably
+   because some X/Open members wrote their implementation before the
+   ISO C standard was published and introduced the better solution.
+   We have to provide these definitions for compliance reasons but we
+   do this nonsense only if really necessary.  */
+#if defined __USE_UNIX98 && !defined __USE_GNU
+# define __need_iswxxx
+# include <wctype.h>
+#endif
+
+/* Define some macros helping to catch buffer overflows.  */
+#if __USE_FORTIFY_LEVEL > 0 && defined __fortify_function
+# include <bits/wchar2.h>
+#endif
+
+#ifdef __LDBL_COMPAT
+# include <bits/wchar-ldbl.h>
+#endif
+
+__END_DECLS
+
+#endif	/* _WCHAR_H defined */
+
+#endif /* wchar.h  */
+
+/* Undefine all __need_* constants in case we are included to get those
+   constants but the whole file was already read.  */
+#undef __need_mbstate_t
+#undef __need_wint_t
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcpcpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcpcpy.c
new file mode 100644
index 0000000..839d049
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcpcpy.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#define __need_ptrdiff_t
+#include <stddef.h>
+
+#ifdef WCPCPY
+# define __wcpcpy WCPCPY
+#endif
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in
+   DEST.  */
+wchar_t *
+__wcpcpy (wchar_t *dest, const wchar_t *src)
+{
+  wchar_t *wcp = (wchar_t *) dest - 1;
+  wint_t c;
+  const ptrdiff_t off = src - dest + 1;
+
+  do
+    {
+      c = wcp[off];
+      *++wcp = c;
+    }
+  while (c != L'\0');
+
+  return wcp;
+}
+
+#ifndef WCPCPY
+weak_alias (__wcpcpy, wcpcpy)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcpncpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcpncpy.c
new file mode 100644
index 0000000..958ed46
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcpncpy.c
@@ -0,0 +1,87 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCPNCPY
+# define __wcpncpy WCPNCPY
+#endif
+
+/* Copy no more than N wide-characters of SRC to DEST, returning the
+   address of the last character written into DEST.  */
+wchar_t *
+__wcpncpy (wchar_t *dest, const wchar_t *src, size_t n)
+{
+  wint_t c;
+  wchar_t *const s = dest;
+
+  if (n >= 4)
+    {
+      size_t n4 = n >> 2;
+
+      for (;;)
+	{
+	  c = *src++;
+	  *dest++ = c;
+	  if (c == L'\0')
+	    break;
+	  c = *src++;
+	  *dest++ = c;
+	  if (c == L'\0')
+	    break;
+	  c = *src++;
+	  *dest++ = c;
+	  if (c == L'\0')
+	    break;
+	  c = *src++;
+	  *dest++ = c;
+	  if (c == L'\0')
+	    break;
+	  if (--n4 == 0)
+	    goto last_chars;
+	}
+      n -= dest - s;
+      goto zero_fill;
+    }
+
+ last_chars:
+  n &= 3;
+  if (n == 0)
+    return dest;
+
+  for (;;)
+    {
+      c = *src++;
+      --n;
+      *dest++ = c;
+      if (c == L'\0')
+	break;
+      if (n == 0)
+	return dest;
+    }
+
+ zero_fill:
+  while (n-- > 0)
+    dest[n] = L'\0';
+
+  return dest - 1;
+}
+
+#ifndef WCPNCPY
+weak_alias (__wcpncpy, wcpncpy)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcrtomb.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcrtomb.c
new file mode 100644
index 0000000..8b87dde
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcrtomb.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <gconv.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+#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_LEN_MAX];
+  struct __gconv_step_data data;
+  int status;
+  size_t result;
+  size_t dummy;
+  const struct gconv_fcts *fcts;
+
+  /* Set information for this step.  */
+  data.__invocation_counter = 0;
+  data.__internal_use = 1;
+  data.__flags = __GCONV_IS_LAST;
+  data.__statep = ps ?: &state;
+
+  /* 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 = (unsigned char *) s;
+  data.__outbufend = (unsigned char *) s + MB_CUR_MAX;
+
+  /* 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 (fct, (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 (fct,
+			    (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)
+libc_hidden_weak (wcrtomb)
+
+/* There should be no difference between the UTF-32 handling required
+   by c32rtomb and the wchar_t handling which has long since been
+   implemented in wcrtomb.  */
+weak_alias (__wcrtomb, c32rtomb)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsatcliff.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsatcliff.c
new file mode 100644
index 0000000..95afff6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsatcliff.c
@@ -0,0 +1,23 @@
+#include <wchar.h>
+
+#define WCSTEST 1
+#define L(c) L##c
+#define CHAR wchar_t
+#define MEMSET wmemset
+#define STRLEN wcslen
+#define STRNLEN wcsnlen
+#define STRCHR wcschr
+#define STRRCHR wcsrchr
+#define STRCPY wcscpy
+#define STRNCPY wcsncpy
+#define MEMCMP wmemcmp
+#define STPCPY wcpcpy
+#define STPNCPY wcpncpy
+#define MEMCPY wmemcpy
+#define MEMPCPY wmempcpy
+#define MEMCHR wmemchr
+#define STRCMP wcscmp
+#define STRNCMP wcsncmp
+
+
+#include "../string/stratcliff.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscasecmp.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscasecmp.c
new file mode 100644
index 0000000..dee604a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscasecmp.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 1991-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <wctype.h>
+#include <wchar.h>
+
+#ifndef weak_alias
+# define __wcscasecmp wcscasecmp
+# define TOLOWER(Ch) towlower (Ch)
+#else
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+#  define __wcscasecmp __wcscasecmp_l
+#  define TOLOWER(Ch) __towlower_l ((Ch), loc)
+# else
+#  define TOLOWER(Ch) towlower (Ch)
+# endif
+#endif
+
+#ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define LOCALE_PARAM , __locale_t loc
+#else
+# define LOCALE_PARAM
+#endif
+
+/* Compare S1 and S2, ignoring case, returning less than, equal to or
+   greater than zero if S1 is lexicographically less than,
+   equal to or greater than S2.  */
+int
+__wcscasecmp (const wchar_t *s1, const wchar_t *s2 LOCALE_PARAM)
+{
+  wint_t c1, c2;
+
+  if (s1 == s2)
+    return 0;
+
+  do
+    {
+      c1 = TOLOWER (*s1++);
+      c2 = TOLOWER (*s2++);
+      if (c1 == L'\0')
+	break;
+    }
+  while (c1 == c2);
+
+  return c1 - c2;
+}
+#ifndef __wcscasecmp
+weak_alias (__wcscasecmp, wcscasecmp)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscasecmp_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscasecmp_l.c
new file mode 100644
index 0000000..3cb3c97
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscasecmp_l.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define USE_IN_EXTENDED_LOCALE_MODEL	1
+#include <wcscasecmp.c>
+
+libc_hidden_def (__wcscasecmp_l)
+weak_alias (__wcscasecmp_l, wcscasecmp_l)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscat.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscat.c
new file mode 100644
index 0000000..04cb7a2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscat.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCSCAT
+# define __wcscat WCSCAT
+#endif
+
+/* Append SRC on the end of DEST.  */
+wchar_t *
+__wcscat (wchar_t *dest, const wchar_t *src)
+{
+  wchar_t *s1 = dest;
+  const wchar_t *s2 = src;
+  wchar_t c;
+
+  /* Find the end of the string.  */
+  do
+    c = *s1++;
+  while (c != L'\0');
+
+  /* Make S1 point before the next character, so we can increment
+     it while memory is read (wins on pipelined cpus).	*/
+  s1 -= 2;
+
+  do
+    {
+      c = *s2++;
+      *++s1 = c;
+    }
+  while (c != L'\0');
+
+  return dest;
+}
+#ifndef WCSCAT
+weak_alias (__wcscat, wcscat)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcschr.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcschr.c
new file mode 100644
index 0000000..e005b80
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcschr.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1995-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifndef WCSCHR
+# define WCSCHR __wcschr
+#endif
+
+/* Find the first occurrence of WC in WCS.  */
+wchar_t *
+WCSCHR (const wchar_t *wcs, const wchar_t wc)
+{
+  do
+    if (*wcs == wc)
+      return (wchar_t *) wcs;
+  while (*wcs++ != L'\0');
+
+  return NULL;
+}
+libc_hidden_def (__wcschr)
+weak_alias (__wcschr, wcschr)
+libc_hidden_weak (wcschr)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcschrnul.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcschrnul.c
new file mode 100644
index 0000000..791e47d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcschrnul.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1995-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCSCHRNUL
+# define __wcschrnul WCSCHRNUL
+#endif
+
+/* Find the first occurrence of WC in WCS.  */
+wchar_t *
+__wcschrnul (const wchar_t *wcs, const wchar_t wc)
+{
+  while (*wcs != L'\0')
+    if (*wcs == wc)
+      break;
+    else
+      ++wcs;
+
+  return (wchar_t *) wcs;
+}
+#ifndef WCSCHRNUL
+weak_alias (__wcschrnul, wcschrnul)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscmp.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscmp.c
new file mode 100644
index 0000000..a1b4288
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscmp.c
@@ -0,0 +1,45 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifndef WCSCMP
+# define WCSCMP __wcscmp
+#endif
+
+/* Compare S1 and S2, returning less than, equal to or
+   greater than zero if S1 is lexicographically less than,
+   equal to or greater than S2.	 */
+int
+WCSCMP (const wchar_t *s1, const wchar_t *s2)
+{
+  wchar_t c1, c2;
+
+  do
+    {
+      c1 = *s1++;
+      c2 = *s2++;
+      if (c2 == L'\0')
+	return c1 - c2;
+    }
+  while (c1 == c2);
+
+  return c1 < c2 ? -1 : 1;
+}
+libc_hidden_def (WCSCMP)
+weak_alias (WCSCMP, wcscmp)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscoll.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscoll.c
new file mode 100644
index 0000000..2c0e3fe
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscoll.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include "../locale/coll-lookup.h"
+
+#define STRING_TYPE wchar_t
+#define USTRING_TYPE wint_t
+#define STRCOLL __wcscoll
+#define STRCOLL_L __wcscoll_l
+#define USE_HIDDEN_DEF
+
+#include "../string/strcoll.c"
+
+#ifndef USE_IN_EXTENDED_LOCALE_MODEL
+weak_alias (__wcscoll, wcscoll)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscoll_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscoll_l.c
new file mode 100644
index 0000000..9fc9524
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscoll_l.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+
+#include <wchar.h>
+#include "../locale/coll-lookup.h"
+
+#define STRING_TYPE wchar_t
+#define USTRING_TYPE wint_t
+#define STRCOLL __wcscoll_l
+#define STRCMP __wcscmp
+#define WEIGHT_H "../locale/weightwc.h"
+#define SUFFIX	WC
+#define L(arg) L##arg
+#define WIDE_CHAR_VERSION 1
+
+#include "../string/strcoll_l.c"
+
+weak_alias (__wcscoll_l, wcscoll_l)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscpy.c
new file mode 100644
index 0000000..d07fd3e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscpy.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <wchar.h>
+
+
+#ifndef WCSCPY
+# define WCSCPY wcscpy
+#endif
+
+/* Copy SRC to DEST.  */
+wchar_t *
+WCSCPY (wchar_t *dest, const wchar_t *src)
+{
+  wint_t c;
+  wchar_t *wcp;
+
+  if (__alignof__ (wchar_t) >= sizeof (wchar_t))
+    {
+      const ptrdiff_t off = dest - src - 1;
+
+      wcp = (wchar_t *) src;
+
+      do
+	{
+	  c = *wcp++;
+	  wcp[off] = c;
+	}
+      while (c != L'\0');
+    }
+  else
+    {
+      wcp = dest;
+
+      do
+	{
+	  c = *src++;
+	  *wcp++ = c;
+	}
+      while (c != L'\0');
+    }
+
+  return dest;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcscspn.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscspn.c
new file mode 100644
index 0000000..8fce43c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcscspn.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCSCSPN
+# define wcscspn WCSCSPN
+#endif
+
+/* Return the length of the maximum initial segment
+   of WCS which contains only wide-characters not in REJECT.  */
+size_t
+wcscspn (const wchar_t *wcs, const wchar_t *reject)
+{
+  size_t count = 0;
+
+  while (*wcs != L'\0')
+    if (wcschr (reject, *wcs++) == NULL)
+      ++count;
+    else
+      return count;
+
+  return count;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsdup.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsdup.c
new file mode 100644
index 0000000..658207a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsdup.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include <string.h>
+#include <stdlib.h>
+
+
+/* Duplicate S, returning an identical malloc'd string.	 */
+wchar_t *
+wcsdup (const wchar_t *s)
+{
+  size_t len = (__wcslen (s) + 1) * sizeof (wchar_t);
+  void *new = malloc (len);
+
+  if (new == NULL)
+    return NULL;
+
+  return (wchar_t *) memcpy (new, (void *) s, len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcslen.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcslen.c
new file mode 100644
index 0000000..f34dffb
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcslen.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+/* Return length of string S.  */
+#ifdef WCSLEN
+# define __wcslen WCSLEN
+#endif
+
+size_t
+__wcslen (const wchar_t *s)
+{
+  size_t len = 0;
+
+  while (s[len] != L'\0')
+    {
+      if (s[++len] == L'\0')
+	return len;
+      if (s[++len] == L'\0')
+	return len;
+      if (s[++len] == L'\0')
+	return len;
+      ++len;
+    }
+
+  return len;
+}
+#ifndef WCSLEN
+weak_alias (__wcslen, wcslen)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbs-tst1.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbs-tst1.c
new file mode 100644
index 0000000..0d0e18f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbs-tst1.c
@@ -0,0 +1,59 @@
+/* Based on a test program by Won Kyu Park <wkpark@chem.skku.ac.kr>.  */
+
+#include <wchar.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wctype.h>
+#include <locale.h>
+
+int
+main (void)
+{
+  int test = 0;
+  int idx = 0;
+  char buf[100], *pchar;
+  wchar_t tmp[10];
+  wchar_t tmp1[] = { L'W', L'o', L'r', L'l', L'd', L'\0' };
+  char str[] = "Hello";
+  int result = 0;
+
+  pchar = setlocale (LC_ALL, "de_DE.UTF-8");
+  printf ("locale : %s\n",pchar);
+  printf ("MB_CUR_MAX %Zd\n", MB_CUR_MAX);
+
+  puts ("---- test 1 ------");
+  test = mbstowcs (tmp, str, (strlen (str) + 1) * sizeof (char));
+  printf ("size of string by mbstowcs %d\n", test);
+  if (test != strlen (str))
+    result = 1;
+  idx += wctomb (&buf[0], tmp[0]);
+  idx += wctomb (&buf[idx], tmp[1]);
+  buf[idx] = 0;
+  printf ("orig string %s\n", str);
+  printf ("string by wctomb %s\n", buf);
+  printf ("string by %%C %C", (wint_t) tmp[0]);
+  if (tmp[0] != L'H')
+    result = 1;
+  printf ("%C\n", (wint_t) tmp[1]);
+  if (tmp[1] != L'e')
+    result = 1;
+  printf ("string by %%S %S\n", tmp);
+  if (wcscmp (tmp, L"Hello") != 0)
+    result = 1;
+  puts ("---- test 2 ------");
+  printf ("wchar string %S\n", tmp1);
+  printf ("wchar %C\n", (wint_t) tmp1[0]);
+  test = wcstombs (buf, tmp1, (wcslen (tmp1) + 1) * sizeof (wchar_t));
+  printf ("size of string by wcstombs %d\n", test);
+  if (test != wcslen (tmp1))
+    result = 1;
+  test = wcslen (tmp1);
+  printf ("size of string by wcslen %d\n", test);
+  printf ("char %s\n", buf);
+  if (strcmp (buf, "World") != 0)
+    result = 1;
+  puts ("------------------");
+
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbsload.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbsload.c
new file mode 100644
index 0000000..d8b863e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbsload.c
@@ -0,0 +1,270 @@
+/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <ctype.h>
+#include <langinfo.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <locale/localeinfo.h>
+#include <wcsmbsload.h>
+#include <libc-lock.h>
+
+
+/* These are the descriptions for the default conversion functions.  */
+static const struct __gconv_step to_wc =
+{
+  .__shlib_handle = NULL,
+  .__modname = NULL,
+  .__counter = INT_MAX,
+  .__from_name = (char *) "ANSI_X3.4-1968//TRANSLIT",
+  .__to_name = (char *) "INTERNAL",
+  .__fct = __gconv_transform_ascii_internal,
+  .__btowc_fct = __gconv_btwoc_ascii,
+  .__init_fct = NULL,
+  .__end_fct = NULL,
+  .__min_needed_from = 1,
+  .__max_needed_from = 1,
+  .__min_needed_to = 4,
+  .__max_needed_to = 4,
+  .__stateful = 0,
+  .__data = NULL
+};
+
+static const struct __gconv_step to_mb =
+{
+  .__shlib_handle = NULL,
+  .__modname = NULL,
+  .__counter = INT_MAX,
+  .__from_name = (char *) "INTERNAL",
+  .__to_name = (char *) "ANSI_X3.4-1968//TRANSLIT",
+  .__fct = __gconv_transform_internal_ascii,
+  .__btowc_fct = NULL,
+  .__init_fct = NULL,
+  .__end_fct = NULL,
+  .__min_needed_from = 4,
+  .__max_needed_from = 4,
+  .__min_needed_to = 1,
+  .__max_needed_to = 1,
+  .__stateful = 0,
+  .__data = NULL
+};
+
+
+/* For the default locale we only have to handle ANSI_X3.4-1968.  */
+const struct gconv_fcts __wcsmbs_gconv_fcts_c =
+{
+  .towc = (struct __gconv_step *) &to_wc,
+  .towc_nsteps = 1,
+  .tomb = (struct __gconv_step *) &to_mb,
+  .tomb_nsteps = 1,
+};
+
+
+attribute_hidden
+struct __gconv_step *
+__wcsmbs_getfct (const char *to, const char *from, size_t *nstepsp)
+{
+  size_t nsteps;
+  struct __gconv_step *result;
+#if 0
+  size_t nstateful;
+  size_t cnt;
+#endif
+
+  if (__gconv_find_transform (to, from, &result, &nsteps, 0) != __GCONV_OK)
+    /* Loading the conversion step is not possible.  */
+    return NULL;
+
+  /* Maybe it is someday necessary to allow more than one step.
+     Currently this is not the case since the conversions handled here
+     are from and to INTERNAL and there always is a converted for
+     that.  It the directly following code is enabled the libio
+     functions will have to allocate appropriate __gconv_step_data
+     elements instead of only one.  */
+#if 0
+  /* Count the number of stateful conversions.  Since we will only
+     have one 'mbstate_t' object available we can only deal with one
+     stateful conversion.  */
+  nstateful = 0;
+  for (cnt = 0; cnt < nsteps; ++cnt)
+    if (result[cnt].__stateful)
+      ++nstateful;
+  if (nstateful > 1)
+#else
+  if (nsteps > 1)
+#endif
+    {
+      /* We cannot handle this case.  */
+      __gconv_close_transform (result, nsteps);
+      result = NULL;
+    }
+  else
+    *nstepsp = nsteps;
+
+  return result;
+}
+
+
+/* Extract from the given locale name the character set portion.  Since
+   only the XPG form of the name includes this information we don't have
+   to take care for the CEN form.  */
+#define extract_charset_name(str) \
+  ({									      \
+    const char *cp = str;						      \
+    char *result = NULL;						      \
+									      \
+    cp += strcspn (cp, "@.+,");						      \
+    if (*cp == '.')							      \
+      {									      \
+	const char *endp = ++cp;					      \
+	while (*endp != '\0' && *endp != '@')				      \
+	  ++endp;							      \
+	if (endp != cp)							      \
+	  result = strndupa (cp, endp - cp);				      \
+      }									      \
+    result;								      \
+  })
+
+
+/* Some of the functions here must not be used while setlocale is called.  */
+__libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
+
+/* Load conversion functions for the currently selected locale.  */
+void
+internal_function
+__wcsmbs_load_conv (struct __locale_data *new_category)
+{
+  /* Acquire the lock.  */
+  __libc_rwlock_wrlock (__libc_setlocale_lock);
+
+  /* We should repeat the test since while we waited some other thread
+     might have run this function.  */
+  if (__glibc_likely (new_category->private.ctype == NULL))
+    {
+      /* We must find the real functions.  */
+      const char *charset_name;
+      const char *complete_name;
+      struct gconv_fcts *new_fcts;
+      int use_translit;
+
+      /* Allocate the gconv_fcts structure.  */
+      new_fcts = calloc (1, sizeof *new_fcts);
+      if (new_fcts == NULL)
+	goto failed;
+
+      /* Get name of charset of the locale.  */
+      charset_name = new_category->values[_NL_ITEM_INDEX(CODESET)].string;
+
+      /* Does the user want transliteration?  */
+      use_translit = new_category->use_translit;
+
+      /* Normalize the name and add the slashes necessary for a
+	 complete lookup.  */
+      complete_name = norm_add_slashes (charset_name,
+					use_translit ? "TRANSLIT" : "");
+
+      /* It is not necessary to use transliteration in this direction
+	 since the internal character set is supposed to be able to
+	 represent all others.  */
+      new_fcts->towc = __wcsmbs_getfct ("INTERNAL", complete_name,
+					&new_fcts->towc_nsteps);
+      if (new_fcts->towc != NULL)
+	new_fcts->tomb = __wcsmbs_getfct (complete_name, "INTERNAL",
+					  &new_fcts->tomb_nsteps);
+
+      /* If any of the conversion functions is not available we don't
+	 use any since this would mean we cannot convert back and
+	 forth.  NB: NEW_FCTS was allocated with calloc.  */
+      if (new_fcts->tomb == NULL)
+	{
+	  if (new_fcts->towc != NULL)
+	    __gconv_close_transform (new_fcts->towc, new_fcts->towc_nsteps);
+
+	  free (new_fcts);
+
+	failed:
+	  new_category->private.ctype = &__wcsmbs_gconv_fcts_c;
+	}
+      else
+	{
+	  new_category->private.ctype = new_fcts;
+	  new_category->private.cleanup = &_nl_cleanup_ctype;
+	}
+    }
+
+  __libc_rwlock_unlock (__libc_setlocale_lock);
+}
+
+
+/* Clone the current conversion function set.  */
+void
+internal_function
+__wcsmbs_clone_conv (struct gconv_fcts *copy)
+{
+  const struct gconv_fcts *orig;
+
+  orig = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+
+  /* Copy the data.  */
+  *copy = *orig;
+
+  /* Now increment the usage counters.
+     Note: This assumes copy->*_nsteps == 1.  */
+  if (copy->towc->__shlib_handle != NULL)
+    ++copy->towc->__counter;
+  if (copy->tomb->__shlib_handle != NULL)
+    ++copy->tomb->__counter;
+}
+
+
+/* Get converters for named charset.  */
+int
+internal_function
+__wcsmbs_named_conv (struct gconv_fcts *copy, const char *name)
+{
+  copy->towc = __wcsmbs_getfct ("INTERNAL", name, &copy->towc_nsteps);
+  if (copy->towc == NULL)
+    return 1;
+
+  copy->tomb = __wcsmbs_getfct (name, "INTERNAL", &copy->tomb_nsteps);
+  if (copy->tomb == NULL)
+    {
+      __gconv_close_transform (copy->towc, copy->towc_nsteps);
+      return 1;
+    }
+
+  return 0;
+}
+
+void internal_function
+_nl_cleanup_ctype (struct __locale_data *locale)
+{
+  const struct gconv_fcts *const data = locale->private.ctype;
+  if (data != NULL)
+    {
+      locale->private.ctype = NULL;
+      locale->private.cleanup = NULL;
+
+      /* Free the old conversions.  */
+      __gconv_close_transform (data->tomb, data->tomb_nsteps);
+      __gconv_close_transform (data->towc, data->towc_nsteps);
+      free ((char *) data);
+    }
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbsload.h b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbsload.h
new file mode 100644
index 0000000..7fdaf4b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsmbsload.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _WCSMBSLOAD_H
+#define _WCSMBSLOAD_H	1
+
+#include <locale.h>
+#include <wchar.h>
+#include <locale/localeinfo.h>
+
+
+/* Contains pointers to the used functions in the `gconv' modules.  */
+struct gconv_fcts
+  {
+    struct __gconv_step *towc;
+    size_t towc_nsteps;
+    struct __gconv_step *tomb;
+    size_t tomb_nsteps;
+  };
+
+/* Set of currently active conversion functions.  */
+extern const struct gconv_fcts __wcsmbs_gconv_fcts_c attribute_hidden;
+
+/* Load conversion functions for the currently selected locale.  */
+extern void __wcsmbs_load_conv (struct __locale_data *new_category)
+     internal_function;
+
+/* Clone the current `__wcsmbs_load_conv' value.  */
+extern void __wcsmbs_clone_conv (struct gconv_fcts *copy)
+     internal_function;
+
+/* Find the conversion functions for converting to and from NAME.  */
+extern int __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name)
+     internal_function;
+
+/* Function used for the `private.cleanup' hook.  */
+extern void _nl_cleanup_ctype (struct __locale_data *)
+     internal_function attribute_hidden;
+
+
+#include <iconv/gconv_int.h>
+
+
+/* Load the function implementation if necessary.  */
+extern struct __gconv_step *__wcsmbs_getfct (const char *to, const char *from,
+					     size_t *nstepsp)
+     attribute_hidden;
+
+extern const struct __locale_data _nl_C_LC_CTYPE attribute_hidden;
+
+/* Check whether the LC_CTYPE locale changed since the last call.
+   Update the pointers appropriately.  */
+static inline const struct gconv_fcts *
+get_gconv_fcts (struct __locale_data *data)
+{
+  if (__glibc_unlikely (data->private.ctype == NULL))
+    {
+      if (__glibc_unlikely (data == &_nl_C_LC_CTYPE))
+	return &__wcsmbs_gconv_fcts_c;
+      __wcsmbs_load_conv (data);
+    }
+  return data->private.ctype;
+}
+
+#endif	/* wcsmbsload.h */
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncase.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncase.c
new file mode 100644
index 0000000..c6034a9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncase.c
@@ -0,0 +1,69 @@
+/* Compare at most N wide characters of two strings without taking care
+   for the case.
+   Copyright (C) 1992-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <wchar.h>
+#include <wctype.h>
+
+#ifndef weak_alias
+# define __wcsncasecmp wcsncasecmp
+# define TOLOWER(Ch) towlower (Ch)
+#else
+# ifdef USE_IN_EXTENDED_LOCALE_MODEL
+#  define __wcsncasecmp __wcsncasecmp_l
+#  define TOLOWER(Ch) __towlower_l ((Ch), loc)
+# else
+#  define TOLOWER(Ch) towlower (Ch)
+# endif
+#endif
+
+#ifdef USE_IN_EXTENDED_LOCALE_MODEL
+# define LOCALE_PARAM , __locale_t loc
+#else
+# define LOCALE_PARAM
+#endif
+
+/* Compare no more than N wide characters of S1 and S2,
+   ignoring case, returning less than, equal to or
+   greater than zero if S1 is lexicographically less
+   than, equal to or greater than S2.  */
+int
+__wcsncasecmp (const wchar_t *s1, const wchar_t *s2, size_t n LOCALE_PARAM)
+{
+  wint_t c1, c2;
+
+  if (s1 == s2 || n == 0)
+    return 0;
+
+  do
+    {
+      c1 = (wint_t) TOLOWER (*s1++);
+      c2 = (wint_t) TOLOWER (*s2++);
+      if (c1 == L'\0' || c1 != c2)
+	return c1 - c2;
+    } while (--n > 0);
+
+  return c1 - c2;
+}
+#ifndef __wcsncasecmp
+weak_alias (__wcsncasecmp, wcsncasecmp)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncase_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncase_l.c
new file mode 100644
index 0000000..2275a18
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncase_l.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define USE_IN_EXTENDED_LOCALE_MODEL	1
+#include <wcsncase.c>
+
+libc_hidden_def (__wcsncasecmp_l)
+weak_alias (__wcsncasecmp_l, wcsncasecmp_l)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncat.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncat.c
new file mode 100644
index 0000000..9b22764
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncat.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifndef WCSNCAT
+# define WCSNCAT wcsncat
+#endif
+
+/* Append no more than N wide-character of SRC onto DEST.  */
+wchar_t *
+WCSNCAT (wchar_t *dest, const wchar_t *src, size_t n)
+{
+  wchar_t c;
+  wchar_t * const s = dest;
+
+  /* Find the end of DEST.  */
+  do
+    c = *dest++;
+  while (c != L'\0');
+
+  /* Make DEST point before next character, so we can increment
+     it while memory is read (wins on pipelined cpus).	*/
+  dest -= 2;
+
+  if (n >= 4)
+    {
+      size_t n4 = n >> 2;
+      do
+	{
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	} while (--n4 > 0);
+      n &= 3;
+    }
+
+  while (n > 0)
+    {
+      c = *src++;
+      *++dest = c;
+      if (c == L'\0')
+	return s;
+      n--;
+    }
+
+  if (c != L'\0')
+    *++dest = L'\0';
+
+  return s;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncmp.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncmp.c
new file mode 100644
index 0000000..fa4cead
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncmp.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifndef WCSNCMP
+# define WCSNCMP wcsncmp
+#endif
+
+/* Compare no more than N characters of S1 and S2,
+   returning less than, equal to or greater than zero
+   if S1 is lexicographically less than, equal to or
+   greater than S2.  */
+int
+WCSNCMP (const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+  wchar_t c1 = L'\0';
+  wchar_t c2 = L'\0';
+
+  if (n >= 4)
+    {
+      size_t n4 = n >> 2;
+      do
+	{
+	  c1 = *s1++;
+	  c2 = *s2++;
+	  if (c1 == L'\0' || c1 != c2)
+	    return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0);
+	  c1 = *s1++;
+	  c2 = *s2++;
+	  if (c1 == L'\0' || c1 != c2)
+	    return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0);
+	  c1 = *s1++;
+	  c2 = *s2++;
+	  if (c1 == L'\0' || c1 != c2)
+	    return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0);
+	  c1 = *s1++;
+	  c2 = *s2++;
+	  if (c1 == L'\0' || c1 != c2)
+	    return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0);
+	} while (--n4 > 0);
+      n &= 3;
+    }
+
+  while (n > 0)
+    {
+      c1 = *s1++;
+      c2 = *s2++;
+      if (c1 == L'\0' || c1 != c2)
+	return c1 > c2 ? 1 : (c1 < c2 ? -1 : 0);
+      n--;
+    }
+
+  return 0;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncpy.c
new file mode 100644
index 0000000..cd90024
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsncpy.c
@@ -0,0 +1,88 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCSNCPY
+# define __wcsncpy WCSNCPY
+#endif
+
+/* Copy no more than N wide-characters of SRC to DEST.	*/
+wchar_t *
+__wcsncpy (wchar_t *dest, const wchar_t *src, size_t n)
+{
+  wint_t c;
+  wchar_t *const s = dest;
+
+  --dest;
+
+  if (n >= 4)
+    {
+      size_t n4 = n >> 2;
+
+      for (;;)
+	{
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    break;
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    break;
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    break;
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    break;
+	  if (--n4 == 0)
+	    goto last_chars;
+	}
+      n = n - (dest - s) - 1;
+      if (n == 0)
+	return s;
+      goto zero_fill;
+    }
+
+ last_chars:
+  n &= 3;
+  if (n == 0)
+    return s;
+
+  do
+    {
+      c = *src++;
+      *++dest = c;
+      if (--n == 0)
+	return s;
+    }
+  while (c != L'\0');
+
+ zero_fill:
+  do
+    *++dest = L'\0';
+  while (--n > 0);
+
+  return s;
+}
+#ifndef WCSNCPY
+weak_alias (__wcsncpy, wcsncpy)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsnlen.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsnlen.c
new file mode 100644
index 0000000..59527b1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsnlen.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCSNLEN
+# define __wcsnlen WCSNLEN
+#endif
+
+/* Return length of string S at most maxlen.  */
+size_t
+__wcsnlen (const wchar_t *s, size_t maxlen)
+{
+  size_t len = 0;
+
+  while (maxlen > 0 && s[len] != L'\0')
+    {
+      ++len;
+      if (--maxlen == 0 || s[len] == L'\0')
+	return len;
+      ++len;
+      if (--maxlen == 0 || s[len] == L'\0')
+	return len;
+      ++len;
+      if (--maxlen == 0 || s[len] == L'\0')
+	return len;
+      ++len;
+      --maxlen;
+    }
+
+  return len;
+}
+#ifndef WCSNLEN
+weak_alias (__wcsnlen, wcsnlen)
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsnrtombs.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsnrtombs.c
new file mode 100644
index 0000000..40d7ab7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsnrtombs.c
@@ -0,0 +1,148 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <gconv.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+#ifndef EILSEQ
+# define EILSEQ EINVAL
+#endif
+
+
+/* This is the private state used if PS is NULL.  */
+static mbstate_t state;
+
+/* This is a non-standard function but it is very useful in the
+   implementation of stdio because we have to deal with unterminated
+   buffers.  At most NWC wide character will be converted.  */
+size_t
+__wcsnrtombs (char *dst, const wchar_t **src, size_t nwc, size_t len,
+	      mbstate_t *ps)
+{
+  struct __gconv_step_data data;
+  const wchar_t *srcend;
+  int status;
+  size_t result;
+  struct __gconv_step *tomb;
+  const struct gconv_fcts *fcts;
+
+  /* Tell where we want the result.  */
+  data.__invocation_counter = 0;
+  data.__internal_use = 1;
+  data.__flags = __GCONV_IS_LAST;
+  data.__statep = ps ?: &state;
+
+  if (nwc == 0)
+    return 0;
+  srcend = *src + __wcsnlen (*src, nwc - 1) + 1;
+
+  /* Get the conversion functions.  */
+  fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+
+  /* 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)
+    {
+      mbstate_t temp_state;
+      unsigned char buf[256];		/* Just an arbitrary value.  */
+      const unsigned char *inbuf = (const unsigned char *) *src;
+      size_t dummy;
+
+      temp_state = *data.__statep;
+      data.__statep = &temp_state;
+
+      result = 0;
+      data.__outbufend = buf + sizeof (buf);
+
+      do
+	{
+	  data.__outbuf = buf;
+
+	  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;
+	}
+      while (status == __GCONV_FULL_OUTPUT);
+
+      if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	  && data.__outbuf[-1] == '\0')
+	/* Don't count the NUL character in.  */
+	--result;
+    }
+  else
+    {
+      /* This code is based on the safe assumption that all internal
+	 multi-byte encodings use the NUL byte only to mark the end
+	 of the string.  */
+      size_t dummy;
+
+      data.__outbuf = (unsigned char *) dst;
+      data.__outbufend = (unsigned char *) dst + len;
+
+      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;
+
+      /* We have to determine whether the last character converted
+	 is the NUL character.  */
+      if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	  && data.__outbuf[-1] == '\0')
+	{
+	  assert (data.__outbuf != (unsigned char *) dst);
+	  assert (__mbsinit (data.__statep));
+	  *src = NULL;
+	  --result;
+	}
+    }
+
+  /* There must not be any problems with the conversion but illegal input
+     characters.  */
+  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_FULL_OUTPUT
+      && status != __GCONV_EMPTY_INPUT)
+    {
+      result = (size_t) -1;
+      __set_errno (EILSEQ);
+    }
+
+  return result;
+}
+weak_alias (__wcsnrtombs, wcsnrtombs)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcspbrk.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcspbrk.c
new file mode 100644
index 0000000..7671aff
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcspbrk.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCSPBRK
+# define wcspbrk WCSPBRK
+#endif
+
+/* Find the first occurrence in WCS of any wide-character in ACCEPT.  */
+wchar_t *
+wcspbrk (const wchar_t *wcs, const wchar_t *accept)
+{
+  while (*wcs != L'\0')
+    if (wcschr (accept, *wcs) == NULL)
+      ++wcs;
+    else
+      return (wchar_t *) wcs;
+
+  return NULL;
+}
+libc_hidden_def (wcspbrk)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsrchr.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsrchr.c
new file mode 100644
index 0000000..8954ad0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsrchr.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifndef WCSRCHR
+# define WCSRCHR wcsrchr
+#endif
+
+/* Find the last occurrence of WC in WCS.  */
+wchar_t *
+WCSRCHR (const wchar_t *wcs, const wchar_t wc)
+{
+  const wchar_t *retval = NULL;
+
+  do
+    if (*wcs == wc)
+      retval = wcs;
+  while (*wcs++ != L'\0');
+
+  return (wchar_t *) retval;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsrtombs.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsrtombs.c
new file mode 100644
index 0000000..e22cc04
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsrtombs.c
@@ -0,0 +1,145 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <assert.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <gconv.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+#ifndef EILSEQ
+# define EILSEQ EINVAL
+#endif
+
+
+/* This is the private state used if PS is NULL.  */
+static mbstate_t state;
+
+size_t
+__wcsrtombs (char *dst, const wchar_t **src, size_t len, mbstate_t *ps)
+{
+  struct __gconv_step_data data;
+  int status;
+  size_t result;
+  struct __gconv_step *tomb;
+  const struct gconv_fcts *fcts;
+
+  /* Tell where we want the result.  */
+  data.__invocation_counter = 0;
+  data.__internal_use = 1;
+  data.__flags = __GCONV_IS_LAST;
+  data.__statep = ps ?: &state;
+
+  /* Get the conversion functions.  */
+  fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+
+  /* 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)
+    {
+      mbstate_t temp_state;
+      unsigned char buf[256];		/* Just an arbitrary value.  */
+      const wchar_t *srcend = *src + __wcslen (*src) + 1;
+      const unsigned char *inbuf = (const unsigned char *) *src;
+      size_t dummy;
+
+      temp_state = *data.__statep;
+      data.__statep = &temp_state;
+
+      result = 0;
+      data.__outbufend = buf + sizeof (buf);
+
+      do
+	{
+	  data.__outbuf = buf;
+
+	  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;
+	}
+      while (status == __GCONV_FULL_OUTPUT);
+
+      if (status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	{
+	  /* There better should be a NUL byte at the end.  */
+	  assert (data.__outbuf[-1] == '\0');
+	  /* Don't count the NUL character in.  */
+	  --result;
+	}
+    }
+  else
+    {
+      /* This code is based on the safe assumption that all internal
+	 multi-byte encodings use the NUL byte only to mark the end
+	 of the string.  */
+      const wchar_t *srcend = *src + __wcsnlen (*src, len) + 1;
+      size_t dummy;
+
+      data.__outbuf = (unsigned char *) dst;
+      data.__outbufend = (unsigned char *) dst + len;
+
+      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;
+
+      /* We have to determine whether the last character converted
+	 is the NUL character.  */
+      if ((status == __GCONV_OK || status == __GCONV_EMPTY_INPUT)
+	  && data.__outbuf[-1] == '\0')
+	{
+	  assert (data.__outbuf != (unsigned char *) dst);
+	  assert (__mbsinit (data.__statep));
+	  *src = NULL;
+	  --result;
+	}
+    }
+
+  /* There must not be any problems with the conversion but illegal input
+     characters.  */
+  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_FULL_OUTPUT
+      && status != __GCONV_EMPTY_INPUT)
+    {
+      result = (size_t) -1;
+      __set_errno (EILSEQ);
+    }
+
+  return result;
+}
+weak_alias (__wcsrtombs, wcsrtombs)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsspn.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsspn.c
new file mode 100644
index 0000000..ae26506
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsspn.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WCSSPN
+# define wcsspn WCSSPN
+#endif
+
+/* Return the length of the maximum initial segment
+   of WCS which contains only wide-characters in ACCEPT.  */
+size_t
+wcsspn (const wchar_t *wcs, const wchar_t *accept)
+{
+  const wchar_t *p;
+  const wchar_t *a;
+  size_t count = 0;
+
+  for (p = wcs; *p != L'\0'; ++p)
+    {
+      for (a = accept; *a != L'\0'; ++a)
+	if (*p == *a)
+	  break;
+      if (*a == L'\0')
+	return count;
+      else
+	++count;
+    }
+
+  return count;
+}
+libc_hidden_def (wcsspn)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsstr.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsstr.c
new file mode 100644
index 0000000..a3449ba
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsstr.c
@@ -0,0 +1,97 @@
+/* Copyright (C) 1995-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+/*
+ * The original strstr() file contains the following comment:
+ *
+ * My personal strstr() implementation that beats most other algorithms.
+ * Until someone tells me otherwise, I assume that this is the
+ * fastest implementation of strstr() in C.
+ * I deliberately chose not to comment it.  You should have at least
+ * as much fun trying to understand it, as I had to write it :-).
+ *
+ * Stephen R. van den Berg, berg@pool.informatik.rwth-aachen.de */
+
+#include <wchar.h>
+
+wchar_t *
+wcsstr (const wchar_t *haystack, const wchar_t *needle)
+{
+  wchar_t b, c;
+
+  if ((b = *needle) != L'\0')
+    {
+      haystack--;				/* possible ANSI violation */
+      do
+	if ((c = *++haystack) == L'\0')
+	  goto ret0;
+      while (c != b);
+
+      if (!(c = *++needle))
+	goto foundneedle;
+      ++needle;
+      goto jin;
+
+      for (;;)
+	{
+	  wchar_t a;
+	  const wchar_t *rhaystack, *rneedle;
+
+	  do
+	    {
+	      if (!(a = *++haystack))
+		goto ret0;
+	      if (a == b)
+		break;
+	      if ((a = *++haystack) == L'\0')
+		goto ret0;
+shloop:	      ;
+	    }
+	  while (a != b);
+
+jin:	  if (!(a = *++haystack))
+	    goto ret0;
+
+	  if (a != c)
+	    goto shloop;
+
+	  if (*(rhaystack = haystack-- + 1) == (a = *(rneedle = needle)))
+	    do
+	      {
+		if (a == L'\0')
+		  goto foundneedle;
+		if (*++rhaystack != (a = *++needle))
+		  break;
+		if (a == L'\0')
+		  goto foundneedle;
+	      }
+	    while (*++rhaystack == (a = *++needle));
+
+	  needle = rneedle;		  /* took the register-poor approach */
+
+	  if (a == L'\0')
+	    break;
+	}
+    }
+foundneedle:
+  return (wchar_t*) haystack;
+ret0:
+  return NULL;
+}
+/* This alias is for backward compatibility with drafts of the ISO C
+   standard.  Unfortunately the Unix(TM) standard requires this name.  */
+weak_alias (wcsstr, wcswcs)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod.c
new file mode 100644
index 0000000..8e16234
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <xlocale.h>
+
+
+#define	USE_WIDE_CHAR	1
+
+extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,
+				     __locale_t);
+
+#include <stdlib/strtod.c>
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod_l.c
new file mode 100644
index 0000000..62e75ed
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <xlocale.h>
+
+
+extern double ____wcstod_l_internal (const wchar_t *, wchar_t **, int,
+				     __locale_t);
+
+#define	USE_WIDE_CHAR	1
+
+#include <stdlib/strtod_l.c>
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod_nan.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod_nan.c
new file mode 100644
index 0000000..cd96ea0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstod_nan.c
@@ -0,0 +1,23 @@
+/* Convert string for NaN payload to corresponding NaN.  Wide strings, double.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "../stdlib/strtod_nan_wide.h"
+#include "../stdlib/strtod_nan_double.h"
+
+#define STRTOD_NAN __wcstod_nan
+#include "../stdlib/strtod_nan_main.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof.c
new file mode 100644
index 0000000..ac998cf
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <xlocale.h>
+
+#define	USE_WIDE_CHAR	1
+
+extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
+				    __locale_t);
+
+#include <stdlib/strtof.c>
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof_l.c
new file mode 100644
index 0000000..f03f3ef
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <xlocale.h>
+
+
+#define	USE_WIDE_CHAR	1
+
+extern float ____wcstof_l_internal (const wchar_t *, wchar_t **, int,
+				    __locale_t);
+
+#include <stdlib/strtof_l.c>
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof_nan.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof_nan.c
new file mode 100644
index 0000000..58ee01a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstof_nan.c
@@ -0,0 +1,23 @@
+/* Convert string for NaN payload to corresponding NaN.  Wide strings, float.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "../stdlib/strtod_nan_wide.h"
+#include "../stdlib/strtod_nan_float.h"
+
+#define STRTOD_NAN __wcstof_nan
+#include "../stdlib/strtod_nan_main.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstok.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstok.c
new file mode 100644
index 0000000..74de78c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstok.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include <errno.h>
+
+
+/* Parse WCS into tokens separated by characters in DELIM.  If WCS is
+   NULL, the last string wcstok() was called with is used.  */
+wchar_t *
+wcstok (wchar_t *wcs, const wchar_t *delim, wchar_t **save_ptr)
+{
+  wchar_t *result;
+
+  if (wcs == NULL)
+    {
+      if (*save_ptr == NULL)
+	{
+	  __set_errno (EINVAL);
+	  return NULL;
+	}
+      else
+	wcs = *save_ptr;
+    }
+
+  /* Scan leading delimiters.  */
+  wcs += wcsspn (wcs, delim);
+  if (*wcs == L'\0')
+    {
+      *save_ptr = NULL;
+      return NULL;
+    }
+
+  /* Find the end of the token.	 */
+  result = wcs;
+  wcs = wcspbrk (result, delim);
+  if (wcs == NULL)
+    /* This token finishes the string.	*/
+    *save_ptr = NULL;
+  else
+    {
+      /* Terminate the token and make *SAVE_PTR point past it.  */
+      *wcs = L'\0';
+      *save_ptr = wcs + 1;
+    }
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstol.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstol.c
new file mode 100644
index 0000000..cefd747
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstol.c
@@ -0,0 +1,22 @@
+/* Function to parse a `long int' from text.
+   Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define	USE_WIDE_CHAR	1
+
+#include <stdlib/strtol.c>
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstol_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstol_l.c
new file mode 100644
index 0000000..1cebaec
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstol_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#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/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold.c
new file mode 100644
index 0000000..03d4c96
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <xlocale.h>
+
+#define USE_WIDE_CHAR	1
+
+extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **, int,
+					   __locale_t);
+
+#include <stdlib/strtold.c>
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold_l.c
new file mode 100644
index 0000000..c7459f8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold_l.c
@@ -0,0 +1,28 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+#include <xlocale.h>
+
+#define USE_WIDE_CHAR	1
+
+extern long double ____wcstold_l_internal (const wchar_t *, wchar_t **, int,
+					   __locale_t);
+
+#include <strtold_l.c>
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold_nan.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold_nan.c
new file mode 100644
index 0000000..6baeee7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstold_nan.c
@@ -0,0 +1,30 @@
+/* Convert string for NaN payload to corresponding NaN.  Wide strings,
+   long double.
+   Copyright (C) 2015-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+
+/* This function is unused if long double and double have the same
+   representation.  */
+#ifndef __NO_LONG_DOUBLE_MATH
+# include "../stdlib/strtod_nan_wide.h"
+# include <strtod_nan_ldouble.h>
+
+# define STRTOD_NAN __wcstold_nan
+# include "../stdlib/strtod_nan_main.c"
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoll.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoll.c
new file mode 100644
index 0000000..91a7291
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoll.c
@@ -0,0 +1,24 @@
+/* Function to parse a `long long int' from text.
+   Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define	QUAD	1
+
+#include "wcstol.c"
+
+weak_alias (wcstoll, wcstoq)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoll_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoll_l.c
new file mode 100644
index 0000000..ea2aa5a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoll_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#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/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoul.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoul.c
new file mode 100644
index 0000000..064dc6a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoul.c
@@ -0,0 +1,22 @@
+/* Function to parse an `unsigned long int' from text.
+   Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define	UNSIGNED	1
+
+#include "wcstol.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoul_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoul_l.c
new file mode 100644
index 0000000..314d7d7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoul_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#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/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoull.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoull.c
new file mode 100644
index 0000000..2a91bee
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoull.c
@@ -0,0 +1,24 @@
+/* Function to parse an `unsigned long long int' from text.
+   Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define	QUAD	1
+
+#include "wcstoul.c"
+
+weak_alias (wcstoull, wcstouq)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoull_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoull_l.c
new file mode 100644
index 0000000..24b1d79
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcstoull_l.c
@@ -0,0 +1,30 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#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/ap/libc/glibc/glibc-2.23/wcsmbs/wcswidth.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcswidth.c
new file mode 100644
index 0000000..e0b3ac2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcswidth.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#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/ap/libc/glibc/glibc-2.23/wcsmbs/wcsxfrm.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsxfrm.c
new file mode 100644
index 0000000..2473d23
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsxfrm.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include "../locale/coll-lookup.h"
+
+#define STRING_TYPE wchar_t
+#define STRXFRM wcsxfrm
+#define STRXFRM_L __wcsxfrm_l
+
+#include "../string/strxfrm.c"
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcsxfrm_l.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsxfrm_l.c
new file mode 100644
index 0000000..7395416
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcsxfrm_l.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include "../locale/coll-lookup.h"
+
+#define STRING_TYPE wchar_t
+#define USTRING_TYPE wint_t
+#define STRXFRM __wcsxfrm_l
+#define STRLEN __wcslen
+#define STPNCPY __wcpncpy
+#define WEIGHT_H "../locale/weightwc.h"
+#define SUFFIX  WC
+#define L(arg) L##arg
+#define WIDE_CHAR_VERSION 1
+
+#include "../string/strxfrm_l.c"
+
+weak_alias (__wcsxfrm_l, wcsxfrm_l)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wctob.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wctob.c
new file mode 100644
index 0000000..c054290
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wctob.c
@@ -0,0 +1,82 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <dlfcn.h>
+#include <gconv.h>
+#include <stdio.h>
+#include <string.h>
+#include <wchar.h>
+#include <wcsmbsload.h>
+
+#include <sysdep.h>
+
+
+int
+wctob (wint_t c)
+{
+  unsigned char buf[MB_LEN_MAX];
+  struct __gconv_step_data data;
+  wchar_t inbuf[1];
+  wchar_t *inptr = inbuf;
+  size_t dummy;
+  int status;
+  const struct gconv_fcts *fcts;
+
+  if (c == WEOF)
+    return EOF;
+
+  /* We know that only ASCII compatible encodings are used for the
+     locale and that the wide character encoding is ISO 10646.  */
+  if (c >= L'\0' && c <= L'\x7f')
+    return (int) c;
+
+  /* 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;
+
+  /* Make sure we start in the initial state.  */
+  memset (&data.__state, '\0', sizeof (mbstate_t));
+
+  /* Get the conversion functions.  */
+  fcts = get_gconv_fcts (_NL_CURRENT_DATA (LC_CTYPE));
+
+  /* Create the input string.  */
+  inbuf[0] = c;
+
+  const unsigned char *argptr = (const unsigned char *) inptr;
+  __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));
+
+  /* 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 buf[0];
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcwidth.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wcwidth.c
new file mode 100644
index 0000000..a56297b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcwidth.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "wcwidth.h"
+
+/* Determine number of column positions required for CH.  */
+int
+wcwidth (wchar_t ch)
+{
+  return internal_wcwidth (ch);
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wcwidth.h b/ap/libc/glibc/glibc-2.23/wcsmbs/wcwidth.h
new file mode 100644
index 0000000..bebeb6c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wcwidth.h
@@ -0,0 +1,39 @@
+/* Internal header containing implementation of wcwidth() function.
+   Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include <wctype.h>
+#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;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wmemchr.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemchr.c
new file mode 100644
index 0000000..27a79d5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemchr.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WMEMCHR
+# define __wmemchr WMEMCHR
+#endif
+
+wchar_t *
+__wmemchr (const wchar_t *s, wchar_t c, size_t n)
+{
+  /* For performance reasons unfold the loop four times.  */
+  while (n >= 4)
+    {
+      if (s[0] == c)
+	return (wchar_t *) s;
+      if (s[1] == c)
+	return (wchar_t *) &s[1];
+      if (s[2] == c)
+	return (wchar_t *) &s[2];
+      if (s[3] == c)
+	return (wchar_t *) &s[3];
+      s += 4;
+      n -= 4;
+    }
+
+  if (n > 0)
+    {
+      if (*s == c)
+	return (wchar_t *) s;
+      ++s;
+      --n;
+    }
+  if (n > 0)
+    {
+      if (*s == c)
+	return (wchar_t *) s;
+      ++s;
+      --n;
+    }
+  if (n > 0)
+    if (*s == c)
+      return (wchar_t *) s;
+
+  return NULL;
+}
+libc_hidden_def (__wmemchr)
+weak_alias (__wmemchr, wmemchr)
+libc_hidden_weak (wmemchr)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wmemcmp.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemcmp.c
new file mode 100644
index 0000000..83594d1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemcmp.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 1996-2016 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifndef WMEMCMP
+# define WMEMCMP wmemcmp
+#endif
+
+int
+WMEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n)
+{
+  wchar_t c1;
+  wchar_t c2;
+
+  while (n >= 4)
+    {
+      c1 = s1[0];
+      c2 = s2[0];
+      if (c1 - c2 != 0)
+	return c1 > c2 ? 1 : -1;
+      c1 = s1[1];
+      c2 = s2[1];
+      if (c1 - c2 != 0)
+	return c1 > c2 ? 1 : -1;
+      c1 = s1[2];
+      c2 = s2[2];
+      if (c1 - c2 != 0)
+	return c1 > c2 ? 1 : -1;
+      c1 = s1[3];
+      c2 = s2[3];
+      if (c1 - c2 != 0)
+	return c1 > c2 ? 1 : -1;
+      s1 += 4;
+      s2 += 4;
+      n -= 4;
+    }
+
+  if (n > 0)
+    {
+      c1 = s1[0];
+      c2 = s2[0];
+      if (c1 - c2 != 0)
+	return c1 > c2 ? 1 : -1;
+      ++s1;
+      ++s2;
+      --n;
+    }
+  if (n > 0)
+    {
+      c1 = s1[0];
+      c2 = s2[0];
+      if (c1 - c2 != 0)
+	return c1 > c2 ? 1 : -1;
+      ++s1;
+      ++s2;
+      --n;
+    }
+  if (n > 0)
+    {
+      c1 = s1[0];
+      c2 = s2[0];
+      if (c1 - c2 != 0)
+	return c1 > c2 ? 1 : -1;
+    }
+
+  return 0;
+}
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wmemcpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemcpy.c
new file mode 100644
index 0000000..06e156a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemcpy.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include <string.h>
+
+
+wchar_t *
+__wmemcpy (wchar_t *s1, const wchar_t *s2, size_t n)
+{
+  return (wchar_t *) memcpy ((char *) s1, (char *) s2, n * sizeof (wchar_t));
+}
+weak_alias (__wmemcpy, wmemcpy)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wmemmove.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemmove.c
new file mode 100644
index 0000000..f13f6fb
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemmove.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include <string.h>
+
+
+wchar_t *
+__wmemmove (wchar_t *s1, const wchar_t *s2, size_t n)
+{
+  return (wchar_t *) memmove ((char *) s1, (char *) s2, n * sizeof (wchar_t));
+}
+weak_alias (__wmemmove, wmemmove)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wmempcpy.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wmempcpy.c
new file mode 100644
index 0000000..c6387ed
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wmempcpy.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
+
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+#include <string.h>
+
+
+wchar_t *
+__wmempcpy (wchar_t *s1, const wchar_t *s2, size_t n)
+{
+  return (wchar_t *) __mempcpy ((char *) s1, (char *) s2,
+				n * sizeof (wchar_t));
+}
+weak_alias (__wmempcpy, wmempcpy)
diff --git a/ap/libc/glibc/glibc-2.23/wcsmbs/wmemset.c b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemset.c
new file mode 100644
index 0000000..67f7ad0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/wcsmbs/wmemset.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <wchar.h>
+
+#ifdef WMEMSET
+# define __wmemset WMEMSET
+#endif
+
+wchar_t *
+__wmemset (wchar_t *s, wchar_t c, size_t n)
+{
+  wchar_t *wp = s;
+
+  while (n >= 4)
+    {
+      wp[0] = c;
+      wp[1] = c;
+      wp[2] = c;
+      wp[3] = c;
+      wp += 4;
+      n -= 4;
+    }
+
+  if (n > 0)
+    {
+      wp[0] = c;
+
+      if (n > 1)
+	{
+	  wp[1] = c;
+
+	  if (n > 2)
+	    wp[2] = c;
+	}
+    }
+
+  return s;
+}
+libc_hidden_def (__wmemset)
+weak_alias (__wmemset, wmemset)
+libc_hidden_weak (wmemset)
