PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Macros | Functions
ctype.h File Reference

Provides character class check API macros. More...

#include <sys/ctype.h>
+ Include dependency graph for ctype.h:

Go to the source code of this file.

Macros

#define __isctype(c, x)   (__ctype_get(c) & x)
 
#define isalnum(c)   __isctype(c, _CTalnum)
 
#define isalpha(c)   __isctype(c, _CTalpha)
 
#define isblank(c)   __isctype(c, _CTb)
 
#define iscntrl(c)   __isctype(c, _CTc)
 
#define isdigit(c)   __isctype(c, _CTd)
 
#define isgraph(c)   (!__isctype(c, (_CTc|_CTs)) && (__ctype_get(c) != 0))
 
#define islower(c)   __isctype(c, _CTl)
 
#define isprint(c)   (!__isctype(c, (_CTc)) && (__ctype_get(c) != 0))
 
#define ispunct(c)   __isctype(c, _CTp)
 
#define isspace(c)   __isctype(c, _CTs)
 
#define isupper(c)   __isctype(c, _CTu)
 
#define isxdigit(c)   __isctype(c, _CTx)
 

Functions

int isalnum (int c)
 
int isalpha (int c)
 
int isblank (int c)
 
int iscntrl (int c)
 
int isdigit (int c)
 
int isgraph (int c)
 
int islower (int c)
 
int isprint (int c)
 
int ispunct (int c)
 
int isspace (int c)
 
int isupper (int c)
 
int isxdigit (int c)
 
int tolower (int c)
 
int toupper (int c)
 

Detailed Description

Provides character class check API macros.

These functions check whether c, which must have the value of an unsigned char or EOF, falls into a certain character class according to the current locale.

Conforms to C99, 4.3BSD. C89 specifies all of these functions except isascii() and isblank(). isascii() is a BSD extension and is also an SVr4 extension. isblank() conforms to POSIX.1-2001 and C99 7.4.1.3. POSIX.1-2008 marks isascii() as obsolete, noting that it cannot be used portably in a localized application.

Definition in file ctype.h.

Macro Definition Documentation

◆ isalnum

#define isalnum (   c)    __isctype(c, _CTalnum)

Checks for an alphanumeric class character.

Definition at line 57 of file ctype.h.

◆ isalpha

#define isalpha (   c)    __isctype(c, _CTalpha)

Checks for an alphabetic class character.

The isalpha function tests for any character for which isupper or islower is true, or any character that is one of a locale-specific set of alphabetic characters for which none of iscntrl, isdigit, ispunct, or isspace is true.156) In the "C" locale, isalpha returns true only for the characters for which isupper or islower is true.

Definition at line 67 of file ctype.h.

◆ isblank

#define isblank (   c)    __isctype(c, _CTb)

Checks for a blank (space or tab) character.

Definition at line 71 of file ctype.h.

◆ iscntrl

#define iscntrl (   c)    __isctype(c, _CTc)

Checks for a control character.

Definition at line 75 of file ctype.h.

◆ isdigit

#define isdigit (   c)    __isctype(c, _CTd)

Checks for a digit (0 through 9) character.

Definition at line 83 of file ctype.h.

◆ isgraph

#define isgraph (   c)    (!__isctype(c, (_CTc|_CTs)) && (__ctype_get(c) != 0))

Checks for a any printable character except for space.

Definition at line 89 of file ctype.h.

◆ islower

#define islower (   c)    __isctype(c, _CTl)

Checks for a lower-case character.

The islower function tests for any character that is a lowercase letter or is one of a locale-specific set of characters for which none of iscntrl, isdigit, ispunct, or isspace is true. In the * "C" locale, islower returns true only for the characters defined as lowercase letters.

Definition at line 102 of file ctype.h.

◆ isprint

#define isprint (   c)    (!__isctype(c, (_CTc)) && (__ctype_get(c) != 0))

Checks for any printable character including space.

Definition at line 107 of file ctype.h.

◆ ispunct

#define ispunct (   c)    __isctype(c, _CTp)

Checks for any printable character that is not a space or alphanumeric character.

The ispunct function tests for any printing character that is one of a locale-specific set of punctuation characters for which neither isspace nor isalnum is true.

Definition at line 115 of file ctype.h.

◆ isspace

#define isspace (   c)    __isctype(c, _CTs)

Checks for a white space character: space, \f, \n, \r, \t, \v in "C" locales.

Definition at line 119 of file ctype.h.

◆ isupper

#define isupper (   c)    __isctype(c, _CTu)

Checks for an upper-case character.

The isupper function tests for any character that is an uppercase letter or is one of a locale-specific set of characters for which none of iscntrl, isdigit, ispunct, or isspace is true. In the "C" locale, isupper returns true only for the characters defined as uppercase letters.

Definition at line 132 of file ctype.h.

◆ isxdigit

#define isxdigit (   c)    __isctype(c, _CTx)

Checks for a hexadecimal digit: 0 through 9, a through f, or A through F.

Definition at line 137 of file ctype.h.

Function Documentation

◆ tolower()

int tolower ( int  c)

Converts an uppercase letter to a corresponding lowercase letter.

If the argument is a character for which isupper is true and there are one or more corresponding characters, as specified by the current locale, for which islower is true, the tolower function returns one of the corresponding characters (always the same one for any given locale); otherwise, the argument is returned unchanged.

Parameters
cLetter to convert.
Returns
Uppercase version of c according to locale.
+ Here is the caller graph for this function:

◆ toupper()

int toupper ( int  c)

Converts a lowercase letter to a corresponding uppercase letter.

If the argument is a character for which islower is true and there are one or more corresponding characters, as specified by the current locale, for which isupper is true, the toupper function returns one of the corresponding characters (always the same one for any given locale); otherwise, the argument is returned unchanged.

Parameters
cLetter to convert.
Returns
Lowercase version of c according to locale.
+ Here is the caller graph for this function: