NL_STRING(3C) — HP-UX
NAME
strcmp8, strncmp8, strcmp16, strncmp16 − non-ASCII string collation
SYNOPSIS
int strcmp8 (s1, s2, langid, status)
unsigned char ∗s1, ∗s2;
int langid,∗status;
int strncmp8 (s1, s2, n, langid, status)
unsigned char ∗s1, ∗s2;
int n, langid, ∗status;
int strcmp16 (s1, s2, file_name, status)
unsigned char ∗s1, ∗s2, ∗file_name;
int ∗status;
int strncmp16 (s1, s2, n, file_name, status)
unsigned char ∗s1, ∗s2, ∗file_name;
int n, ∗status;
DESCRIPTION
These functions do not check for overflow of any receiving string.
Strcmp8 compares string s1 and s2 according to the collating sequence specified by langid (See langid(5)). An integer greater than, equal to, or less than 0 is returned, depending on whether s1 is, respectively, greater than, equal to, or less than s2. If langid or the collation sequence file is not installed, the native machine collating sequence is used. Trailing blanks in string s1 or s2 are ignored. Strncmp8 makes the same comparison but looks at n characters at most.
Strcmp16 compares strings s1 and s2 and returns an integer greater than, equal to, or less than 0 depending on whether s1 is, respectively, greater than, equal to, or less than s2. Strings s1 and s2 may contain 16-bit characters mixed with 7-bit and 8-bit characters (See hpnls(5)). Strings s1 and s2 are compared with 8-bit characters collating before 16-bit characters. Strncmp16 makes the same comparison but looks at n characters at most.
Langinit (See nl_tools_16(3C)) must be called before the first call to strcmp16 or strncmp16.
ERRORS
The integer pointed to by status is set to one of the following non-zero values defined in usr/include/langinfo.h if an error condition is encountered. For ENOCFFILE and ENOLFILE, errno indicates that a file system call failed.
[ENOCFFILE] access of the file /usr/lib/nls/config has failed.
[ENOCONV] the entry for the language sought is not in the file /usr/lib/nls/config.
[ENOLFILE] access of the data file /usr/lib/nls/LANG/collate8 or file_name has failed (where LANG is the language name associated with the value of langid).
WARNINGS
The current versions of strcmp16 and strncmp16 do not support a collation sequence table (a null string should be passed as file_name to maintain the correct argument count).
AUTHOR
Nl_string was developed by HP.
SEE ALSO
nl_tools_16(3C), col_seq_8(4), hpnls(5), langid(5).
Hewlett-Packard Company — Version B.1, April 12, 1993