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