Lines Matching refs:u8c
2921 int utf8ncursor(struct utf8cursor *u8c, struct tree *tree, const char *s, in utf8ncursor() argument
2928 u8c->tree = tree; in utf8ncursor()
2929 u8c->s = s; in utf8ncursor()
2930 u8c->p = NULL; in utf8ncursor()
2931 u8c->ss = NULL; in utf8ncursor()
2932 u8c->sp = NULL; in utf8ncursor()
2933 u8c->len = len; in utf8ncursor()
2934 u8c->slen = 0; in utf8ncursor()
2935 u8c->ccc = STOPPER; in utf8ncursor()
2936 u8c->nccc = STOPPER; in utf8ncursor()
2937 u8c->unichar = 0; in utf8ncursor()
2939 if (u8c->len != len) in utf8ncursor()
2956 int utf8cursor(struct utf8cursor *u8c, struct tree *tree, const char *s) in utf8cursor() argument
2958 return utf8ncursor(u8c, tree, s, (unsigned int)-1); in utf8cursor()
2988 int utf8byte(struct utf8cursor *u8c) in utf8byte() argument
2995 if (u8c->p && *u8c->s == '\0') { in utf8byte()
2996 u8c->s = u8c->p; in utf8byte()
2997 u8c->p = NULL; in utf8byte()
3001 if (!u8c->p && (u8c->len == 0 || *u8c->s == '\0')) { in utf8byte()
3003 if (u8c->ccc == STOPPER) in utf8byte()
3008 } else if ((*u8c->s & 0xC0) == 0x80) { in utf8byte()
3010 if (!u8c->p) in utf8byte()
3011 u8c->len--; in utf8byte()
3012 return (unsigned char)*u8c->s++; in utf8byte()
3016 if (u8c->p) { in utf8byte()
3017 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3019 leaf = utf8nlookup(u8c->tree, u8c->hangul, in utf8byte()
3020 u8c->s, u8c->len); in utf8byte()
3028 if (ages[LEAF_GEN(leaf)] > u8c->tree->maxage) { in utf8byte()
3031 u8c->len -= utf8clen(u8c->s); in utf8byte()
3032 u8c->p = u8c->s + utf8clen(u8c->s); in utf8byte()
3033 u8c->s = LEAF_STR(leaf); in utf8byte()
3035 if (*u8c->s == '\0') { in utf8byte()
3036 if (u8c->ccc == STOPPER) in utf8byte()
3041 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3044 u8c->unichar = utf8decode(u8c->s); in utf8byte()
3050 if (ccc != STOPPER && u8c->ccc < ccc && ccc < u8c->nccc) in utf8byte()
3051 u8c->nccc = ccc; in utf8byte()
3057 if (ccc == u8c->ccc) { in utf8byte()
3058 if (!u8c->p) in utf8byte()
3059 u8c->len--; in utf8byte()
3060 return (unsigned char)*u8c->s++; in utf8byte()
3065 if (u8c->nccc == STOPPER) { in utf8byte()
3071 assert(u8c->ccc == STOPPER); in utf8byte()
3072 u8c->ccc = MINCCC - 1; in utf8byte()
3073 u8c->nccc = ccc; in utf8byte()
3074 u8c->sp = u8c->p; in utf8byte()
3075 u8c->ss = u8c->s; in utf8byte()
3076 u8c->slen = u8c->len; in utf8byte()
3077 if (!u8c->p) in utf8byte()
3078 u8c->len -= utf8clen(u8c->s); in utf8byte()
3079 u8c->s += utf8clen(u8c->s); in utf8byte()
3082 if (!u8c->p) in utf8byte()
3083 u8c->len -= utf8clen(u8c->s); in utf8byte()
3084 u8c->s += utf8clen(u8c->s); in utf8byte()
3085 } else if (u8c->nccc != MAXCCC + 1) { in utf8byte()
3087 u8c->ccc = u8c->nccc; in utf8byte()
3088 u8c->nccc = MAXCCC + 1; in utf8byte()
3089 u8c->s = u8c->ss; in utf8byte()
3090 u8c->p = u8c->sp; in utf8byte()
3091 u8c->len = u8c->slen; in utf8byte()
3094 u8c->ccc = STOPPER; in utf8byte()
3095 u8c->nccc = STOPPER; in utf8byte()
3096 u8c->sp = NULL; in utf8byte()
3097 u8c->ss = NULL; in utf8byte()
3098 u8c->slen = 0; in utf8byte()
3110 struct utf8cursor u8c; in normalize_line() local
3115 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3117 while ((c = utf8byte(&u8c)) > 0) in normalize_line()
3130 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3132 while ((c = utf8byte(&u8c)) > 0) in normalize_line()