xref: /plan9/sys/src/ape/lib/ap/gen/isalnum.c (revision 58da3067adcdccaaa043d0bfde28ba83b7ced07d)
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
14 int isalnum(int c){ return (_ctype+1)[c]&(_ISupper|_ISlower|_ISdigit); }
15 int isalpha(int c){ return (_ctype+1)[c]&(_ISupper|_ISlower); }
16 int iscntrl(int c){ return (_ctype+1)[c]&_IScntrl; }
17 int isdigit(int c){ return (_ctype+1)[c]&_ISdigit; }
18 int isgraph(int c){ return (_ctype+1)[c]&(_ISpunct|_ISupper|_ISlower|_ISdigit); }
19 int islower(int c){ return (_ctype+1)[c]&_ISlower; }
20 int isprint(int c){ return (_ctype+1)[c]&(_ISpunct|_ISupper|_ISlower|_ISdigit|_ISblank); }
21 int ispunct(int c){ return (_ctype+1)[c]&_ISpunct; }
22 int isspace(int c){ return (_ctype+1)[c]&_ISspace; }
23 int isupper(int c){ return (_ctype+1)[c]&_ISupper; }
24 int isxdigit(int c){ return (_ctype+1)[c]&_ISxdigit; }
25