smol-gilbraltar/nolibc/ctype.c

27 lines
324 B
C
Raw Permalink Normal View History

2024-12-20 22:45:12 +00:00
#include <ctype.h>
int isalpha(int c)
{
return ((unsigned)c|32)-'a' < 26;
}
int isdigit(int c)
{
return (unsigned)c-'0' < 10;
}
int isprint(int c)
{
return (unsigned)c-0x20 < 0x5f;
}
int isspace(int c)
{
return c == ' ' || (unsigned)c-'\t' < 5;
}
int isupper(int c)
{
return (unsigned)c-'A' < 26;
}