Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chrtbl(1M)

stdio(3S)

ascii(5)

environ(5)

CTYPE(3C)                            SysV                            CTYPE(3C)



NAME
     ctype: isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace,
     ispunct, isprint, isgraph, iscntrl, isascii, setchrclass - classify
     characters

SYNOPSIS
     #include <ctype.h>

     int isalpha (c)
     int c;

     . . .

     int setchrclass (chrclass)
     char *chrclass;

DESCRIPTION
     isascii is a macro, defined on all integer values.  The rest are
     functions, defined where the argument is representable as an unsigned
     char or equals EOF (see stdio(3S)).  EOF is guaranteed not to be a
     character set member.  If the argument has any other value, the behavior
     is undefined.  These functions and macros return nonzero (true) if and
     only if the value of c conforms to that in the description.

     isalpha    c is a character for which islower or isupper is true and
                possibly any others as defined by the character set.

     isupper    c is any uppercase letter as defined by the character set.

     islower    c is any lowercase letter as defined by the character set.

     isdigit    c is a digit [0-9].

     isxdigit   c is a hexadecimal digit [0-9], [A-F] or [a-f].

     isalnum    c is any character for which isalpha or isdigit is true.

     isspace    c is a space, tab, carriage return, newline, vertical tab, or
                form-feed.

     ispunct    c is any character other than the ones for which isalnum,
                iscntrl, or isspace (except space) is true.

     isprint    c is a space or any character for which isalnum or ispunct is
                true or any other "printing character" as defined by the
                character set.

     isgraph    c is any character for which isprint is true, except for
                space.

     iscntrl    c is any "control character" defined by the character set.

     isascii    c is a non-negative number less than 0200.

     setchrclass initializes the table used by these functions and macro to a
     specific character classification set.  setchrclass uses the value of its
     argument or the value of the environment variable CHRCLASS as the name of
     the data file for the desired character set.  These data files must
     reside in the directory /usr/lib/chrclass.  setchrclass is implemented in
     the bindable library /usr/lib/libc.a.

     If chrclass is (char *)0, the value of the environment variable CHRCLASS
     is used.  If CHRCLASS is not set or is undefined, the table retains its
     current value, initialized to ascii.

FILES
                                   Directory containing
                                   language-specific
     /usr/lib/chrclass             character classification
                                   tables
     /usr/lib/chrclass/ascii
     /usr/lib/chrclass/danish
     /usr/lib/chrclass/finnish
     /usr/lib/chrclass/french      Language-specific
     /usr/lib/chrclass/german      character classification
     /usr/lib/chrclass/italian     tables
     /usr/lib/chrclass/norwegian
     /usr/lib/chrclass/spanish
     /usr/lib/chrclass/swedish

     /usr/lib/libc.a               Bindable library
                                   containing setchrclass

SEE ALSO
     chrtbl(1M), stdio(3S), ascii(5), environ(5).

DIAGNOSTICS
     If the argument to any of these macros is not in the domain of the
     function, the result is undefined.

     If setchrclass does not successfully fill the table, it leaves the
     existing table unaffected and returns -1.  A successful call to
     setchrclass returns zero.

NOTES
     To be compatible with common C usage, have the functions defined as
     macros by adding the directive

          #define _CLASSIC_CTYPE_MACROS

     before any #include directives in your program.  You must add this
     directive if you want to use setchrclass.

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