Subversion Repositories Kolibri OS

Rev

Rev 6433 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7172 siemargl 1
#ifndef _CTYPE_H
2
#define _CTYPE_H
215 victor 3
/*
4
** All character classification functions except isascii().
5
** Integer argument (c) must be in ASCII range (0-127) for
6
** dependable answers.
7
*/
8
 
6424 siemargl 9
#define __ALNUM     1
10
#define __ALPHA     2
11
#define __CNTRL     4
12
#define __DIGIT     8
13
#define __GRAPH    16
14
#define __LOWER    32
15
#define __PRINT    64
16
#define __PUNCT   128
17
#define __BLANK   256
18
#define __UPPER   512
19
#define __XDIGIT 1024
215 victor 20
 
6432 siemargl 21
extern unsigned short __is[128];
215 victor 22
 
6432 siemargl 23
#define isalnum(c)(__is[c+1] & __ALNUM ) /* 'a'-'z', 'A'-'Z', '0'-'9' */
24
#define isalpha(c)(__is[c+1] & __ALPHA ) /* 'a'-'z', 'A'-'Z' */
25
#define iscntrl(c)(__is[c+1] & __CNTRL ) /* 0-31, 127 */
26
#define isdigit(c)(__is[c+1] & __DIGIT ) /* '0'-'9' */
27
#define isgraph(c)(__is[c+1] & __GRAPH ) /* '!'-'~' */
28
#define islower(c)(__is[c+1] & __LOWER ) /* 'a'-'z' */
29
#define isprint(c)(__is[c+1] & __PRINT ) /* ' '-'~' */
30
#define ispunct(c)(__is[c+1] & __PUNCT ) /* !alnum && !cntrl && !space */
31
#define isspace(c)(__is[c+1] & __BLANK ) /* HT, LF, VT, FF, CR, ' ' */
32
#define isupper(c)(__is[c+1] & __UPPER ) /* 'A'-'Z' */
33
#define isxdigit(c)(__is[c+1] & __XDIGIT) /* '0'-'9', 'a'-'f', 'A'-'F' */
647 andrew_pro 34
 
35
#define isascii(c) (!((c)&(~0x7f)))
36
#define toascii(c) ((c)&0x7f)
37
 
6433 siemargl 38
extern unsigned char tolower(unsigned char c);
39
extern unsigned char toupper(unsigned char c);
7172 siemargl 40
 
41
#endif