diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/Depend b/ap/libc/glibc/glibc-2.22/wcsmbs/Depend
new file mode 100644
index 0000000..f3e1156
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/Depend
@@ -0,0 +1 @@
+localedata
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/Makefile b/ap/libc/glibc/glibc-2.22/wcsmbs/Makefile
new file mode 100644
index 0000000..44a4494
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/Makefile
@@ -0,0 +1,80 @@
+# Copyright (C) 1995-2015 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 \
+	    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
+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 $(addprefix test-,$(strop-tests))
+
+include ../Rules
+
+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 += $(exceptions)
+CFLAGS-isoc99_fwscanf.c += $(exceptions)
+CFLAGS-isoc99_vwscanf.c += $(exceptions)
+CFLAGS-isoc99_vfwscanf.c += $(exceptions)
+
+CPPFLAGS += $(libio-mtsafe)
+
+# We need to find the default version of strtold_l in stdlib.
+CPPFLAGS-wcstold_l.c = -I../stdlib
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/Versions b/ap/libc/glibc/glibc-2.22/wcsmbs/Versions
new file mode 100644
index 0000000..1ff5ff3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/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.22/wcsmbs/bits/wchar-ldbl.h b/ap/libc/glibc/glibc-2.22/wcsmbs/bits/wchar-ldbl.h
new file mode 100644
index 0000000..b7b12e0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/bits/wchar-ldbl.h
@@ -0,0 +1,74 @@
+/* -mlong-double-64 compatibility mode for <wchar.h> functions.
+   Copyright (C) 2006-2015 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.22/wcsmbs/bits/wchar2.h b/ap/libc/glibc/glibc-2.22/wcsmbs/bits/wchar2.h
new file mode 100644
index 0000000..8be3552
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/bits/wchar2.h
@@ -0,0 +1,593 @@
+/* Checking macros for wchar functions.
+   Copyright (C) 2005-2015 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.22/wcsmbs/btowc.c b/ap/libc/glibc/glibc-2.22/wcsmbs/btowc.c
new file mode 100644
index 0000000..9bb03f3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/btowc.c
@@ -0,0 +1,101 @@
+/* Copyright (C) 1996-2015 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 (c)
+     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.22/wcsmbs/c16rtomb.c b/ap/libc/glibc/glibc-2.22/wcsmbs/c16rtomb.c
new file mode 100644
index 0000000..54d9468
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/c16rtomb.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 2011-2015 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.22/wcsmbs/isoc99_fwscanf.c b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_fwscanf.c
new file mode 100644
index 0000000..3cc414f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_fwscanf.c
@@ -0,0 +1,40 @@
+/* Copyright (C) 1991-2015 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.22/wcsmbs/isoc99_swscanf.c b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_swscanf.c
new file mode 100644
index 0000000..dc8f3ec
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_swscanf.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991-2015 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.22/wcsmbs/isoc99_vfwscanf.c b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_vfwscanf.c
new file mode 100644
index 0000000..f9f1e2b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_vfwscanf.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991-2015 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.22/wcsmbs/isoc99_vswscanf.c b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_vswscanf.c
new file mode 100644
index 0000000..510840d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_vswscanf.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1993-2015 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.22/wcsmbs/isoc99_vwscanf.c b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_vwscanf.c
new file mode 100644
index 0000000..b6bac93
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_vwscanf.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1991-2015 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.22/wcsmbs/isoc99_wscanf.c b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_wscanf.c
new file mode 100644
index 0000000..79661f0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/isoc99_wscanf.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991-2015 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.22/wcsmbs/mbrlen.c b/ap/libc/glibc/glibc-2.22/wcsmbs/mbrlen.c
new file mode 100644
index 0000000..25f6f45
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/mbrlen.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996-2015 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 (s, n, ps)
+     const char *s;
+     size_t n;
+     mbstate_t *ps;
+{
+  return __mbrtowc (NULL, s, n, ps ?: &internal);
+}
+libc_hidden_def (__mbrlen)
+weak_alias (__mbrlen, mbrlen)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/mbrtoc16.c b/ap/libc/glibc/glibc-2.22/wcsmbs/mbrtoc16.c
new file mode 100644
index 0000000..f23b242
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/mbrtoc16.c
@@ -0,0 +1,154 @@
+/* Copyright (C) 2011-2015 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.22/wcsmbs/mbrtowc.c b/ap/libc/glibc/glibc-2.22/wcsmbs/mbrtowc.c
new file mode 100644
index 0000000..dbfe940
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/mbrtowc.c
@@ -0,0 +1,129 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/mbsinit.c b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsinit.c
new file mode 100644
index 0000000..4e33734
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsinit.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996-2015 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 (ps)
+     const mbstate_t *ps;
+{
+  return ps == NULL || ps->__count == 0;
+}
+weak_alias (__mbsinit, mbsinit)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/mbsnrtowcs.c b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsnrtowcs.c
new file mode 100644
index 0000000..9c354a9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsnrtowcs.c
@@ -0,0 +1,147 @@
+/* Copyright (C) 1996-2015 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 (dst, src, nmc, len, ps)
+     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.22/wcsmbs/mbsrtowcs.c b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsrtowcs.c
new file mode 100644
index 0000000..7e468b6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsrtowcs.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996-2015 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 (dst, src, len, ps)
+     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.22/wcsmbs/mbsrtowcs_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsrtowcs_l.c
new file mode 100644
index 0000000..557b3ed
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/mbsrtowcs_l.c
@@ -0,0 +1,167 @@
+/* Copyright (C) 2002-2015 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 (dst, src, len, ps, 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.22/wcsmbs/test-wcschr.c b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcschr.c
new file mode 100644
index 0000000..be0abf7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcschr.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strchr.c"
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcscmp.c b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcscmp.c
new file mode 100644
index 0000000..aa18c30
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcscmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strcmp.c"
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcscpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcscpy.c
new file mode 100644
index 0000000..b7cad53
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcscpy.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strcpy.c"
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcslen.c b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcslen.c
new file mode 100644
index 0000000..496fa18
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcslen.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strlen.c"
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcsncmp.c b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcsncmp.c
new file mode 100644
index 0000000..07757d8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcsncmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strncmp.c"
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcsrchr.c b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcsrchr.c
new file mode 100644
index 0000000..95a5568
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wcsrchr.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-strrchr.c"
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/test-wmemcmp.c b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wmemcmp.c
new file mode 100644
index 0000000..73bc4b7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/test-wmemcmp.c
@@ -0,0 +1,2 @@
+#define WIDE 1
+#include "../string/test-memcmp.c"
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/tst-btowc.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-btowc.c
new file mode 100644
index 0000000..011ac86
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-btowc.c
@@ -0,0 +1,177 @@
+/* Copyright (C) 2000-2015 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.22/wcsmbs/tst-c16c32-1.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-c16c32-1.c
new file mode 100644
index 0000000..3b1c1d6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/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.22/wcsmbs/tst-mbrtowc.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-mbrtowc.c
new file mode 100644
index 0000000..ed6e7c6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-mbrtowc.c
@@ -0,0 +1,235 @@
+/* Copyright (C) 2000-2015 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.22/wcsmbs/tst-mbrtowc2.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-mbrtowc2.c
new file mode 100644
index 0000000..67d8e29
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/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.22/wcsmbs/tst-mbsrtowcs.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-mbsrtowcs.c
new file mode 100644
index 0000000..9d15078
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-mbsrtowcs.c
@@ -0,0 +1,67 @@
+/* Test NUL handling of mbsrtowcs.
+   Copyright (C) 2004-2015 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.22/wcsmbs/tst-wchar-h.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wchar-h.c
new file mode 100644
index 0000000..fd2ad56
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/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.22/wcsmbs/tst-wcpncpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wcpncpy.c
new file mode 100644
index 0000000..fe70807
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wcpncpy.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 2003-2015 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.22/wcsmbs/tst-wcrtomb.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wcrtomb.c
new file mode 100644
index 0000000..ab1df70
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wcrtomb.c
@@ -0,0 +1,97 @@
+/* Copyright (C) 2000-2015 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.22/wcsmbs/tst-wcsnlen.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wcsnlen.c
new file mode 100644
index 0000000..14c7afe
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wcsnlen.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 1999-2015 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.22/wcsmbs/tst-wcstof.c b/ap/libc/glibc/glibc-2.22/wcsmbs/tst-wcstof.c
new file mode 100644
index 0000000..576a58c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/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.22/wcsmbs/uchar.h b/ap/libc/glibc/glibc-2.22/wcsmbs/uchar.h
new file mode 100644
index 0000000..26da875
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/uchar.h
@@ -0,0 +1,83 @@
+/* Copyright (C) 2011-2015 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.22/wcsmbs/wchar.h b/ap/libc/glibc/glibc-2.22/wcsmbs/wchar.h
new file mode 100644
index 0000000..0d68cda
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wchar.h
@@ -0,0 +1,902 @@
+/* Copyright (C) 1995-2015 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;
+/* 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;
+
+/* Compare S1 and S2.  */
+extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2)
+     __THROW __attribute_pure__;
+/* 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__;
+__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.22/wcsmbs/wcpcpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcpcpy.c
new file mode 100644
index 0000000..1c05bca
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcpcpy.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 1996-2015 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>
+
+
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in
+   DEST.  */
+wchar_t *
+__wcpcpy (dest, src)
+     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;
+}
+
+weak_alias (__wcpcpy, wcpcpy)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcpncpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcpncpy.c
new file mode 100644
index 0000000..98c77a5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcpncpy.c
@@ -0,0 +1,85 @@
+/* Copyright (C) 1996-2015 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>
+
+
+/* Copy no more than N wide-characters of SRC to DEST, returning the
+   address of the last character written into DEST.  */
+wchar_t *
+__wcpncpy (dest, src, n)
+     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;
+}
+
+weak_alias (__wcpncpy, wcpncpy)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcrtomb.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcrtomb.c
new file mode 100644
index 0000000..cb19ae9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcrtomb.c
@@ -0,0 +1,120 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcsatcliff.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsatcliff.c
new file mode 100644
index 0000000..95afff6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/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.22/wcsmbs/wcscasecmp.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscasecmp.c
new file mode 100644
index 0000000..043a8cd
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscasecmp.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 1991-2015 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 , loc
+# define LOCALE_PARAM_DECL __locale_t loc;
+#else
+# define LOCALE_PARAM
+# define LOCALE_PARAM_DECL
+#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 (s1, s2 LOCALE_PARAM)
+     const wchar_t *s1;
+     const wchar_t *s2;
+     LOCALE_PARAM_DECL
+{
+  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.22/wcsmbs/wcscasecmp_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscasecmp_l.c
new file mode 100644
index 0000000..5183c15
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscasecmp_l.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1997-2015 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.22/wcsmbs/wcscat.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscat.c
new file mode 100644
index 0000000..b993613
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscat.c
@@ -0,0 +1,50 @@
+/* Copyright (C) 1995-2015 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>
+
+
+/* Append SRC on the end of DEST.  */
+wchar_t *
+__wcscat (dest, src)
+     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;
+}
+weak_alias (__wcscat, wcscat)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcschr.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcschr.c
new file mode 100644
index 0000000..77624be
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcschr.c
@@ -0,0 +1,37 @@
+/* Copyright (C) 1995-2015 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.22/wcsmbs/wcschrnul.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcschrnul.c
new file mode 100644
index 0000000..4bc42d1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcschrnul.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1995-2015 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>
+
+
+/* Find the first occurrence of WC in WCS.  */
+wchar_t *
+__wcschrnul (wcs, wc)
+     const wchar_t *wcs;
+     const wchar_t wc;
+{
+  while (*wcs != L'\0')
+    if (*wcs == wc)
+      break;
+    else
+      ++wcs;
+
+  return (wchar_t *) wcs;
+}
+weak_alias (__wcschrnul, wcschrnul)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcscmp.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscmp.c
new file mode 100644
index 0000000..fcfe0c5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscmp.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1995-2015 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 (s1, s2)
+     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.22/wcsmbs/wcscoll.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscoll.c
new file mode 100644
index 0000000..7176930
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscoll.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcscoll_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscoll_l.c
new file mode 100644
index 0000000..6d9384a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscoll_l.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1996-2015 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 STRDIFF __wcsdiff
+#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.22/wcsmbs/wcscpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscpy.c
new file mode 100644
index 0000000..56e8fc1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscpy.c
@@ -0,0 +1,62 @@
+/* Copyright (C) 1995-2015 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 (dest, src)
+     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.22/wcsmbs/wcscspn.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscspn.c
new file mode 100644
index 0000000..d8cc24a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcscspn.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1995-2015 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 the length of the maximum initial segment
+   of WCS which contains only wide-characters not in REJECT.  */
+size_t
+wcscspn (wcs, reject)
+     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.22/wcsmbs/wcsdup.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsdup.c
new file mode 100644
index 0000000..58c2c52
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsdup.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1995-2015 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 (s)
+     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.22/wcsmbs/wcslen.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcslen.c
new file mode 100644
index 0000000..e076721
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcslen.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1995-2015 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 (s)
+     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.22/wcsmbs/wcsmbs-tst1.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsmbs-tst1.c
new file mode 100644
index 0000000..9cdef45
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/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, "");
+  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.22/wcsmbs/wcsmbsload.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsmbsload.c
new file mode 100644
index 0000000..6bb49bc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsmbsload.c
@@ -0,0 +1,270 @@
+/* Copyright (C) 1998-2015 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 <bits/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.22/wcsmbs/wcsmbsload.h b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsmbsload.h
new file mode 100644
index 0000000..b64a829
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsmbsload.h
@@ -0,0 +1,80 @@
+/* Copyright (C) 1998-2015 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.22/wcsmbs/wcsncase.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncase.c
new file mode 100644
index 0000000..25507d8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncase.c
@@ -0,0 +1,75 @@
+/* Compare at most N wide characters of two strings without taking care
+   for the case.
+   Copyright (C) 1992-2015 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 , loc
+# define LOCALE_PARAM_DECL __locale_t loc;
+#else
+# define LOCALE_PARAM
+# define LOCALE_PARAM_DECL
+#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 (s1, s2, n LOCALE_PARAM)
+     const wchar_t *s1;
+     const wchar_t *s2;
+     size_t n;
+     LOCALE_PARAM_DECL
+{
+  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.22/wcsmbs/wcsncase_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncase_l.c
new file mode 100644
index 0000000..fd3cbb0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncase_l.c
@@ -0,0 +1,23 @@
+/* Copyright (C) 1997-2015 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.22/wcsmbs/wcsncat.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncat.c
new file mode 100644
index 0000000..63eb126
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncat.c
@@ -0,0 +1,79 @@
+/* Copyright (C) 1995-2015 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>
+
+
+/* Append no more than N wide-character of SRC onto DEST.  */
+wchar_t *
+wcsncat (dest, src, n)
+     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.22/wcsmbs/wcsncmp.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncmp.c
new file mode 100644
index 0000000..e083ad8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncmp.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 1995-2015 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>
+
+
+/* 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 (s1, s2, n)
+     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.22/wcsmbs/wcsncpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncpy.c
new file mode 100644
index 0000000..7016f41
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsncpy.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 1995-2015 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>
+
+
+/* Copy no more than N wide-characters of SRC to DEST.	*/
+wchar_t *
+__wcsncpy (dest, src, n)
+     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;
+}
+weak_alias (__wcsncpy, wcsncpy)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcsnlen.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsnlen.c
new file mode 100644
index 0000000..2bee705
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsnlen.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 1998-2015 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>
+
+
+/* Copy SRC to DEST.  */
+size_t
+__wcsnlen (s, maxlen)
+     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;
+}
+weak_alias (__wcsnlen, wcsnlen)
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcsnrtombs.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsnrtombs.c
new file mode 100644
index 0000000..df83c94
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsnrtombs.c
@@ -0,0 +1,152 @@
+/* Copyright (C) 1996-2015 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 (dst, src, nwc, len, ps)
+     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.22/wcsmbs/wcspbrk.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcspbrk.c
new file mode 100644
index 0000000..17e821c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcspbrk.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1995-2015 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>
+
+
+/* Find the first occurrence in WCS of any wide-character in ACCEPT.  */
+wchar_t *
+wcspbrk (wcs, accept)
+     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.22/wcsmbs/wcsrchr.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsrchr.c
new file mode 100644
index 0000000..72b04fb
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsrchr.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1995-2015 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 (wcs, wc)
+     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.22/wcsmbs/wcsrtombs.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsrtombs.c
new file mode 100644
index 0000000..bc8e7b8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsrtombs.c
@@ -0,0 +1,149 @@
+/* Copyright (C) 1996-2015 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 (dst, src, len, ps)
+     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.22/wcsmbs/wcsspn.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsspn.c
new file mode 100644
index 0000000..db51acc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsspn.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 1995-2015 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 the length of the maximum initial segment
+   of WCS which contains only wide-characters in ACCEPT.  */
+size_t
+wcsspn (wcs, accept)
+     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.22/wcsmbs/wcsstr.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsstr.c
new file mode 100644
index 0000000..a62c29e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsstr.c
@@ -0,0 +1,99 @@
+/* Copyright (C) 1995-2015 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 (haystack, needle)
+     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.22/wcsmbs/wcstod.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstod.c
new file mode 100644
index 0000000..1366d1b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstod.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcstod_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstod_l.c
new file mode 100644
index 0000000..9c026d8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstod_l.c
@@ -0,0 +1,32 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2015 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);
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+						       wchar_t **, int, int,
+						       __locale_t);
+
+#define	USE_WIDE_CHAR	1
+
+#include <stdlib/strtod_l.c>
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcstof.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstof.c
new file mode 100644
index 0000000..8972d9a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstof.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcstof_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstof_l.c
new file mode 100644
index 0000000..bcf9834
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstof_l.c
@@ -0,0 +1,32 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2015 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);
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+						       wchar_t **, int, int,
+						       __locale_t);
+
+#include <stdlib/strtof_l.c>
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcstok.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstok.c
new file mode 100644
index 0000000..7361017
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstok.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 1995-2015 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 (wcs, delim, save_ptr)
+     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.22/wcsmbs/wcstol.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstol.c
new file mode 100644
index 0000000..49c32f0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstol.c
@@ -0,0 +1,22 @@
+/* Function to parse a `long int' from text.
+   Copyright (C) 1996-2015 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.22/wcsmbs/wcstol_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstol_l.c
new file mode 100644
index 0000000..227a5da
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstol_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2015 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.22/wcsmbs/wcstold.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstold.c
new file mode 100644
index 0000000..c66873b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstold.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcstold_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstold_l.c
new file mode 100644
index 0000000..8df93af
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstold_l.c
@@ -0,0 +1,31 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2015 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);
+extern unsigned long long int ____wcstoull_l_internal (const wchar_t *,
+						       wchar_t **, int, int,
+						       __locale_t);
+
+#include <strtold_l.c>
diff --git a/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoll.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoll.c
new file mode 100644
index 0000000..bcb2cae
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoll.c
@@ -0,0 +1,24 @@
+/* Function to parse a `long long int' from text.
+   Copyright (C) 1996-2015 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.22/wcsmbs/wcstoll_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoll_l.c
new file mode 100644
index 0000000..1c91577
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoll_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2015 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.22/wcsmbs/wcstoul.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoul.c
new file mode 100644
index 0000000..be955e3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoul.c
@@ -0,0 +1,22 @@
+/* Function to parse an `unsigned long int' from text.
+   Copyright (C) 1996-2015 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.22/wcsmbs/wcstoul_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoul_l.c
new file mode 100644
index 0000000..d35f2f2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoul_l.c
@@ -0,0 +1,29 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2015 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.22/wcsmbs/wcstoull.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoull.c
new file mode 100644
index 0000000..d063f34
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoull.c
@@ -0,0 +1,24 @@
+/* Function to parse an `unsigned long long int' from text.
+   Copyright (C) 1996-2015 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.22/wcsmbs/wcstoull_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoull_l.c
new file mode 100644
index 0000000..d95a078
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcstoull_l.c
@@ -0,0 +1,30 @@
+/* Convert string representing a number to integer value, using given locale.
+   Copyright (C) 1997-2015 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.22/wcsmbs/wcswidth.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcswidth.c
new file mode 100644
index 0000000..cc15a89
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcswidth.c
@@ -0,0 +1,38 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcsxfrm.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsxfrm.c
new file mode 100644
index 0000000..c988c45
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsxfrm.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcsxfrm_l.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsxfrm_l.c
new file mode 100644
index 0000000..53ac951
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcsxfrm_l.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wctob.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wctob.c
new file mode 100644
index 0000000..035f045
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wctob.c
@@ -0,0 +1,83 @@
+/* Copyright (C) 1996-2015 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 (c)
+     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.22/wcsmbs/wcwidth.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wcwidth.c
new file mode 100644
index 0000000..a0402fa
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcwidth.c
@@ -0,0 +1,26 @@
+/* Copyright (C) 1996-2015 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.22/wcsmbs/wcwidth.h b/ap/libc/glibc/glibc-2.22/wcsmbs/wcwidth.h
new file mode 100644
index 0000000..4ce7341
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wcwidth.h
@@ -0,0 +1,39 @@
+/* Internal header containing implementation of wcwidth() function.
+   Copyright (C) 1996-2015 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.22/wcsmbs/wmemchr.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemchr.c
new file mode 100644
index 0000000..266950c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemchr.c
@@ -0,0 +1,64 @@
+/* Copyright (C) 1996-2015 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>
+
+wchar_t *
+__wmemchr (s, c, n)
+     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.22/wcsmbs/wmemcmp.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemcmp.c
new file mode 100644
index 0000000..5aa934c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemcmp.c
@@ -0,0 +1,86 @@
+/* Copyright (C) 1996-2015 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 (s1, s2, n)
+     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.22/wcsmbs/wmemcpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemcpy.c
new file mode 100644
index 0000000..0b75be7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemcpy.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 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 (s1, s2, n)
+     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.22/wcsmbs/wmemmove.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemmove.c
new file mode 100644
index 0000000..68878fa
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemmove.c
@@ -0,0 +1,31 @@
+/* Copyright (C) 1996-2015 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 (s1, s2, n)
+     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.22/wcsmbs/wmempcpy.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wmempcpy.c
new file mode 100644
index 0000000..9639c5f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wmempcpy.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1999-2015 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 (s1, s2, n)
+     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.22/wcsmbs/wmemset.c b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemset.c
new file mode 100644
index 0000000..88fc015
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.22/wcsmbs/wmemset.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 1996-2015 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>
+
+
+wchar_t *
+__wmemset (s, c, n)
+     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)
