2005-10-13 18:03:18 +00:00
|
|
|
/*
|
|
|
|
* Sane locale-independent, ASCII ctype.
|
|
|
|
*
|
|
|
|
* No surprises, and works with signed and unsigned chars.
|
|
|
|
*/
|
|
|
|
#include "cache.h"
|
|
|
|
|
2009-01-17 15:50:29 +00:00
|
|
|
enum {
|
|
|
|
S = GIT_SPACE,
|
|
|
|
A = GIT_ALPHA,
|
|
|
|
D = GIT_DIGIT,
|
2009-01-17 15:50:34 +00:00
|
|
|
G = GIT_GLOB_SPECIAL, /* *, ?, [, \\ */
|
2009-05-01 20:03:07 +00:00
|
|
|
R = GIT_REGEX_SPECIAL, /* $, (, ), +, ., ^, {, | */
|
2009-01-17 15:50:29 +00:00
|
|
|
};
|
2005-10-13 18:03:18 +00:00
|
|
|
|
|
|
|
unsigned char sane_ctype[256] = {
|
2009-01-17 15:50:34 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, 0, S, 0, 0, /* 0.. 15 */
|
2009-01-17 15:50:29 +00:00
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16.. 31 */
|
2009-01-17 15:50:37 +00:00
|
|
|
S, 0, 0, 0, R, 0, 0, 0, R, R, G, R, 0, 0, R, 0, /* 32.. 47 */
|
2009-01-17 15:50:29 +00:00
|
|
|
D, D, D, D, D, D, D, D, D, D, 0, 0, 0, 0, 0, G, /* 48.. 63 */
|
|
|
|
0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 64.. 79 */
|
2009-01-17 15:50:37 +00:00
|
|
|
A, A, A, A, A, A, A, A, A, A, A, G, G, 0, R, 0, /* 80.. 95 */
|
2009-01-17 15:50:29 +00:00
|
|
|
0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 96..111 */
|
2009-01-17 15:50:37 +00:00
|
|
|
A, A, A, A, A, A, A, A, A, A, A, R, R, 0, 0, 0, /* 112..127 */
|
2005-10-13 18:03:18 +00:00
|
|
|
/* Nothing in the 128.. range */
|
|
|
|
};
|