Lines Matching refs:u8c
2990 int utf8ncursor(struct utf8cursor *u8c, struct tree *tree, const char *s, in utf8ncursor() argument
2997 u8c->tree = tree; in utf8ncursor()
2998 u8c->s = s; in utf8ncursor()
2999 u8c->p = NULL; in utf8ncursor()
3000 u8c->ss = NULL; in utf8ncursor()
3001 u8c->sp = NULL; in utf8ncursor()
3002 u8c->len = len; in utf8ncursor()
3003 u8c->slen = 0; in utf8ncursor()
3004 u8c->ccc = STOPPER; in utf8ncursor()
3005 u8c->nccc = STOPPER; in utf8ncursor()
3006 u8c->unichar = 0; in utf8ncursor()
3008 if (u8c->len != len) 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()
3057 int utf8byte(struct utf8cursor *u8c) in utf8byte() argument
3064 if (u8c->p && *u8c->s == '\0') { in utf8byte()
3065 u8c->s = u8c->p; in utf8byte()
3066 u8c->p = NULL; in utf8byte()
3070 if (!u8c->p && (u8c->len == 0 || *u8c->s == '\0')) { in utf8byte()
3072 if (u8c->ccc == STOPPER) in utf8byte()
3077 } else if ((*u8c->s & 0xC0) == 0x80) { in utf8byte()
3079 if (!u8c->p) in utf8byte()
3080 u8c->len--; in utf8byte()
3081 return (unsigned char)*u8c->s++; in utf8byte()
3085 if (u8c->p) { in utf8byte()
3086 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3088 leaf = utf8nlookup(u8c->tree, u8c->hangul, in utf8byte()
3089 u8c->s, u8c->len); in utf8byte()
3097 if (ages[LEAF_GEN(leaf)] > u8c->tree->maxage) { 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()
3105 if (u8c->ccc == STOPPER) in utf8byte()
3110 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3113 u8c->unichar = utf8decode(u8c->s); in utf8byte()
3119 if (ccc != STOPPER && u8c->ccc < ccc && ccc < u8c->nccc) in utf8byte()
3120 u8c->nccc = ccc; in utf8byte()
3126 if (ccc == u8c->ccc) { in utf8byte()
3127 if (!u8c->p) in utf8byte()
3128 u8c->len--; in utf8byte()
3129 return (unsigned char)*u8c->s++; in utf8byte()
3134 if (u8c->nccc == STOPPER) { in utf8byte()
3140 assert(u8c->ccc == STOPPER); in utf8byte()
3141 u8c->ccc = MINCCC - 1; in utf8byte()
3142 u8c->nccc = ccc; in utf8byte()
3143 u8c->sp = u8c->p; in utf8byte()
3144 u8c->ss = u8c->s; in utf8byte()
3145 u8c->slen = u8c->len; in utf8byte()
3146 if (!u8c->p) in utf8byte()
3147 u8c->len -= utf8clen(u8c->s); in utf8byte()
3148 u8c->s += utf8clen(u8c->s); in utf8byte()
3151 if (!u8c->p) in utf8byte()
3152 u8c->len -= utf8clen(u8c->s); in utf8byte()
3153 u8c->s += utf8clen(u8c->s); in utf8byte()
3154 } else if (u8c->nccc != MAXCCC + 1) { in utf8byte()
3156 u8c->ccc = u8c->nccc; in utf8byte()
3157 u8c->nccc = MAXCCC + 1; in utf8byte()
3158 u8c->s = u8c->ss; in utf8byte()
3159 u8c->p = u8c->sp; in utf8byte()
3160 u8c->len = u8c->slen; in utf8byte()
3163 u8c->ccc = STOPPER; in utf8byte()
3164 u8c->nccc = STOPPER; in utf8byte()
3165 u8c->sp = NULL; in utf8byte()
3166 u8c->ss = NULL; in utf8byte()
3167 u8c->slen = 0; in utf8byte()
3179 struct utf8cursor u8c; in normalize_line() local
3184 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3186 while ((c = utf8byte(&u8c)) > 0) in normalize_line()
3199 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3201 while ((c = utf8byte(&u8c)) > 0) in normalize_line()