CTYPE(3C) | Standard C Library Functions | CTYPE(3C) |
ctype, isalpha, isalnum, isascii, isblank, iscntrl, isdigit, islower, isprint, isspace, isupper, ispunct, isgraph, isxdigit, isalpha_l, isalnum_l, isblank_l, iscntrl_l, isdigit_l, islower_l, isprint_l, isspace_l, isupper_l, ispunct_l, isgraph_l, isxdigit_l - character handling
#include <ctype.h> int isalpha(int c);
int isalnum(int c);
int isascii(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 isalpha_l(int c, locale_t loc);
int isalnum_l(int c, locale_t loc);
int isblank_l(int c, locale_t loc);
int iscntrl_l(int c, locale_t loc);
int isdigit_l(int c, locale_t loc);
int isgraph_l(int c, locale_t loc);
int islower_l(int c, locale_t loc);
int isprint_l(int c, locale_t loc);
int ispunct_l(int c, locale_t loc);
int isspace_l(int c, locale_t loc);
int isupper_l(int c, locale_t loc);
int isxdigit_l(int c, locale_t loc);
These functions classify character-coded integer values. Each is a predicate returning non-zero for true, 0 for false. The behavior of these macros, except isascii(), is affected by the current locale (see setlocale(3C) and uselocale(3C)). To modify the behavior, change the LC_TYPE category in setlocale(), that is, setlocale(LC_CTYPE, newlocale). In the "C" locale, or in a locale where character type information is not defined, characters are classified according to the rules of the US-ASCII 7-bit coded character set.
The functions isalnum_l(), isalpha_l(), isblank_l(), iscntrl_l, isdigit_l(), isgraph_l(), islower_l(), isprint_l(), ispunct_l(), isspace_l(), isupper_l(), and isxdigit_l() all behave identically to their counterparts without the '_l' prefix, except that instead of acting on the current locale, they perform the test on the locale specified in the argument loc.
The isascii() macro is defined on all integer values. The rest are defined only where the argument is an int, the value of which is representable as an unsigned char, or EOF, which is defined by the <stdio.h> header and represents end-of-file.
isalpha()
isalnum()
isascii()
isblank()
iscntrl()
isdigit()
isgraph()
islower()
isprint()
ispunct()
isspace()
isupper()
isxdigit()
0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f
are included.
If the argument to any of the character handling macros is not in the domain of the function, the result is undefined. Otherwise, the macro or function returns non-zero if the classification is TRUE and 0 if the classification is FALSE.
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
CSI | Enabled |
Interface Stability | Standard |
MT-Level | MT-Safe |
newlocale(3C), setlocale(3C), stdio(3C), uselocale(3C), ascii(7), environ(7), standards(7)
November 8, 2020 | OmniOS |