]> asedeno.scripts.mit.edu Git - git.git/blob - ctype.c
Reformat ctype.c
[git.git] / ctype.c
1 /*
2  * Sane locale-independent, ASCII ctype.
3  *
4  * No surprises, and works with signed and unsigned chars.
5  */
6 #include "cache.h"
7
8 enum {
9         S = GIT_SPACE,
10         A = GIT_ALPHA,
11         D = GIT_DIGIT,
12         G = GIT_SPECIAL,        /* \0, *, ?, [, \\ */
13 };
14
15 unsigned char sane_ctype[256] = {
16         G, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, 0, S, 0, 0,         /*   0.. 15 */
17         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         /*  16.. 31 */
18         S, 0, 0, 0, 0, 0, 0, 0, 0, 0, G, 0, 0, 0, 0, 0,         /*  32.. 47 */
19         D, D, D, D, D, D, D, D, D, D, 0, 0, 0, 0, 0, G,         /*  48.. 63 */
20         0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,         /*  64.. 79 */
21         A, A, A, A, A, A, A, A, A, A, A, G, G, 0, 0, 0,         /*  80.. 95 */
22         0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,         /*  96..111 */
23         A, A, A, A, A, A, A, A, A, A, A, 0, 0, 0, 0, 0,         /* 112..127 */
24         /* Nothing in the 128.. range */
25 };