xref: /plan9/sys/src/ape/lib/ap/gen/isalnum.c (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1 #include <ctype.h>
2 
3 #undef isalnum
4 #undef isalpha
5 #undef iscntrl
6 #undef isdigit
7 #undef isgraph
8 #undef islower
9 #undef isprint
10 #undef ispunct
11 #undef isspace
12 #undef isupper
13 #undef isxdigit
isalnum(int c)14 int isalnum(int c){ return (_ctype+1)[c]&(_ISupper|_ISlower|_ISdigit); }
isalpha(int c)15 int isalpha(int c){ return (_ctype+1)[c]&(_ISupper|_ISlower); }
iscntrl(int c)16 int iscntrl(int c){ return (_ctype+1)[c]&_IScntrl; }
isdigit(int c)17 int isdigit(int c){ return (_ctype+1)[c]&_ISdigit; }
isgraph(int c)18 int isgraph(int c){ return (_ctype+1)[c]&(_ISpunct|_ISupper|_ISlower|_ISdigit); }
islower(int c)19 int islower(int c){ return (_ctype+1)[c]&_ISlower; }
isprint(int c)20 int isprint(int c){ return (_ctype+1)[c]&(_ISpunct|_ISupper|_ISlower|_ISdigit|_ISblank); }
ispunct(int c)21 int ispunct(int c){ return (_ctype+1)[c]&_ISpunct; }
isspace(int c)22 int isspace(int c){ return (_ctype+1)[c]&_ISspace; }
isupper(int c)23 int isupper(int c){ return (_ctype+1)[c]&_ISupper; }
isxdigit(int c)24 int isxdigit(int c){ return (_ctype+1)[c]&_ISxdigit; }
25