STRXFRM(3)

NAME
strxfrm - transform a string under locale

SYNOPSIS
#include <string.h>
size_t
strxfrm(char *dst, const char *src, size_t n);
size_t
strxfrm_l(char *dst, const char *src, size_t n, locale_t locale);

DESCRIPTION
The idea of strxfrm() and strxfrm_l() is to “un-localize” a string: these functions transform according to the default locale (or the locale provided to strxfrm_l) the string src, storing the result in dst, such that strcmp(3) on transformed strings returns what strcoll(3) on the original untransformed strings would return.

n is the maximal amount of bytes that can be written to dst , however if n is 0 this function returns the amount of bytes that the transformed string would require --usefull to allocate space before calling again.

RETURN VALUE
Length of the string transformed (not counting NUL). If such lenght is grather than n the contents of dst is unspecified.

SEE ALSO
bcmp(3), memcmp(3), setlocale(3), strcasecmp(3), strcmp(3), xlocale(3), strcoll(3)

STANDARDS
The strxfrm() function conforms to ansiC.

HISTORY
The implementation is derived from FreeBSD