


CTYPE(3V)              C LIBRARY FUNCTIONS              CTYPE(3V)



NAME
     ctype, conv, isalpha, isupper, islower,  isdigit,  isxdigit,
     isalnum,   isspace,   ispunct,  isprint,  iscntrl,  isascii,
     isgraph, toupper, tolower, toascii -  character  classifica-
     tion and conversion macros and functions

SYNOPSIS
     #include <ctype.h>

     isalpha(c)

     ...

DESCRIPTION
  Character Classification Macros
     These macros classify character-coded integer values accord-
     ing  to  the rules of the coded character set defined by the
     character type information in the program's locale (category
     LC_CTYPE).   On  program  startup  the  LC_CTYPE category of
     locale is equivalent to the "C" locale.

     In the "C" locale, or in a locale where the  character  type
     information   is  not  defined,  characters  are  classified
     according to the rules of the US-ASCII 7-bit coded character
     set.   The  control  characters are those below 040 (and the
     single byte 0177) (DEL).  See ascii(7).

     In all cases that argument is an int,  the  value  of  which
     must  be representable as an unsigned char or must equal the
     value of the macro EOF. If the argument has any other value,
     the behavior is undefined.

     Each is a predicate returning nonzero  for  true,  zero  for
     false.  isascii() is defined on all integer values.

     isalpha(_c)          _c is a letter.

     isupper(_c)          _c is an upper case letter.

     islower(_c)          _c is a lower case letter.

     isdigit(_c)          _c is a digit [0-9].

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

     isalnum(_c)          _c is an alphanumeric character, that is,
                         _c is a letter or a digit.

     isspace(_c)          _c is  a  SPACE,  TAB,  RETURN,  NEWLINE,
                         FORMFEED, or vertical tab character.




Sun Release 4.1   Last change: 11 January 1990                  1






CTYPE(3V)              C LIBRARY FUNCTIONS              CTYPE(3V)



     ispunct(_c)          _c is a  punctuation  character  (neither
                         control nor alphanumeric).

     isprint(_c)          _c is a printing character.

     iscntrl(_c)          _c is a delete character or ordinary con-
                         trol character.

     isascii(_c)          _c is an ASCII character, code less  than
                         0200.

     isgraph(_c)          _c is a visible graphic character.

  Character Conversion Macros
     toascii(_c)
          Masks _c with the correct value so that _c is  guaranteed
          to  be  an ASCII character in the range 0 through 0x7f.
          Will not perform mapping from a non-ASCII coded charac-
          ter set into ASCII.

  Character Conversion Functions
     These functions perform simple conversions on single charac-
     ters.  They replace the previous macro definitions which did
     not extend to  support  variant  settings  of  the  LC_CTYPE
     locale category.

     toupper(_c)          Converts _c to its upper-case equivalent.
                         This  function  works  correctly for all
                         coded character sets and all  characters
                         within  such  sets  selected  by a valid
                         setting of the LC_CTYPE locale category.

     tolower(_c)          Converts _c to its lower-case equivalent.
                         This  function  works  correctly for all
                         coded character sets and all  characters
                         within  such  sets  selected  by a valid
                         setting of the LC_CTYPE locale category.

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

SYSTEM V DESCRIPTION
  Character Conversion Macros
     The macros _toupper() and _tolower()  are  faster  than  the
     equivalent functions (toupper() and tolower()) but only work
     properly on a restricted range of characters, and  will  not
     work  on  a  LC_CTYPE  category  other  than the default "C"
     (ASCII).

     These macros perform simple conversions  on  single  charac-
     ters.




Sun Release 4.1   Last change: 11 January 1990                  2






CTYPE(3V)              C LIBRARY FUNCTIONS              CTYPE(3V)



     _toupper(_c)         converts _c to its upper-case equivalent.
                         Note:  This  _o_n_l_y works where _c is known
                         to be a lower-case  character  to  start
                         with     (presumably    checked    using
                         islower()).

     _tolower(_c)         converts _c to its lower-case equivalent.
                         Note:  This  _o_n_l_y works where _c is known
                         to be a upper-case  character  to  start
                         with     (presumably    checked    using
                         isupper()).

SEE ALSO
     setlocale(3V), ascii(7), iso_8859_1(7)









































Sun Release 4.1   Last change: 11 January 1990                  3



