The <ctype.h> header file
This header file contains the following functions:
_tolower _toupper isalnum isalpha
isascii iscntrl isdigit isextalnum
isextlower isextpunct isextupper isfrgn
isfrgnalnum isfrgnlower isfrgnupper isgraph
isgreek islower isprint ispunct
isspace isupper isxdigit toascii
toextlower toextupper tolower toupper
NOTE: All these functions are inline functions which are implemented using GNU C smart macros
(except the simplest ones, which are ordinary macros). Some of them expands to a relatively
large code, so if you call any of them more than twice in a program, it will be a good idea
to define an ordinary function which will call such inline function. For example, if you want
to call isxdigit more than twice, to save memory define
int _isxdigit(int c)
{
return isxdigit(c);
}
then call _isxdigit instead.
Functions
Checks whether a character is an ASCII character.
isascii returns nonzero if c is in the range 0 to 127 (0x00-0x7F), else returns zero.
It is a simple macro.
Checks whether a character is an uppercase.
isupper returns nonzero if c is an uppercase letter ('A' to 'Z'), else returns zero.
It is a small inline function which is implemented using GNU C smart macros.
Checks whether a character is a lowercase.
islower returns nonzero if c is a lowercase letter ('a' to 'z'), else returns zero.
It is a small inline function which is implemented using GNU C smart macros.
Checks whether a character is a digit.
isdigit returns nonzero if c is a digit ('0' to '9'), else returns zero.
It is a small inline function which is implemented using GNU C smart macros.
Checks whether a character is a letter.
isalpha returns nonzero if c is a letter ('A' to 'Z' or 'a' to 'z'), else returns zero.
It is an inline function which is implemented using GNU C smart macros, which expands to a
relatively small code.
Checks whether a character is an alphanumeric.
isalnum returns nonzero if c is a letter ('A' to 'Z' or 'a' to 'z') or a digit ('0' to '9'), else returns zero.
It is an inline function which is implemented using GNU C smart macros, which expands to a
medium-sized code.
Checks whether a character is a hex digit.
isxdigit returns nonzero if c is a hexadecimal digit ('0' to '9', 'A' to 'F' or 'a' to 'f'), else returns zero.
It is an inline function which is implemented using GNU C smart macros, which expands to a
medium-sized code.
Checks whether a character is a control character.
iscntrl returns nonzero if c is a TIOS control character, else returns zero. Note that
in TIOS control characters are reduced to the range from 0x00 to 0x0D.
iscntrl is a simple macro.
Checks whether a character is a white space.
isspace returns nonzero if c is a space, tab, carriage return, new line,
vertical tab, or formfeed (0x09 to 0x0D and 0x20), else returns zero.
It is a relatively small inline function which is implemented using GNU C smart macros.
Checks whether a character is a printing character.
isprint returns nonzero if c is a printing character, else returns zero.
In TIOS, all characters in a range 0x0E to 0xFF and 0x0B are marked as "printable".
isprint is a relatively small inline function which is implemented using GNU C smart macros.
Checks whether a character is a graph character.
isgraph returns nonzero if c is printing character, like
isprint, except that a space character is excluded; else returns zero.
It is an inline function which is implemented using GNU C smart macros, which expands to a
relatively small code.
Checks whether a character is a punctuation character.
ispunct returns nonzero if c is a punctuation character, else returns zero. Punctuation
characters are all characters in standard ASCII graph range (0x21 to 0x7F), which are not
alphanumeric character (see isalnum).
ispunct is an inline function which is implemented using GNU C smart macros, which expands to a
relatively large code.
Checks whether a character is a Greek letter.
isGreek returns nonzero if c is a Greek letter (0x80 to 0x94 and 0xB5), else returns zero.
It is a relatively small inline function which is implemented using GNU C smart macros.
Checks whether a character is a foreign uppercase.
isfrgnupper returns nonzero if c is a non-Greek foreign uppercase letter (0xC0 to 0xDE except
0xD7), else returns zero.
It is a relatively small inline function which is implemented using GNU C smart macros.
Checks whether a character is a foreign lowercase.
isfrgnlower returns nonzero if c is a non-Greek foreign lowercase letter (0xE0 to 0xFE except
0xF7), else returns zero.
It is a relatively small inline function which is implemented using GNU C smart macros.
Checks whether a character is an uppercase, including foreign ones.
isextupper returns nonzero if c is an uppercase letter, either ordinary ('A' to 'Z')
or foreign one (see isfrgnupper), else returns zero.
It is an inline function which is implemented using GNU C smart macros, which expands to a
medium-sized code.
Checks whether a character is a lowercase, including foreign ones.
isextlower returns nonzero if c is a lowercase letter, either ordinary ('a' to 'z')
or foreign one (see isfrgnlower), else returns zero.
It is an inline function which is implemented using GNU C smart macros, which expands to a
medium-sized code.
Checks whether a character is a foreign letter.
isfrgn returns nonzero if c is a foreign letter (including Greek ones), either
uppercase or lowercase (see isGreek, isfrgnupper
and isfrgnlower), else returns zero.
It is an inline function which is implemented using GNU C smart macros, which expands to a
relatively large code.
Checks whether a character is a foreign letter which is valid in a variable name.
isfrgnalnum is the same as isfrgn, except small Greek "pi" is excluded,
because it is the reserved symbol and it is not valid in a variable name.
isfrgnalnum is an inline function which is implemented using GNU C smart macros, which expands
to a relatively large code.
Checks whether a character is an extended alphanumeric.
isextalnum returns nonzero if c is a symbol which may be used in variable names,
including ordinary alphanumerics (see isalnum), underscore ('_') and
foreign alphanumerics (see isfrgnalnum), else returns zero.
It is an inline function which is implemented using GNU C smart macros. First call of isextalnum
expands to a large code, but any next call of it expands to a relatively small code.
Checks whether a character is an extended punctuation character.
isextpunct returns nonzero if c is a character which is printable
(see isprint but which is not an extended alphanumeric
(see isextalnum), else returns zero. Extended punctuation
characters include ordinary punctuation characters (see ispunct) and
some extra ones.
isextpunct is an inline function which is implemented using GNU C smart macros. First call of it
expands to a large code, but any next call of it expands to a relatively small code.
Translates characters to uppercase.
toupper is a function that converts an integer c to its uppercase value
('A' to 'Z') if it was lowercase ('a' to 'z'). All others are left unchanged.
Returns the converted value of c.
toupper is a relatively small inline function which is implemented using GNU C smart macros.
Translates characters to uppercase, including foreign ones.
toextupper works like toupper, but it also converts foreign
lowercase characters (see isfrgnlower).
toextupper is an inline function which is implemented using GNU C smart macros, which
expands to a medium-sized code.
Translates uppercase characters to lowercase.
_toupper does the same conversion as toupper or
toextupper, except that it
should be used only when c is known to be lowercase (either ordinary or foreign).
It is faster, and
generates much shorter code than toupper. _toupper returns the
converted value of c if it is lowercase; otherwise, the result is undefined.
_toupper is a simple macro.
Translates characters to lowercase.
tolower is a function that converts an integer c to its lowercase value
('a' to 'z') if it was uppercase ('A' to 'Z'). All others are left unchanged.
Returns the converted value of c.
tolower is a relatively small inline function which is implemented using GNU C smart macros.
Translates characters to lowercase, including foreign ones.
toextlower works like tolower, but it also converts foreign
uppercase characters (see isfrgnupper).
toextupper is an inline function which is implemented using GNU C smart macros, which
expands to a medium-sized code.
Translates uppercase characters to lowercase.
_tolower does the same conversion as tolower or
toextlower, except that it
should be used only when c is known to be uppercase (either ordinary
or foreign). It is faster, and
generates much shorter code than tolower. _tolower returns the
converted value of c if it is uppercase; otherwise, the result is undefined.
_tolower is a simple macro.
Translates characters to ASCII format.
toascii converts the integer c to ASCII by clearing all but
the lower 7 bits. This gives a value in the range 0 to 127.
Returns the converted value of c.
toascii is a simple macro.