mirror of
https://github.com/LIV2/libnix.git
synced 2025-12-06 00:23:08 +00:00
22 lines
509 B
C
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
|