Reformat ctype.c
[alt-git.git] / ctype.c
blob6528687000ba594c86bcd2725ceba6c8a417eb9a
1 /*
2 * Sane locale-independent, ASCII ctype.
4 * No surprises, and works with signed and unsigned chars.
5 */
6 #include "cache.h"
8 enum {
9 S = GIT_SPACE,
10 A = GIT_ALPHA,
11 D = GIT_DIGIT,
12 G = GIT_SPECIAL, /* \0, *, ?, [, \\ */
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 */