up | Inhaltsverzeichniss | Kommentar

Manual page for STRCOLL(3)

strcoll, strxfrm - compare or transform strings using collating information

SYNOPSIS

#include <string.h>

int strcoll(s1, s2)
char *s1;
char *s2;

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

DESCRIPTION

strcoll() compares the string pointed to by s1 to the string pointed to by s2. These strings are interpreted as appropriate to the LC_COLLATE category of the current locale.

strxfrm() transforms the string pointed to by s2 and places the resulting string into the array pointed to by s1. The transformation is such that if string() 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. No more than n characters are placed into the resulting array pointed to by s1, including the terminating null character. If n is zero, s1 is permitted to be a null pointer. If copying takes place between objects that overlap, the behavior is undefined.

RETURN VALUES

On success, strcoll() returns an integer greater than, equal to or less than zero, respectively, if the string pointed to by s1 is greater than, equal to or less than the string pointed to by s2 when both are interpreted as appropriate to the current locale. On failure, strcoll() sets errno to indicate the error, but returns no special value.

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 pointed to by s1 are indeterminate. On failure, strxfrm() returns (size_t)-1, and sets errno to indicate the error.

ERRORS

EINVAL
s1 or s2 contain characters outside the domain of the collating sequence.

SEE ALSO

string.3


index | Inhaltsverzeichniss | Kommentar

Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97