diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/locale/strxfrm.c | 11 | ||||
-rw-r--r-- | src/locale/strxfrm_l.c | 6 | ||||
-rw-r--r-- | src/locale/wcsxfrm.c | 11 | ||||
-rw-r--r-- | src/locale/wcsxfrm_l.c | 6 |
4 files changed, 20 insertions, 14 deletions
diff --git a/src/locale/strxfrm.c b/src/locale/strxfrm.c index d40be9e1..0ca9b071 100644 --- a/src/locale/strxfrm.c +++ b/src/locale/strxfrm.c @@ -1,9 +1,18 @@ #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); diff --git a/src/locale/strxfrm_l.c b/src/locale/strxfrm_l.c deleted file mode 100644 index 81a7badf..00000000 --- a/src/locale/strxfrm_l.c +++ /dev/null @@ -1,6 +0,0 @@ -#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); -} diff --git a/src/locale/wcsxfrm.c b/src/locale/wcsxfrm.c index bfa01b5b..f977f9e1 100644 --- a/src/locale/wcsxfrm.c +++ b/src/locale/wcsxfrm.c @@ -1,7 +1,9 @@ #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) { @@ -10,3 +12,10 @@ size_t wcsxfrm(wchar_t *restrict dest, const wchar_t *restrict src, size_t 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); diff --git a/src/locale/wcsxfrm_l.c b/src/locale/wcsxfrm_l.c deleted file mode 100644 index 66a00193..00000000 --- a/src/locale/wcsxfrm_l.c +++ /dev/null @@ -1,6 +0,0 @@ -#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); -} |