Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ctype(3C)

getc(3S)

setchrclass(3C)

setlocale(3C)

ascii(5)

environ(5)

chrtbl(1M)

conv(3C)

NAME

toupper, tolower, _toupper, _tolower, toascii − translate characters

SYNOPSIS

#include <ctype.h>

int toascii (c)
int c;

int toupper (c)
int c;

int tolower (c)
int c;

SYNOPSIS (SYSV.2)

int _toupper (c)
int c;

int _tolower (c)
int c;

DESCRIPTION

Toascii yields its argument with all bits turned off that are not part of a standard ASCII character. 

In the att universe, toupper and tolower are functions, and _toupper and _tolower are macros.  In the ucb universe, toupper and tolower are macros. 

The functions and macros in the att universe 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. 

The _toupper and the _tolower macros provide results faster, but they have restricted domains.  The argument to _toupper must be a lower-case letter.  The argument to _tolower must be an upper-case letter.  Arguments outside the restricted domains produce undefined results. 

The macros in the ucb universe accomplish the same thing as the functions but they have restricted domains and are faster.  The domain for the toupper macro is the set of lower-case letters.  The domain for the tolower macro is the set of upper-case letters.  Arguments outside the domain cause undefined results. 

The tables used by these macros and functions may be loaded by setlocale(3C) or by setchrclass(3C) to correspond to a specific locale.

SEE ALSO

ctype(3C), getc(3S), setchrclass(3C), setlocale(3C), ascii(5), environ(5). 
chrtbl(1M) in the CX/UX Administrator’s Reference Manual.

CX/UX Programmer’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026