Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

nl_init(3C)

hpnls(5)

langid(5)

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

Strcmp8 compares string s1 and s2 according to the collating sequence of the NLS environment specified by langid (see langid(5)). If langid is invalid, or if the NLS environment corresponding to langid is unavailable, the default NLS environment, "n-computer", is used (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. Trailing blanks in strings s1 and s2 are ignored.  Strncmp8 makes the same comparison 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 makes the same comparison, but looks at a maximum of n characters. 

Nl_init (see nl_init(3C)) must be called before the first call to strcmp16 or strncmp16.

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] 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/environment or file_name has failed. (LANG is the language name associated with the value of langid.) 

WARNINGS

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

These routines are provided for historical reasons only.  Use of the routines nl_strcmp and nl_strncmp is recommended (see string(3C)). However, note that all characters are significant to nl_strcmp and nl_strncmp, whereas strcmp8 and strncmp8 ignore trailing blanks. 

Strcmp8 and strncmp8 call langinit (see nl_init(3C)) to load the NLS environment according to the language specified by langid.

DEPENDENCIES

Series 300 ,500
Langinit (see nl_init(3C)) must be called before the first call to strcmp16 or strncmp16.

Because nl_strcmp and nl_strncmp on string(3C) are not supported, continue to use these routines.

AUTHOR

Nl_string was developed by HP. 

SEE ALSO

nl_init(3C), hpnls(5), langid(5). 

Hewlett-Packard Company  —  Version B.1,  May 11, 2021

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