1 /*
2  * This file belongs to FreeMiNT. It's not in the original MiNT 1.12
3  * distribution. See the file CHANGES for a detailed log of changes.
4  *
5  *
6  * Copyright 2000 Frank Naumann <fnaumann@freemint.de>
7  * All rights reserved.
8  *
9  * This file is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2, or (at your option)
12  * any later version.
13  *
14  * This file is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  *
23  *
24  * begin:	2000-04-17
25  * last change:	2000-04-17
26  *
27  * Author:	Frank Naumann <fnaumann@freemint.de>
28  *
29  * Please send suggestions, patches or bug reports to me or
30  * the MiNT mailing list.
31  *
32  *
33  * changes since last version:
34  *
35  * known bugs:
36  *
37  * todo:
38  *
39  * optimizations:
40  *
41  */
42 
43 # define _CTc		0x01	/* control character */
44 # define _CTd		0x02	/* numeric digit */
45 # define _CTu		0x04	/* upper case */
46 # define _CTl		0x08	/* lower case */
47 # define _CTs		0x10	/* whitespace */
48 # define _CTp		0x20	/* punctuation */
49 # define _CTx		0x40	/* hexadecimal */
50 
51 
52 unsigned char _mint_ctype[256] =
53 {
54 	_CTc, _CTc, _CTc, _CTc,				/* 0x00..0x03 */
55 	_CTc, _CTc, _CTc, _CTc,				/* 0x04..0x07 */
56 	_CTc, _CTc|_CTs, _CTc|_CTs, _CTc|_CTs,		/* 0x08..0x0B */
57 	_CTc|_CTs, _CTc|_CTs, _CTc, _CTc,		/* 0x0C..0x0F */
58 
59 	_CTc, _CTc, _CTc, _CTc,				/* 0x10..0x13 */
60 	_CTc, _CTc, _CTc, _CTc,				/* 0x14..0x17 */
61 	_CTc, _CTc, _CTc, _CTc,				/* 0x18..0x1B */
62 	_CTc, _CTc, _CTc, _CTc,				/* 0x1C..0x1F */
63 
64 	_CTs, _CTp, _CTp, _CTp,				/* 0x20..0x23 */
65 	_CTp, _CTp, _CTp, _CTp,				/* 0x24..0x27 */
66 	_CTp, _CTp, _CTp, _CTp,				/* 0x28..0x2B */
67 	_CTp, _CTp, _CTp, _CTp,				/* 0x2C..0x2F */
68 
69 	_CTd|_CTx, _CTd|_CTx, _CTd|_CTx, _CTd|_CTx,	/* 0x30..0x33 */
70 	_CTd|_CTx, _CTd|_CTx, _CTd|_CTx, _CTd|_CTx,	/* 0x34..0x37 */
71 	_CTd|_CTx, _CTd|_CTx, _CTp, _CTp,		/* 0x38..0x3B */
72 	_CTp, _CTp, _CTp, _CTp,				/* 0x3C..0x3F */
73 
74 	_CTp, _CTu|_CTx, _CTu|_CTx, _CTu|_CTx,		/* 0x40..0x43 */
75 	_CTu|_CTx, _CTu|_CTx, _CTu|_CTx, _CTu,		/* 0x44..0x47 */
76 	_CTu, _CTu, _CTu, _CTu,				/* 0x48..0x4B */
77 	_CTu, _CTu, _CTu, _CTu,				/* 0x4C..0x4F */
78 
79 	_CTu, _CTu, _CTu, _CTu,				/* 0x50..0x53 */
80 	_CTu, _CTu, _CTu, _CTu,				/* 0x54..0x57 */
81 	_CTu, _CTu, _CTu, _CTp,				/* 0x58..0x5B */
82 	_CTp, _CTp, _CTp, _CTp,				/* 0x5C..0x5F */
83 
84 	_CTp, _CTl|_CTx, _CTl|_CTx, _CTl|_CTx,		/* 0x60..0x63 */
85 	_CTl|_CTx, _CTl|_CTx, _CTl|_CTx, _CTl,		/* 0x64..0x67 */
86 	_CTl, _CTl, _CTl, _CTl,				/* 0x68..0x6B */
87 	_CTl, _CTl, _CTl, _CTl,				/* 0x6C..0x6F */
88 
89 	_CTl, _CTl, _CTl, _CTl,				/* 0x70..0x73 */
90 	_CTl, _CTl, _CTl, _CTl,				/* 0x74..0x77 */
91 	_CTl, _CTl, _CTl, _CTp,				/* 0x78..0x7B */
92 	_CTp, _CTp, _CTp, _CTc,				/* 0x7C..0x7F */
93 
94 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80..0x8F */
95 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90..0x9F */
96 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xA0..0xAF */
97 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xB0..0xBF */
98 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xC0..0xCF */
99 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xD0..0xDF */
100 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xE0..0xEF */
101 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0  /* 0xF0..0xFF */
102 };
103