string-list: document that string_list_insert() inserts unique strings
[git/debian.git] / ctype.c
blobaf722f957fa5a1899dc906196d9b0372acab946d
1 /*
2 * Sane locale-independent, ASCII ctype.
4 * No surprises, and works with signed and unsigned chars.
5 */
6 #include "git-compat-util.h"
8 enum {
9 S = GIT_SPACE,
10 A = GIT_ALPHA,
11 D = GIT_DIGIT,
12 G = GIT_GLOB_SPECIAL, /* *, ?, [, \\ */
13 R = GIT_REGEX_SPECIAL, /* $, (, ), +, ., ^, {, | */
14 P = GIT_PATHSPEC_MAGIC /* other non-alnum, except for ] and } */
17 unsigned char sane_ctype[256] = {
18 0, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, 0, S, 0, 0, /* 0.. 15 */
19 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16.. 31 */
20 S, P, P, P, R, P, P, P, R, R, G, R, P, P, R, P, /* 32.. 47 */
21 D, D, D, D, D, D, D, D, D, D, P, P, P, P, P, G, /* 48.. 63 */
22 P, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 64.. 79 */
23 A, A, A, A, A, A, A, A, A, A, A, G, G, 0, R, P, /* 80.. 95 */
24 P, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 96..111 */
25 A, A, A, A, A, A, A, A, A, A, A, R, R, 0, P, 0, /* 112..127 */
26 /* Nothing in the 128.. range */