nl_string(3C)
NAME
strcmp8(), strncmp8(), strcmp16(), strncmp16() − non-ASCII string collation
SYNOPSIS
#include <nl_types.h>
int strcmp8(
const unsigned char *s1,
const unsigned char *s2,
int langid,
int *status
);
int strncmp8(
const unsigned char *s1,
const unsigned char *s2,
size_t n,
int langid,
int *status
);
int strcmp16(
const unsigned char *s1,
const unsigned char *s2,
const unsigned char *file_name,
int *status
);
int strncmp16(
const unsigned char *s1,
const unsigned char *s2,
size_t n,
const unsigned char *file_name,
int *status
);
DESCRIPTION
strcmp8() Compares string s1 and s2 according to the collating sequence of the NLS environment specified by langid (see lang(5)). If langid is invalid, or if the NLS environment corresponding to langid is unavailable, n-computer, the default NLS environment associated with langinit() is used (see nl_init(3C)). 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. Trailing blanks in strings s1 and s2 are ignored.
strncmp8() Same as strcmp8(), but looks at a maximum of n characters.
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 can 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() Same as strcmp16(), but looks at a maximum of n characters.
nl_init() must be called before the first call to strcmp16() or strncmp16() (see nl_init(3C)).
ERRORS
If an error condition is encountered, the integer pointed to by status is set to one of the non-zero values (listed below) defined in <langinfo.h>. For ENOCFFILE and ENOLFILE, errno indicates that a file system call failed.
[ENOCFFILE] Attempt to access 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 to the NLS environment corresponding to langid or file_name has failed.
WARNINGS
These routines are provided for historical reasons only. Use strcoll() instead (see string(3C)). However, note that all characters are significant to strcoll(), whereas strcmp8() and strncmp8() ignore trailing blanks.
strcmp16() and strncmp16() do not support a collation sequence table. (A null string must be passed as file_name to maintain the correct argument count.)
strcmp8() and strncmp8() call langinit() (see nl_init(3C)) to load the NLS environment according to the language specified by langid.
AUTHOR
nl_string() was developed by HP.
SEE ALSO
nl_init(3C), string(3C), hpnls(5), lang(5).
EXTERNAL INFLUENCES
Locale
The LC_CTYPE category determines the interpretation of the bytes within the string arguments to strcmp8(), strncmp8(), strcmp16() , and strncmp16() as single- and/or multi-byte characters.
The LC_COLLATE category determines the collation ordering used by the strcmp8() and strncmp8(). See hpnls(5) for a description of supported collation features. See nlsinfo(1) to view the collation used for a particular locale.
International Code Set Support
Single- and multi-byte character code sets are supported.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992