2005-10-13 22:03:18 +04:00
|
|
|
/*
|
|
|
|
* Sane locale-independent, ASCII ctype.
|
|
|
|
*
|
|
|
|
* No surprises, and works with signed and unsigned chars.
|
|
|
|
*/
|
2012-02-10 06:13:30 +04:00
|
|
|
#include "git-compat-util.h"
|
2005-10-13 22:03:18 +04:00
|
|
|
|
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, /* *, ?, [, \\ */
|
2011-04-09 03:18:46 +04:00
|
|
|
R = GIT_REGEX_SPECIAL, /* $, (, ), +, ., ^, {, | */
|
|
|
|
P = GIT_PATHSPEC_MAGIC /* other non-alnum, except for ] and } */
|
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 */
|
2011-04-09 03:18:46 +04:00
|
|
|
S, P, P, P, R, P, P, P, R, R, G, R, P, P, R, P, /* 32.. 47 */
|
|
|
|
D, D, D, D, D, D, D, D, D, D, P, P, P, P, P, G, /* 48.. 63 */
|
|
|
|
P, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 64.. 79 */
|
|
|
|
A, A, A, A, A, A, A, A, A, A, A, G, G, 0, R, P, /* 80.. 95 */
|
|
|
|
P, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 96..111 */
|
|
|
|
A, A, A, A, A, A, A, A, A, A, A, R, R, 0, P, 0, /* 112..127 */
|
2005-10-13 22:03:18 +04:00
|
|
|
/* Nothing in the 128.. range */
|
|
|
|
};
|