Embedded Artistry Framework
Embedded Systems C++ Framework
Macros | Functions
ctype.h File Reference
This graph shows which files directly or indirectly include this file:

Macros

#define _CTYPE_A   0x00000100L /* Alpha */
 
#define _CTYPE_C   0x00000200L /* Control */
 
#define _CTYPE_D   0x00000400L /* Digit */
 
#define _CTYPE_G   0x00000800L /* Graph */
 
#define _CTYPE_L   0x00001000L /* Lower */
 
#define _CTYPE_P   0x00002000L /* Punct */
 
#define _CTYPE_S   0x00004000L /* Space */
 
#define _CTYPE_U   0x00008000L /* Upper */
 
#define _CTYPE_X   0x00010000L /* X digit */
 
#define _CTYPE_B   0x00020000L /* Blank */
 
#define _CTYPE_R   0x00040000L /* Print */
 
#define _CTYPE_I   0x00080000L /* Ideogram */
 
#define _CTYPE_T   0x00100000L /* Special */
 
#define _CTYPE_Q   0x00200000L /* Phonogram */
 
#define _CTYPE_SW0   0x20000000L /* 0 width character */
 
#define _CTYPE_SW1   0x40000000L /* 1 width character */
 
#define _CTYPE_SW2   0x80000000L /* 2 width character */
 
#define _CTYPE_SW3   0xc0000000L /* 3 width character */
 
#define _CTYPE_SWM   0xe0000000L /* Mask for screen width data */
 
#define _CTYPE_SWS   30 /* Bits to shift to get width */
 

Functions

int isalnum (int ch)
 Checks if the given character is an alphanumeric character. More...
 
int isalpha (int ch)
 Checks if the given character is an alphabetic character. More...
 
int isascii (int ch)
 Checks if a given character is a 7-bit US-ASCII character. More...
 
int isblank (int ch)
 Checks if the given character is a blank character. More...
 
int iscntrl (int ch)
 Checks if the given character is a control character. More...
 
int isdigit (int ch)
 Checks if the given character is a numeric character. More...
 
int isgraph (int ch)
 Checks if the given character has a graphical representation. More...
 
int islower (int ch)
 Checks if the given character is classified as a lowercase character. More...
 
int isprint (int ch)
 Checks if the given character can be printed. More...
 
int ispunct (int ch)
 Checks if the given character is a punctuation character. More...
 
int isspace (int ch)
 Checks if the given character is a whitespace character. More...
 
int isupper (int ch)
 Checks if the given character is an uppercase character. More...
 
int isxdigit (int ch)
 Checks if the given character is a hexadecimal numeric character. More...
 
int tolower (int ch)
 Converts the given character to lowercase. More...
 
int toupper (int ch)
 Converts the given character to lowercase. More...
 
int toascii (int ch)
 Converts the given character to ASCII. More...
 

Macro Definition Documentation

◆ _CTYPE_A

#define _CTYPE_A   0x00000100L /* Alpha */

◆ _CTYPE_B

#define _CTYPE_B   0x00020000L /* Blank */

◆ _CTYPE_C

#define _CTYPE_C   0x00000200L /* Control */

◆ _CTYPE_D

#define _CTYPE_D   0x00000400L /* Digit */

◆ _CTYPE_G

#define _CTYPE_G   0x00000800L /* Graph */

◆ _CTYPE_I

#define _CTYPE_I   0x00080000L /* Ideogram */

◆ _CTYPE_L

#define _CTYPE_L   0x00001000L /* Lower */

◆ _CTYPE_P

#define _CTYPE_P   0x00002000L /* Punct */

◆ _CTYPE_Q

#define _CTYPE_Q   0x00200000L /* Phonogram */

◆ _CTYPE_R

#define _CTYPE_R   0x00040000L /* Print */

◆ _CTYPE_S

#define _CTYPE_S   0x00004000L /* Space */

◆ _CTYPE_SW0

#define _CTYPE_SW0   0x20000000L /* 0 width character */

◆ _CTYPE_SW1

#define _CTYPE_SW1   0x40000000L /* 1 width character */

◆ _CTYPE_SW2

#define _CTYPE_SW2   0x80000000L /* 2 width character */

◆ _CTYPE_SW3

#define _CTYPE_SW3   0xc0000000L /* 3 width character */

◆ _CTYPE_SWM

#define _CTYPE_SWM   0xe0000000L /* Mask for screen width data */

◆ _CTYPE_SWS

#define _CTYPE_SWS   30 /* Bits to shift to get width */

◆ _CTYPE_T

#define _CTYPE_T   0x00100000L /* Special */

◆ _CTYPE_U

#define _CTYPE_U   0x00008000L /* Upper */

◆ _CTYPE_X

#define _CTYPE_X   0x00010000L /* X digit */

Function Documentation

◆ isalnum()

int isalnum ( int  ch)

Checks if the given character is an alphanumeric character.

Checks if the given character is an alphanumeric character using the default locale. The following characters are alphanumeric:

  • digits (0123456789)
  • uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)
  • lowercase letters (abcdefghijklmnopqrstuvwxyz)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is an alphanumeric character, 0 otherwise.

References isalpha(), and isdigit().

Referenced by bad_input(), good_input(), and ispunct().

Here is the caller graph for this function:

◆ isalpha()

int isalpha ( int  ch)

Checks if the given character is an alphabetic character.

Checks if the given character is an alphabetic character, i.e. either an uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ), or a lowercase letter (abcdefghijklmnopqrstuvwxyz)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is an alphabetic character, zero otherwise.

Referenced by bad_input(), good_input(), isalnum(), strtol(), strtoll(), and strtoul().

Here is the caller graph for this function:

◆ isascii()

int isascii ( int  ch)

Checks if a given character is a 7-bit US-ASCII character.

Checks if a given character 7-bit unsigned char value that fits into the ASCII character set. which is any character between 0 and 0x7f inclusive.

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if ch is a 7-bit US-ASCII character code, zero otherwise.

Referenced by bad_input(), and good_input().

Here is the caller graph for this function:

◆ isblank()

int isblank ( int  ch)

Checks if the given character is a blank character.

Checks if the given character is a blank character using the default locale. The following characters classified as blank:

  • space (0x20)
  • horizontal tab (0x09)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is a blank character, zero otherwise.

Referenced by bad_input(), good_input(), and iswblank().

Here is the caller graph for this function:

◆ iscntrl()

int iscntrl ( int  ch)

Checks if the given character is a control character.

Checks if the given character is a control character. The following are examples of control character:

  • codes (0x00-0x1F) and (0x7F)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is a control character, zero otherwise.

Referenced by bad_input(), and good_input().

Here is the caller graph for this function:

◆ isdigit()

int isdigit ( int  ch)

Checks if the given character is a numeric character.

Checks if the given character is a numeric character (0123456789).

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is a numeric character, zero otherwise.

Referenced by atoi(), atol(), atoll(), bad_input(), good_input(), isalnum(), isxdigit(), strtol(), strtoll(), and strtoul().

Here is the caller graph for this function:

◆ isgraph()

int isgraph ( int  ch)

Checks if the given character has a graphical representation.

Checks if the given character has a graphical representation using the default locale. The following characters are graphical:

  • number (0123456789)
  • uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ)
  • letter (abcdefghijklmnopqrstuvwxyz)
  • punctuation character (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character has a graphical representation character, zero otherwise.

Referenced by bad_input(), good_input(), and ispunct().

Here is the caller graph for this function:

◆ islower()

int islower ( int  ch)

Checks if the given character is classified as a lowercase character.

Checks if the given character is classified as a lowercase character using the default local. islower returns true only for the lowercase letters (abcdefghijklmnopqrstuvwxyz). If islower returns true, it is guaranteed that

See also
iscntrl,
isdigit,
ispunct,
isspace will return false for the same character in the same default locale.

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is a lowercase letter, zero otherwise.

Referenced by bad_input(), good_input(), and toupper().

Here is the caller graph for this function:

◆ isprint()

int isprint ( int  ch)

Checks if the given character can be printed.

Checks if the given character can be printed using the default locale. The following characters are printable:

  • number (0123456789)
  • uppercase letter (ABCDEFGHIJKLMNOPQRSTUVWXYZ)
  • letter (abcdefghijklmnopqrstuvwxyz)
  • punctuation character (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~)
  • space (0x20)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character can be printed, zero otherwise.

Referenced by bad_input(), and good_input().

Here is the caller graph for this function:

◆ ispunct()

int ispunct ( int  ch)

Checks if the given character is a punctuation character.

Checks if the given character is a punctuation character using the default local. The following characters are classified as punctuation character:

  • (!"#$%&'()*+,-./:;<=>?@[]^_`{|}~)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is a punctuation character, zero otherwise.

References isalnum(), and isgraph().

Referenced by bad_input(), and good_input().

Here is the caller graph for this function:

◆ isspace()

int isspace ( int  ch)

Checks if the given character is a whitespace character.

Checks if the given character is a whitespace character. The following are examples of a whitespace character:

  • space (0x20)
  • feed (0x0c)
  • line feed (0x0a)
  • carriage return (0x0d)
  • horizontal tab (0x09)
  • vertical tab (0x0b)

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is a whitespace character, zero otherwise.

Referenced by atol(), atoll(), bad_input(), good_input(), strtol(), strtoll(), strtoul(), and strtoull().

Here is the caller graph for this function:

◆ isupper()

int isupper ( int  ch)

Checks if the given character is an uppercase character.

Checks if the given character is an uppercase character using the default local. isupper returns true only for the uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ). If isupper returns true, it is guaranteed that

See also
iscntrl,
isdigit,
ispunct,
isspace will return false for the same character in the same default locale.

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is an uppercase letter, zero otherwise.

Referenced by bad_input(), good_input(), strtol(), strtoll(), strtoul(), and tolower().

Here is the caller graph for this function:

◆ isxdigit()

int isxdigit ( int  ch)

Checks if the given character is a hexadecimal numeric character.

Checks if the given character is a hexadecimal numeric character (0123456789).

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chThe character to classify
Returns
Non-zero value if the character is an hexadecimal numeric character, zero otherwise.

References isdigit().

Referenced by __scan_nan(), bad_input(), and good_input().

Here is the caller graph for this function:

◆ toascii()

int toascii ( int  ch)

Converts the given character to ASCII.

Converts the given character to a 7-bit unsigned char value that fits into the ASCII character set.

Parameters
chcharacter to be converted.
Returns
The value returned is that of the converted letter, or ch if the conversion was not possible.

Referenced by bad_input(), and good_input().

Here is the caller graph for this function:

◆ tolower()

int tolower ( int  ch)

Converts the given character to lowercase.

Converts the given character to lowercase according to the character conversion rules defined by the default local, i.e. the following uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ) are replaced with respective lowercase letters (abcdefghijklmnopqrstuvwxyz).

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chcharacter to be converted.
Returns
Lowercase version of ch or unmodified ch if no lowercase version is listed in the default locale.

References isupper().

Referenced by bad_input(), good_input(), and towlower().

Here is the caller graph for this function:

◆ toupper()

int toupper ( int  ch)

Converts the given character to lowercase.

Converts the given character to lowercase according to the character conversion rules defined by the default local, i.e. the following lowercase letters (abcdefghijklmnopqrstuvwxyz) are replaced with respective uppercase letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ).

The behavior is undefined if the value of ch is not representable as unsigned char and is not equal to EOF.

Parameters
chcharacter to be converted.
Returns
Uppercase version of ch or unmodified ch if no uppercase version is listed in the default locale.

References islower().

Referenced by bad_input(), good_input(), and towupper().

Here is the caller graph for this function: