HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)

n
nl_tools_16(3X) nl_tools_16(3X)
NAME
nl_tools_16: ADVANCE(), byte_status(), BYTE_STATUS(), CHARADV(), CHARAT(), c_colwidth(),
C_COLWIDTH(), firstof2(), FIRSTof2(), secof2(), SECof2(), WCHAR(), WCHARADV() - tools to process
16-bit characters (OBSOLETED AT 10.30)
SYNOPSIS
#include <nl_ctype.h>
int firstof2(int c);
int secof2(int c);
int byte_status(int c, int laststatus);
int c_colwidth(int c);
int FIRSTof2(int c);
int SECof2(int c);
int BYTE_STATUS(int c, int laststatus);
int C_COLWIDTH(int c);
int CHARAT(const char *p);
int ADVANCE(const char *p);
int CHARADV(const char *p);
int WCHAR(wchar_t wc, char *p);
int WCHARADV(wchar_t wc, char *p);
void PCHAR(int c, char *p);
void PCHARADV(int c, char *p);
Remarks
All interfaces listed above whose names begin with a capital letter are implemented as macros; the others
are functions.
These macros and functions are obsolete. See WARNINGS.
DESCRIPTION
The following macros and functions perform their operations based upon the loaded NLS environment
(see setlocale (3C)).
FIRSTof2() Takes a byte and returns a nonzero value if it can be the first byte of a two-byte
character according to the NLS environment loaded, and zero if it cannot.
SECof2() Takes a byte and returns a nonzero value if it can be the second byte of a two-byte
character according to the loaded NLS environment, and zero if it cannot.
BYTE_STATUS() Returns one of the following values based on the value of the current byte in c and
the status of the previous byte interpreted in laststatus as returned by the last call
to BYTE_STATUS(). These are the status values as defined in <nl_ctype.h>:
ONEBYTE Single-byte character
SECOF2 Second byte of two-byte character
FIRSTOF2 First byte of two-byte character
To validate a two-byte character, both the first and second bytes must be valid. If
the value of laststatus is
FIRSTOF2 but SECof2(c) returns false,
BYTE_STATUS(c, laststatus ) returns ONEBYTE.
C_COLWIDTH() Takes a byte which is assumed to be either a one-byte character or the first byte of a
two-byte character, and returns the number of columns the character would occupy
on a terminal display.
For the macros
BYTE_STATUS(), C_COLWIDTH(), FIRSTof2(), and
SEC0of2(), results are undefined for values of c less than 1 (EOF) or greater
than 255.
HP-UX 11i Version 2: September 2004 1 Hewlett-Packard Company Section 3687