summaryrefslogtreecommitdiff
path: root/sys/src/ape/lib/ap/gen/isalnum.c
blob: 0cca9948be2640ef5bbc213a912d7eb47139db1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <ctype.h>

#undef isalnum
#undef isalpha
#undef isblank
#undef iscntrl
#undef isdigit
#undef isgraph
#undef islower
#undef isprint
#undef ispunct
#undef isspace
#undef isupper
#undef isxdigit

int isalnum(int c) {return _ctype[(unsigned char)(c)]&(_ISupper|_ISlower|_ISdigit);}
int isalpha(int c) {return _ctype[(unsigned char)(c)]&(_ISupper|_ISlower);}
int isblank(int c) {return _ctype[(unsigned char)(c)]&_ISblank;}
int iscntrl(int c) {return _ctype[(unsigned char)(c)]&_IScntrl;}
int isdigit(int c) {return _ctype[(unsigned char)(c)]&_ISdigit;}
int isgraph(int c) {return _ctype[(unsigned char)(c)]&(_ISpunct|_ISupper|_ISlower|_ISdigit);}
int islower(int c) {return _ctype[(unsigned char)(c)]&_ISlower;}
int isprint(int c) {return _ctype[(unsigned char)(c)]&(_ISpunct|_ISupper|_ISlower|_ISdigit|_ISblank);}
int ispunct(int c) {return _ctype[(unsigned char)(c)]&_ISpunct;}
int isspace(int c) {return _ctype[(unsigned char)(c)]&_ISspace;}
int isupper(int c) {return _ctype[(unsigned char)(c)]&_ISupper;}
int isxdigit(int c) {return _ctype[(unsigned char)(c)]&_ISxdigit;}