Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

string(3)

setlocale(3)

strxfrm(3)

environ(5int)

strcoll(3)

Name

strcoll − string collation comparison

Syntax

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

Description

The strcoll function returns an integer less than, equal to, or greater than zero depending on whether the string pointed to by s1 is lexicographically less than, equal to, or greater than the string pointed to by s2. 

The strcoll function performs the comparison by using the collating information defined in the program’s locale, category LC_COLLATE.

In the C locale, characters collate as if they are unsigned.  In all cases strcoll works as if strxfrm were called on s1 and s2, and strcmp was called on the resulting strings.

International Environment

LC_COLLATEContains the user requirements for language, territory, and codeset for the character collation format.  LC_COLLATE affects the behavior of regular expressions and the string collation functions in strcoll. If LC_COLLATE is not defined in the current environment, LANG provides the necessary default.

LANGIf this environment is set and valid, strcoll uses the international language database named in the definition to determine the character collation formatting rules. If LC_COLLATE is defined, its definition supercedes the definition of LANG.

See Also

string(3), setlocale(3), strxfrm(3), environ(5int)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026