#include <string.h>
+#include <locale.h>
+#include "libc.h"
/* collate only by code points */
-size_t strxfrm(char *restrict dest, const char *restrict src, size_t n)
+size_t __strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t loc)
{
size_t l = strlen(src);
if (n > l) strcpy(dest, src);
return l;
}
+
+size_t strxfrm(char *restrict dest, const char *restrict src, size_t n)
+{
+ return __strxfrm_l(dest, src, n, LC_GLOBAL_LOCALE);
+}
+
+weak_alias(__strxfrm_l, strxfrm_l);
+++ /dev/null
-#include <string.h>
-
-size_t strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t l)
-{
- return strxfrm(dest, src, n);
-}
#include <wchar.h>
+#include <locale.h>
+#include "libc.h"
/* collate only by code points */
-size_t wcsxfrm(wchar_t *restrict dest, const wchar_t *restrict src, size_t n)
+size_t __wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t loc)
{
size_t l = wcslen(src);
if (l >= n) {
} else wcscpy(dest, src);
return l;
}
+
+size_t wcsxfrm(wchar_t *restrict dest, const wchar_t *restrict src, size_t n)
+{
+ return __wcsxfrm_l(dest, src, n, LC_GLOBAL_LOCALE);
+}
+
+weak_alias(__wcsxfrm_l, wcsxfrm_l);
+++ /dev/null
-#include <wchar.h>
-
-size_t wcsxfrm_l(wchar_t *restrict dest, const wchar_t *restrict src, size_t n, locale_t locale)
-{
- return wcsxfrm(dest, src, n);
-}