]>
Commit | Line | Data |
---|---|---|
4546738b LT |
1 | /* |
2 | * Sane locale-independent, ASCII ctype. | |
3 | * | |
4 | * No surprises, and works with signed and unsigned chars. | |
5 | */ | |
6 | #include "cache.h" | |
7 | ||
c67b1fa3 JH |
8 | /* Just so that no insane platform contaminate namespace with these symbols */ |
9 | #undef SS | |
10 | #undef AA | |
11 | #undef DD | |
63e8aea7 | 12 | #undef GS |
c67b1fa3 | 13 | |
4546738b LT |
14 | #define SS GIT_SPACE |
15 | #define AA GIT_ALPHA | |
16 | #define DD GIT_DIGIT | |
63e8aea7 | 17 | #define GS GIT_SPECIAL /* \0, *, ?, [, \\ */ |
4546738b LT |
18 | |
19 | unsigned char sane_ctype[256] = { | |
63e8aea7 | 20 | GS, 0, 0, 0, 0, 0, 0, 0, 0, SS, SS, 0, 0, SS, 0, 0, /* 0-15 */ |
4546738b | 21 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16-15 */ |
63e8aea7 BC |
22 | SS, 0, 0, 0, 0, 0, 0, 0, 0, 0, GS, 0, 0, 0, 0, 0, /* 32-15 */ |
23 | DD, DD, DD, DD, DD, DD, DD, DD, DD, DD, 0, 0, 0, 0, 0, GS, /* 48-15 */ | |
4546738b | 24 | 0, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, /* 64-15 */ |
63e8aea7 | 25 | AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, GS, GS, 0, 0, 0, /* 80-15 */ |
4546738b LT |
26 | 0, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, /* 96-15 */ |
27 | AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, 0, 0, 0, 0, 0, /* 112-15 */ | |
28 | /* Nothing in the 128.. range */ | |
29 | }; |