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