nljudge(3X)
NAME
nljudge() − judge whether a character is a one-byte or multi-byte Asian character using MPE character definition table
SYNOPSIS
#include <portnls.h>
short int nljudge(
short int langid,
const char *instr,
short int length,
char *judgeflag,
unsigned short int err[2],
const char *charset
);
DESCRIPTION
nljudge() judges whether or not a character is a one-byte or multi-byte Asian character. If it is a multi-byte character, judgeflag is set to 1 or 2. If it is a one-byte character, judgeflag is set to 0.
Any language number can be specified as the langid parameter. However, if the language specified uses only one-byte characters (see nlinfo(3X)’s itemnumber 35), the judgeflag returns all zeroes.
Arguments to nljudge() are used as follows:
langid The ID number for the desired language.
instr The character buffer to be judged.
length A short integer value specifying the number of bytes in instr.
judgeflag A pointer to a char whose value is set to:
0 One-byte character
1 First byte of a two-byte character
2 Second byte of a two-byte character
3 Invalid two-byte character
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 string length.
7 Invalid characters found in instr.
charset A character buffer containing the character set definition for the language to be used, as returned by nlinfo(3X)’s itemnumber 12. If it doesn’t point to a null address, the langid parameter is ignored, and this routine is more efficient.
RETURN VALUE
nljudge() returns the number of multi-byte Asian characters that could be used to check if a string of character contains any Asian characters.
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
nljudge() was developed by HP.
SEE ALSO
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