summaryrefslogtreecommitdiff
path: root/minilib/ctype.c
blob: 98e351b61bf7ce914003beda7165c23a31d238c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "ctype.h"

int isalpha( int c )
{
	return (unsigned int)( c | 32 ) - 'a' < 26;
}

int isdigit( int c )
{
	return (unsigned int)c - '0' < 10;
}

int isalnum( int c )
{
	return isalpha( c ) || isdigit( c );
}

int isspace( int c )
{
	return c == ' ' || c == '\t' || c == '\r' || c == '\n';
}