Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

nlcollate(3X)

nlinfo(3X)

portnls(5)

nlkeycompare(3X)

NAME

nlkeycompare() − determine if a character array (key1) is almost equal to another (key2) using the MPE language-dependent collation table

SYNOPSIS

#include <portnls.h>

void nlkeycompare(

const char *key1,
short int length1,
const char *key2,
short int length2,
short int *presult,
short int langid,
unsigned short err[2],
const unsigned short *collseq

);

DESCRIPTION

nlkeycompare() determines if a character array (key1) is almost equal to another character array (key2).  Two character arrays are considered almost equal when they differ only in case or accent priorities.  For example, the arrays ABC and aBc are almost equal in English. 

nlkeycompare() determines if a given character array can be collated before or after another character array of a different length.  For example, nlkeycompare() examines the records in a file sorted in a given language and determines if the character array key1 can be found later on in the file as the leading substring of the sort key, if the value of the last record read is key2. 

Arguments to nlkeycompare() are used as follows:

key1 A byte array being compared to key2.

length1 The length in bytes of key1. length1 must be less than length2.

key2 A byte array containing a character array to which to compare key1.

length2 The length in bytes of key2. length2 must be greater than length1.

presult A pointer to a short integer variable in which to return the result of the comparison. 

0 The retrieved key2 matches the key1. 

1 The retrieved key2 does not match the key1.  It is different only in case or accent priority. 

2 The retrieved key2 is less than the key1 (its collating order is before the desired one). 

3 The retrieved key2 is greater than the key1 (it collates after the desired key). 

langid The language ID number indicating the collating sequence to be used for the compare. 

err The first element of this array contains the error number.  The second element is always zero.  If the call is successful, both elements contain zero. 

Error # Meaning

2 Specified language is not configured. 

3 Invalid collating table entry. 

4 Invalid length parameter. 

7 length1 is greater than length2.

collseq An array containing the collating sequence table as returned by nlinfo(3X)’s itemnumber 11. 

WARNINGS

This routine is provided for compatibility with MPE, a proprietary HP operating system.  See portnls(5) for more information on the use of this routine. Use the Native Language Support routines for C programmers described by hpnls(5) for HP-UX NLS support. 

AUTHOR

nlkeycompare() was developed by HP. 

SEE ALSO

nlcollate(3X), nlinfo(3X), portnls(5). 

EXTERNAL INFLUENCES

International Code Set Support

Single- and multi-byte character code sets are supported. 

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

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