CONV(3C) SysV CONV(3C)
NAME
conv: toupper, tolower, _toupper, _tolower, toascii - translate
characters
SYNOPSIS
#include <ctype.h>
int toupper (c)
int c;
int tolower (c)
int c;
int _toupper (c)
int c;
int _tolower (c)
int c;
int toascii (c)
int c;
DESCRIPTION
These functions and macros convert their arguments from lowercase
(uppercase) to uppercase (lowercase).
If c is a character for which islower (see ctype(3C)) is true, toupper
returns the corresponding uppercase character, if it exists. Otherwise,
toupper returns c. If c is a character for which isupper (see ctype(3C))
is true, tolower returns the corresponding lowercase character, if it
exists. Otherwise, tolower returns c.
Character conversions are performed according to the rules defined by
character type information in a program's locale (category LC_CTYPE).
The macros _toupper and _tolower are not part of interfaces defined in
ANSI X3.159, but are part of XPG/3 (1988). These macros accomplish the
same thing as toupper and tolower, but have restricted domains and are
faster. If c is outside their domain, _toupper and _tolower return
undefined values.
toascii converts its argument into a 7-bit ASCII character. In the C
locale, or in a locale where case conversion information is not defined,
this function determines the case of characters according to the rules of
the ASCII-coded character set. Characters outside the ASCII range of
characters are returned unchanged.
The conversion functions and macros do a table lookup. This table gets
initialized in ways depending upon whether or not a call to setlocale
(3C) has been made.
DIAGNOSTICS
If the argument is a character for which isupper(3c) is true and there is
a corresponding character for which islower(3c) is true, the toupper or
tolower functions return the corresponding character. Otherwise, the
argument is returned unchanged.
The toascii function returns the value (c & 0x7f).
No errors are defined for _toupper or _tolower.
SEE ALSO
ctype(3C), ascii(5), setlocale(3C), <ctype.h>, <stdio.h> <ctype.h>
environ(5).