conv
Purpose
Translates characters.
Library
Standard C Library (libc.a)
Syntax
#include <ctype.h>
int toupper (c) int NCtoupper (x)
int c; int x;
int tolower (c) int NCtolower (x)
int c; int x;
int _toupper (c) int _NCtoupper (x)
int c; int x;
int _tolower (c) int _NCtolower (x)
int c; int x;
int toascii (c) int NCtoNLchar (x)
int c; int x;
int NCesc (xp, cp) int NCunesc (cp, xp)
NLchar *xp; char *cp;
char *cp; NLchar *xp;
int NCflatchr (x)
int x;
Description
The NCxxxxxxx subroutines translate all characters,
including extended characters, as code points (see "Over-
view of International Character Support" in Managing the
AIX Operating System). The other subroutines translate
traditional ASCII characters only.
The toupper and the tolower subroutines have as domain
the range of the getc subroutine: from -1 through 255.
If the parameter of the toupper subroutine represents a
lowercase letter, the result is the corresponding upper-
case letter. If the parameter of the tolower subroutine
represents an uppercase letter, the result is the corre-
sponding lowercase letter. All other values in the
domain are returned unchanged.
The _toupper and _tolower routines are macros that accom-
plish the same thing as toupper and tolower, but they
have restricted domains and they are faster. _toupper
requires a lowercase letter as its parameter; its result
is the corresponding uppercase letter. _tolower requires
an uppercase letter as its parameter; its result is the
corresponding lowercase letter. Values outside the
domain cause undefined results.
The value of x is in the domain of any legal NLchar in a
value range from 0 to NLCHARMAX inclusive, or a special
value of -1 (which represents EOF).
If the parameter of the NCtoupper subroutine represents a
lowercase letter according to the current collating
sequence configuration, the result is the corresponding
uppercase letter. If the parameter of the NLtolower sub-
routine represents an uppercase letter according to the
current collating sequence configuration, the result is
the corresponding lowercase letter. All other values in
the domain are returned unchanged.
The _NCtoupper and _NCtolower routines are macros that
accomplish the same thing as NCtoupper and NCtolower, but
have restricted domains and are faster. _NCtoupper
requires a lowercase letter as its parameter; its result
is the corresponding uppercase letter. _NCtolower
requires an uppercase letter as its parameter; its result
is the corresponding lowercase letter. Values outside
the domain cause undefined results.
The toascii subroutine yields the value of its parameter
with all bits that are not part of a standard ASCII char-
acter turned off. It is intended for compatibility with
other systems.
The NCtoNLchar subroutine yields the value of its param-
eter with all bits turned off that are not part of an
NLchar.
The NCesc macro converts the NLchar value xp into one or
more ASCII bytes stored in the character array pointed to
by cp. If the NLchar represents an extended character,
it is converted into a printable ASCII escape sequence
that uniquely identifies the extended character. NCesc
returns the number of bytes it wrote. See "display
symbols" for a list that shows the escape sequence for
each character.
The inverse conversion is performed by the NCunesc macro,
translating an ordinary ASCII byte or escape sequence
starting at cp into a single NLchar at xp. NCunesc
returns the number of bytes it read.
The NCflatchr subroutine converts its parameter value
into the single ASCII byte that most closely resembles
the parameter character in appearance. If no ASCII
equivalent exists, it converts the parameter value to a
"?" (question mark).
Related Information
In this book: "ctype," "getc, fgetc, getchar, getw,"
and "display symbols."
"Overview of International Character Support" in Managing
the AIX Operating System.