conv(3) CLIX conv(3)
NAME
conv: toupper, tolower, _toupper, _tolower, toascii - Translate
characters.
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <ctype.h>
int toupper(
int c );
int tolower(
int c );
int _toupper(
int c );
int _tolower(
int c );
int toascii(
int c );
PARAMETERS
c An integer representing a character.
DESCRIPTION
The toupper() and tolower() functions have as domain the range of getc():
the integers from -1 through 255. If the argument of toupper() represents
a lowercase letter, the result is the corresponding uppercase letter. If
the argument of tolower() represents an uppercase letter, the result is
the corresponding lowercase letter. All other arguments in the domain are
returned unchanged.
The _toupper() and the _tolower() macros accomplish the same thing as the
toupper() and tolower() functions but have restricted domains and are
faster. The _toupper() function 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 toascii() function yields its argument with all bits OFF that are not
part of a standard character; it is intended for compatibility with other
2/94 - Intergraph Corporation 1
conv(3) CLIX conv(3)
systems.
EXAMPLES
To convert an entire string to uppercase letters, one character at a time:
foo(string)
char *string;
{
while (*string){
*string = (char) toupper((int)*string);
string ++;
}
}
RETURN VALUES
The tolower() and _tolower() functions return the lowercase letter
corresponding to their argument. The toupper() and _toupper() functions
return the uppercase letter corresponding to their argument.
RELATED INFORMATION
Functions: ctype(3), getc(3)
2 Intergraph Corporation - 2/94