magic pathspec: add tentative ":/path/from/top/level" pathspec support
[git/git.git] / ctype.c
CommitLineData
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
c841aa8b
RS
8enum {
9 S = GIT_SPACE,
10 A = GIT_ALPHA,
11 D = GIT_DIGIT,
8cc32992 12 G = GIT_GLOB_SPECIAL, /* *, ?, [, \\ */
4b05548f 13 R = GIT_REGEX_SPECIAL /* $, (, ), +, ., ^, {, | */
c841aa8b 14};
4546738b
LT
15
16unsigned char sane_ctype[256] = {
8cc32992 17 0, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, 0, S, 0, 0, /* 0.. 15 */
c841aa8b 18 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16.. 31 */
f9b7cce6 19 S, 0, 0, 0, R, 0, 0, 0, R, R, G, R, 0, 0, R, 0, /* 32.. 47 */
c841aa8b
RS
20 D, D, D, D, D, D, D, D, D, D, 0, 0, 0, 0, 0, G, /* 48.. 63 */
21 0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 64.. 79 */
f9b7cce6 22 A, A, A, A, A, A, A, A, A, A, A, G, G, 0, R, 0, /* 80.. 95 */
c841aa8b 23 0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 96..111 */
f9b7cce6 24 A, A, A, A, A, A, A, A, A, A, A, R, R, 0, 0, 0, /* 112..127 */
4546738b
LT
25 /* Nothing in the 128.. range */
26};