United States-English |
|
|
HP-UX Reference > Cctype(3C)HP-UX 11i Version 3: February 2007 |
|
NAMEctype: isalnum(), isalpha(), isascii(), isblank(), iscntrl(), isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isupper(), isxdigit() — classify characters according to type SYNOPSIS#include <ctype.h> int isalnum(int c); int isalpha(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); DESCRIPTIONThese functions classify character-coded integer values according to the rules of the coded character set identified by the last successful call to setlocale() (see setlocale(3C)). Each function is a predicate returning nonzero for true, zero for false. If setlocale() has not been called successfully, characters are classified according to the rules of the default ASCII 7-bit coded character set (see setlocale(3C)). isascii() is defined on all integer values; the other functions are defined for the range -1 (EOF) through 255. RETURN VALUEThe functions return nonzero under the following circumstances; zero otherwise:
If the argument to any of these functions is outside the domain of the function, the result is undefined. WARNINGSThese functions are supplied both as library functions and as macros defined in the <ctype.h> header. Normally, the macro versions are used. To obtain the library function, either use a #undef to remove the macro definition or, if compiling in ANSI-C mode, enclose the function name in parenthesis or take its address. The following example uses the library functions for isalpha(), isdigit(), and isspace(): #include <ctype.h> #undef isalpha ... main() { int (*ctype_func)(); ... if ( isalpha(c) ) ... if ( (isdigit)(c) ) ... ctype_func = isspace; ... } STANDARDS CONFORMANCEisalnum(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isalpha(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isascii(): AES, SVID2, SVID3, XPG2, XPG3, XPG4 isblank(): ISO/IEC 9899:1999 (C99), UNIX 03 iscntrl(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isdigit(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isgraph(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C islower(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isprint(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C ispunct(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isspace(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isupper(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C isxdigit(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1, ANSI C |
Printable version | ||
|