CONV(3,L) AIX Technical Reference CONV(3,L)
-------------------------------------------------------------------------------
conv
PURPOSE
Translates characters.
LIBRARY
Standard C Library (libc.a)
SYNTAX
#include <ctype.h>
#include <NLctype.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;
wchar_t towlower (c) int NCflatchr (x)
wchar_t c; int x;
wchar_t towupper (c)
wchar_t c;
wchar_t towascii (c)
wchar_t c;
DESCRIPTION
Processed November 7, 1990 CONV(3,L) 1
CONV(3,L) AIX Technical Reference CONV(3,L)
The NCxxxxxxx subroutines translate all characters, including extended
characters, as code points (see "Introduction to 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 uppercase letter. If the parameter of the tolower
subroutine represents an uppercase letter, the result is the corresponding
lowercase letter. All other values in the domain are returned unchanged.
The _toupper and _tolower routines are macros that accomplish 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 subroutine
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 macro yields the value of its parameter with all bits that are not
part of a standard ASCII character turned off. It is intended for
compatibility with other systems.
The NCtoNLchar macro yields the value of its parameter 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.
Processed November 7, 1990 CONV(3,L) 2
CONV(3,L) AIX Technical Reference CONV(3,L)
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 macro 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).
Note: In the multibyte environment, the NCesc, NCunesc, and NCflatchr
subroutines are provided for backward compatibility and support code
page pc850 only.
If the parameter of the towupper subroutine is a wide lower case character, the
result is the corresponding upper case wide character. If the parameter of the
towlower subroutine is a wide upper case character, the result is the
corresponding lower case wide character. All other parameters passes are
returned unchanged.
RELATED INFORMATION
In this book: "ctype," "getc, fgetc, getchar, getw, getwc, fgetwc, getwchar,"
and "display symbols."
"Introduction to International Character Support" in Managing the AIX Operating
System.
AIX Guide to Multibyte Character Set (MBCS) Support.
Processed November 7, 1990 CONV(3,L) 3