Manual page for strxfrm(3C)
strxfrm - string transformation
SYNOPSIS
#include <string.h>
size_t strxfrm(char *dst,
const char *src,
size_t n);
MT-LEVEL
Safe with exceptions
DESCRIPTION
strxfrm()
transforms the string src and places the resulting
string into the array dst. If
strcmp()
is applied to two transformed strings, it will
return the same result as
strcoll()
applied to the same two
original strings. The transformation is based on the program's locale
for category
LC_COLLATE
(see
setlocale.3c
No more than n bytes will be placed into the resulting
array pointed to by dst, including the terminating
null character.
If n is 0 and dst is a
NULL
parameter,
strxfrm()
returns the number of bytes required for the transformed string.
If copying takes place between objects that overlap,
the behavior is undefined.
strxfrm()
returns the length of the transformed string (not including
the terminating null character). If the value returned is n or
more, the contents of the array dst are indeterminate.
RETURN VALUES
On failure,
strxfrm()
returns (size_t)-1.
EXAMPLES
The value of the following expression is the size of the array needed to hold
the transformation of the string pointed to by s.
-
1 + strxfrm(NULL, s, 0);
FILES
- /usr/lib/locale/locale/LC_COLLATE
-
LC_COLLATE
database for locale
SEE ALSO
colltbl.1m
setlocale.3c
strcoll.3c
string.3c
wscoll.3i
environ.5
NOTES
strxfrm
can be used safely in a multi-thread application, as long as
setlocale.3c
is not being called to change the locale.
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97