diff options
author | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
---|---|---|
committer | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
commit | e5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch) | |
tree | d8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/ape/lib/ap/gen/isalnum.c |
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/ape/lib/ap/gen/isalnum.c')
-rwxr-xr-x | sys/src/ape/lib/ap/gen/isalnum.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/src/ape/lib/ap/gen/isalnum.c b/sys/src/ape/lib/ap/gen/isalnum.c new file mode 100755 index 000000000..e1ab47cde --- /dev/null +++ b/sys/src/ape/lib/ap/gen/isalnum.c @@ -0,0 +1,24 @@ +#include <ctype.h> + +#undef isalnum +#undef isalpha +#undef iscntrl +#undef isdigit +#undef isgraph +#undef islower +#undef isprint +#undef ispunct +#undef isspace +#undef isupper +#undef isxdigit +int isalnum(int c){ return (_ctype+1)[c]&(_ISupper|_ISlower|_ISdigit); } +int isalpha(int c){ return (_ctype+1)[c]&(_ISupper|_ISlower); } +int iscntrl(int c){ return (_ctype+1)[c]&_IScntrl; } +int isdigit(int c){ return (_ctype+1)[c]&_ISdigit; } +int isgraph(int c){ return (_ctype+1)[c]&(_ISpunct|_ISupper|_ISlower|_ISdigit); } +int islower(int c){ return (_ctype+1)[c]&_ISlower; } +int isprint(int c){ return (_ctype+1)[c]&(_ISpunct|_ISupper|_ISlower|_ISdigit|_ISblank); } +int ispunct(int c){ return (_ctype+1)[c]&_ISpunct; } +int isspace(int c){ return (_ctype+1)[c]&_ISspace; } +int isupper(int c){ return (_ctype+1)[c]&_ISupper; } +int isxdigit(int c){ return (_ctype+1)[c]&_ISxdigit; } |