conv(3)
NAME
toupper, tolower, _toupper, _tolower, toascii − translate characters
SYNTAX
#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
The functions toupper and tolower have as domain the range of getc. If the argument to toupper represents a lower case letter, the result is the corresponding upper case letter. If the argument to tolower represents an upper case letter, the result is the corresponding lower case letter. The shift tables for the language indentified by the last successful call to setlocale category LC_CTYPE, define whether the arguments to toupper and tolower represent upper or lower case letters. All other arguments in the domain are returned unchanged.
If setlocale category LC_CTYPE has not been called successfully, or if shift information is not available for a supported language, these functions determine the case of characters according to the rules of the ASCII coded character set.
The macros _toupper and _tolower accomplish the same thing as toupper and tolower, except they faster and restricted to ASCII characters (for example, -1 to 127). The macro _toupper requires a lowercase letter as its argument; its result is the corresponding uppercase letter. The macro _tolower requires an uppercase letter as its argument; its result is the corresponding lowercase letter. Arguments outside the domain cause undefined results.
The macro toascii yields its argument with all bits turned off that are not part of a standard ASCII character set. It is intended for compatibility with other systems.
SEE ALSO
ctype(3), setlocale(3int), getc(3s)
Subroutines