unicode.c 1.63 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* 
 * Copyright (c) 2012 Christoph Mueller <ruunhb@googlemail.com>
 * 
 * Crystal is free software: you can redistribute it and/or modify
 * it under the terms of the Lesser GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Crystal is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * Lesser GNU General Public License for more details.
 *
 * You should have received a copy of the Lesser GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

19
#include <ctype.h>
20 21 22 23 24
#include "unicode.h"

int             
cry_unicode_isblank(unicode ch)
{
25
	return isblank(ch);
26 27 28 29 30
}

int             
cry_unicode_isspace(unicode ch)
{
31
	return isspace(ch);
32 33 34 35 36 37
}


int             
cry_unicode_isalpha(unicode ch)
{
38
	return isalpha(ch);
39 40 41 42 43 44
}


int             
cry_unicode_isalnum(unicode ch)
{
45
	return isalnum(ch);
46 47 48 49 50 51
}


int             
cry_unicode_isdigit(unicode ch)
{
52
	return isdigit(ch);
53 54 55 56 57 58
}


int             
cry_unicode_ishex(unicode ch)
{
59
	return ('0' <= ch && ch <= '9') || ('a' <= ch && ch <= 'f') || ('a' <= ch && ch <= 'f');
60 61 62 63
}


int             
64
cry_unicode_iscntrl(unicode ch)
65
{
66
	return iscntrl(ch);
67 68 69 70 71 72
}


int             
cry_unicode_isprint(unicode ch)
{
73
	return isprint(ch);
74 75 76 77 78 79
}


int             
cry_unicode_isgraph(unicode ch)
{
80
	return isgraph(ch);
81 82 83 84 85 86
}


int             
cry_unicode_ispunct(unicode ch)
{
87
	return ispunct(ch);
88 89 90 91 92 93 94 95 96 97
}


int             
cry_unicode_isctrl(unicode ch)
{
	return 0;
}