X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=retrocrawl;a=blobdiff_plain;f=src%2Famiga%2Flibc%2Fctype.c;fp=src%2Famiga%2Flibc%2Fctype.c;h=9676441e6d2bcc4771424b114f49268e71594882;hp=0000000000000000000000000000000000000000;hb=08dc7cfecb35a6893f7f8d96196859593272da3b;hpb=fa6997608f790933b3d4bb9f55d17084f77dfc16 diff --git a/src/amiga/libc/ctype.c b/src/amiga/libc/ctype.c new file mode 100644 index 0000000..9676441 --- /dev/null +++ b/src/amiga/libc/ctype.c @@ -0,0 +1,56 @@ +#include "ctype.h" + +int isalnum(int c) +{ + return isalpha(c) || isdigit(c); +} + +int isalpha(int c) +{ + return isupper(c) || islower(c); +} + +int isblank(int c) +{ + return c == ' ' || c == '\t'; +} + +int isdigit(int c) +{ + return c >= '0' && c <= '9'; +} + +int isupper(int c) +{ + return c >= 'A' && c <= 'Z'; +} + +int islower(int c) +{ + return c >= 'a' && c <= 'z'; +} + +int isgraph(int c) +{ + return c > ' ' && c <= '~'; +} + +int isprint(int c) +{ + return isgraph(c) || c == ' '; +} + +int isspace(int c) +{ + return isblank(c) || c == '\f' || c == '\n' || c == '\r' || c == '\v'; +} + +int toupper(int c) +{ + return islower(c) ? (c + ('A' - 'a')) : c; +} + +int tolower(int c) +{ + return isupper(c) ? (c + ('A' - 'a')) : c; +}