Lines Matching refs:s
308 const unsigned char *s = (const unsigned char*)str; in utf8decode() local
311 if (*s < 0x80) { in utf8decode()
312 unichar = *s; in utf8decode()
313 } else if (*s < UTF8_3_BITS) { in utf8decode()
314 unichar = *s++ & 0x1F; in utf8decode()
316 unichar |= *s & 0x3F; in utf8decode()
317 } else if (*s < UTF8_4_BITS) { in utf8decode()
318 unichar = *s++ & 0x0F; in utf8decode()
320 unichar |= *s++ & 0x3F; in utf8decode()
322 unichar |= *s & 0x3F; in utf8decode()
324 unichar = *s++ & 0x0F; in utf8decode()
326 unichar |= *s++ & 0x3F; in utf8decode()
328 unichar |= *s++ & 0x3F; in utf8decode()
330 unichar |= *s & 0x3F; in utf8decode()
1510 unsigned char *s; in nfdi_emit() local
1519 s = (unsigned char*)leaf->utf8nfdi; in nfdi_emit()
1520 while ((*data++ = *s++) != 0) in nfdi_emit()
1531 unsigned char *s; in nfdicf_emit() local
1540 s = (unsigned char*)leaf->utf8nfdicf; in nfdicf_emit()
1541 while ((*data++ = *s++) != 0) in nfdicf_emit()
1545 s = (unsigned char*)leaf->utf8nfdi; in nfdicf_emit()
1546 while ((*data++ = *s++) != 0) in nfdicf_emit()
2121 char *s; in nfdi_init() local
2143 s = buf0; in nfdi_init()
2145 if (*s == '<') { in nfdi_init()
2146 type = ++s; in nfdi_init()
2147 while (*++s != '>'); in nfdi_init()
2148 *s++ = '\0'; in nfdi_init()
2154 while (*s) { in nfdi_init()
2155 mapping[i] = strtoul(s, &s, 16); in nfdi_init()
2183 char *s; in nfdicf_init() local
2205 s = buf0; in nfdicf_init()
2206 if (*s == '<') in nfdicf_init()
2207 while (*s++ != ' ') in nfdicf_init()
2210 while (*s) { in nfdicf_init()
2211 mapping[i] = strtoul(s, &s, 16); in nfdicf_init()
2312 char *s; in corrections_init() local
2353 s = buf0; in corrections_init()
2354 while (*s) { in corrections_init()
2355 mapping[i] = strtoul(s, &s, 16); in corrections_init()
2707 const char *s, size_t len) in utf8nlookup() argument
2726 s++; in utf8nlookup()
2729 if (*s & mask) { in utf8nlookup()
2771 trie = utf8hangul(s - 2, hangul); in utf8nlookup()
2782 const char *s) in utf8lookup() argument
2784 return utf8nlookup(tree, hangul, s, (size_t)-1); in utf8lookup()
2792 static inline int utf8clen(const char *s) in utf8clen() argument
2794 unsigned char c = *s; in utf8clen()
2803 int utf8agemax(struct tree *tree, const char *s) in utf8agemax() argument
2813 while (*s) { in utf8agemax()
2814 leaf = utf8lookup(tree, hangul, s); in utf8agemax()
2820 s += utf8clen(s); in utf8agemax()
2830 int utf8agemin(struct tree *tree, const char *s) in utf8agemin() argument
2840 while (*s) { in utf8agemin()
2841 leaf = utf8lookup(tree, hangul, s); in utf8agemin()
2847 s += utf8clen(s); in utf8agemin()
2856 int utf8nagemax(struct tree *tree, const char *s, size_t len) in utf8nagemax() argument
2866 while (len && *s) { in utf8nagemax()
2867 leaf = utf8nlookup(tree, hangul, s, len); in utf8nagemax()
2873 len -= utf8clen(s); in utf8nagemax()
2874 s += utf8clen(s); in utf8nagemax()
2883 int utf8nagemin(struct tree *tree, const char *s, size_t len) in utf8nagemin() argument
2893 while (len && *s) { in utf8nagemin()
2894 leaf = utf8nlookup(tree, hangul, s, len); in utf8nagemin()
2900 len -= utf8clen(s); in utf8nagemin()
2901 s += utf8clen(s); in utf8nagemin()
2912 ssize_t utf8len(struct tree *tree, const char *s) in utf8len() argument
2920 while (*s) { in utf8len()
2921 leaf = utf8lookup(tree, hangul, s); in utf8len()
2925 ret += utf8clen(s); in utf8len()
2929 ret += utf8clen(s); in utf8len()
2930 s += utf8clen(s); in utf8len()
2939 ssize_t utf8nlen(struct tree *tree, const char *s, size_t len) in utf8nlen() argument
2947 while (len && *s) { in utf8nlen()
2948 leaf = utf8nlookup(tree, hangul, s, len); in utf8nlen()
2952 ret += utf8clen(s); in utf8nlen()
2956 ret += utf8clen(s); in utf8nlen()
2957 len -= utf8clen(s); in utf8nlen()
2958 s += utf8clen(s); in utf8nlen()
2968 const char *s; member
2990 int utf8ncursor(struct utf8cursor *u8c, struct tree *tree, const char *s, in utf8ncursor() argument
2995 if (!s) in utf8ncursor()
2998 u8c->s = s; in utf8ncursor()
3011 if (len > 0 && (*s & 0xC0) == 0x80) in utf8ncursor()
3025 int utf8cursor(struct utf8cursor *u8c, struct tree *tree, const char *s) in utf8cursor() argument
3027 return utf8ncursor(u8c, tree, s, (unsigned int)-1); in utf8cursor()
3064 if (u8c->p && *u8c->s == '\0') { in utf8byte()
3065 u8c->s = u8c->p; in utf8byte()
3070 if (!u8c->p && (u8c->len == 0 || *u8c->s == '\0')) { in utf8byte()
3077 } else if ((*u8c->s & 0xC0) == 0x80) { in utf8byte()
3081 return (unsigned char)*u8c->s++; in utf8byte()
3086 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3089 u8c->s, u8c->len); in utf8byte()
3100 u8c->len -= utf8clen(u8c->s); in utf8byte()
3101 u8c->p = u8c->s + utf8clen(u8c->s); in utf8byte()
3102 u8c->s = LEAF_STR(leaf); in utf8byte()
3104 if (*u8c->s == '\0') { in utf8byte()
3110 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3113 u8c->unichar = utf8decode(u8c->s); in utf8byte()
3129 return (unsigned char)*u8c->s++; in utf8byte()
3144 u8c->ss = u8c->s; in utf8byte()
3147 u8c->len -= utf8clen(u8c->s); in utf8byte()
3148 u8c->s += utf8clen(u8c->s); in utf8byte()
3152 u8c->len -= utf8clen(u8c->s); in utf8byte()
3153 u8c->s += utf8clen(u8c->s); in utf8byte()
3158 u8c->s = u8c->ss; in utf8byte()
3176 char *s; in normalize_line() local
3182 s = buf2; in normalize_line()
3184 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3195 s = buf2; in normalize_line()
3197 s[strlen(s) + 1] = -1; in normalize_line()
3199 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3217 char *s; in normalization_test() local
3236 s = buf0; in normalization_test()
3238 while (*s) { in normalization_test()
3239 unichar = strtoul(s, &s, 16); in normalization_test()
3245 s = buf1; in normalization_test()
3247 while (*s) { in normalization_test()
3248 unichar = strtoul(s, &s, 16); in normalization_test()