HP-UX Reference (11i v2 04/09) - 3 Library Functions N-Z (vol 7)
n
nl_tools_16(3X) nl_tools_16(3X)
CHARAT() Takes as an argument a pointer p, which is assumed to be pointing at either a one-
byte character or the first byte of a two-byte character. In either case,
CHARAT()
returns the wchar_t value that corresponds to the character pointed to by p.
ADVANCE() Advances its pointer argument by the byte width of the character it is pointing at
(either one or two bytes).
CHARADV() Combines the functions of CHARAT() and
ADVANCE() in a single macro. It takes
as an argument a pointer p, which is assumed to be pointing at either a one-byte
character or the first byte of a two-byte character. In either case
CHARADV()
returns the wchar_t value that corresponds to the character pointed to by p, and
advances p beyond the last byte of the character.
WCHAR() Converts the wchar_t value wc into the corresponding one or two byte character,
and writes it at the location specified by p.
WCHAR() returns the wchar_t value
wc.
WCHARADV() Combines the functions of WCHAR() and ADVANCE()
in a single macro. It con-
verts the
wchar_t value wc into the corresponding one or two byte character, and
writes it at the location specified by p, then advances p past the last byte.
WCHARADV() returns the wchar_t value wc.
firstof2()
secof2()
byte_status()
c_colwidth() Subroutine versions of the corresponding macros. These functions can be called
from languages other than C.
EXTERNAL INFLUENCES
Locale
The
LC_CTYPE category determines the interpretation of single and/or multibyte characters.
WARNINGS
The HP proprietary functions and macros described in this manual entry are OBSOLETE. They are not
portable to other vendor’s systems, and will not be provided in future HP-UX releases.
For maximum portability, use the routines documented in the multibyte (3C) manual entry for multibyte
character processing.
Other macros listed in this manual entry cannot be used as the first argument to
WCHAR()
or
WCHARADV(). For example,
*t++ = *f++
cannot be replaced by
WCHARADV(CHARADV (f),t)
Instead, use a method such as
int c; ... c = CHARADV (f), WCHARADV (c,t)
WCHAR() and WCHARADV() may produce a "null effect" warning from lint(1) if not used as part of
another expression or as part of a statement. This does not affect the functionality of either macro.
Note that
WCHAR() and WCHARADV() are not "replace_char" macros. They do not prevent the second
byte of a two-byte character from being left dangling if WCHAR() or WCHARADV() overwrite the first
byte of the two-byte character with a single-byte character.
CHARAT(), ADVANCE(), and CHARADV() do not examine the byte following the location pointed to by
the argument to verify its validity as a SECof2 byte.
AUTHOR
nl_tools_16() was developed by HP.
SEE ALSO
setlocale(3C), multibyte(3C), wconv(3C), wctype(3C).
Section 3−−688 Hewlett-Packard Company − 2 − HP-UX 11i Version 2: September 2004