libnix/sources/nix/string/strxfrm.c
2024-10-04 18:20:55 +02:00

22 lines
509 B
C

#include <string.h>
#ifndef __KICK13__
#include <libraries/locale.h>
#include <proto/locale.h>
#include <locale.h>
extern struct Locale *__localevec[];
size_t strxfrm(char *buffer, const char *s, size_t n) {
if (!__localevec[LC_COLLATE - 1]) {
strncpy(buffer, s, n);
return strlen(s);
} else
return StrConvert(__localevec[LC_COLLATE-1], (STRPTR )s, (STRPTR )buffer, n, SC_COLLATE1);
}
#else
size_t strxfrm(char *buffer, const char *s, size_t n) {
strncpy(buffer, s, n);
return strlen(s);
}
#endif