21 if (ch <=
'Z' -
'A') ch +=
'a' -
'A';
22 h = ((h << 5) + h) ^ ch;
35 if (h == cm->
hash[pos])
53 for (j = 0; j < len; ++j)
if (!s[j]) ++cm->
num;
56 while (h && (h < cm->num)) h += h;
69 for (h = 0; h <= cm->
mask; ++h)
73 for (j = 0; j < len; ++j)
77 for (k = i; k < j; ++k)
78 if (s[k] ==
':')
break;
79 if (k >= j) { i = j + 1;
continue; }
82 cm->
input[pos] = s + i;
113 if (!flagchar || flagchar == 0 || flagchar ==
'\0') {
118 for (j = 0; j < len; ++j)
if (!s[j]) ++cm->
num;
121 while (h && (h < cm->num)) h += h;
134 for (h = 0; h <= cm->
mask; ++h)
138 for (j = 0; j < len; ++j) {
142 for (k = i; k < j; ++k)
143 if (s[k] == flagchar)
break;
144 if (k >= j) { i = j + 1;
continue; }
147 cm->
input[pos] = s + i;
void constmap_free(struct constmap *cm)
int constmap_init_char(struct constmap *cm, char *s, int len, int flagcolon, char flagchar)
int constmap_init(struct constmap *cm, char *s, int len, int flagcolon)
int case_diffb(char *, unsigned int, char *)
void * alloc(unsigned int)
unsigned long constmap_hash