HP-UX Reference (11i v1 00/12) - 3 Library Functions A-M (vol 6)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/!!!intro.3c
________________________________________________________________
___ ___
c
conv(3C) conv(3C)
NAME
toupper(), tolower(), _toupper(), _tolower(), toascii() - translate characters
SYNOPSIS
#include <ctype.h>
int toupper(int c);
int tolower(int c);
int _toupper(int c);
int _tolower(int c);
int toascii(int c);
DESCRIPTION
toupper() and tolower() have as domain the range of getc(3S): the integers from −1 through 255.
If the argument of toupper() represents a lower-case letter, the result is the corresponding upper-case
letter. If the argument of tolower() represents an upper-case letter, the result is the corresponding
lower-case letter. All other arguments in the domain are returned unchanged. Arguments outside the
domain cause undefined results.
The macros _toupper() and _tolower() are identical to toupper() and tolower(), respec-
tively.
toascii() yields its argument with all bits that are not part of a standard 7-bitASCII character cleared;
it is intended for compatibility with other systems.
APPLICATION USAGE
toupper(), tolower(), _toupper(), _tolower() and toascii() are thread-safe and async-
cancel-safe.
WARNING
toascii() is supplied both as a library function and as a macro defined in the <
ctype.h>header.
Normally, the macro version is used. To obtain the library function, either use a
#undef to remove the
macro definition or, if compiling in
ANSI C mode, enclose the function name in parenthesis or take its
address. The following examples use the library function for toascii():
#include <ctype.h>
#undef toascii
...
main()
{
...
c1 = toascii(c);
...
}
or
#include <ctype.h>
...
main()
{
int (*conv_func)();
...
c1 = (toascii)(c);
...
conv_func = toascii;
...
}
The following example use the library function for toupper() :
#include <ctype.h>
#undef toupper
...
main()
Section 3−−80 − 1 − HP-UX Release 11i: December 2000
___
___