DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

strxfrm(S)


strxfrm -- string transformation

Synopsis

   #include <string.h>
   

size_t strxfrm (char *s1, const char *s2, size_t n);

Description

strxfrm transforms the string s2 and places the resulting string into the array s1. The transformation is such that if strcmp is applied to two transformed strings, it returns a value greater than, equal to, or less than zero, corresponding to the result of the strcoll function applied to the same two original strings. The transformation is based on the program's locale for category LC_COLLATE [see setlocale(S)].

No more than n characters will be placed into the resulting array pointed to by s1, including the terminating null character. If n is 0, then s1 is permitted to be a null pointer. 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 s1 are indeterminate.

Files


/usr/lib/locale/locale/LC_COLLATE
LC_COLLATE database for locale.

Errors

On failure, strxfrm returns (size_t) -1.

Usage

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);

References

colltbl(ADM), environ(M), setlocale(S), strcoll(S), string(S)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005