• Home
  • Raw
  • Download

Lines Matching refs:u8c

2963 int utf8ncursor(struct utf8cursor *u8c, struct tree *tree, const char *s,  in utf8ncursor()  argument
2970 u8c->tree = tree; in utf8ncursor()
2971 u8c->s = s; in utf8ncursor()
2972 u8c->p = NULL; in utf8ncursor()
2973 u8c->ss = NULL; in utf8ncursor()
2974 u8c->sp = NULL; in utf8ncursor()
2975 u8c->len = len; in utf8ncursor()
2976 u8c->slen = 0; in utf8ncursor()
2977 u8c->ccc = STOPPER; in utf8ncursor()
2978 u8c->nccc = STOPPER; in utf8ncursor()
2979 u8c->unichar = 0; in utf8ncursor()
2981 if (u8c->len != len) in utf8ncursor()
2998 int utf8cursor(struct utf8cursor *u8c, struct tree *tree, const char *s) in utf8cursor() argument
3000 return utf8ncursor(u8c, tree, s, (unsigned int)-1); in utf8cursor()
3030 int utf8byte(struct utf8cursor *u8c) in utf8byte() argument
3037 if (u8c->p && *u8c->s == '\0') { in utf8byte()
3038 u8c->s = u8c->p; in utf8byte()
3039 u8c->p = NULL; in utf8byte()
3043 if (!u8c->p && (u8c->len == 0 || *u8c->s == '\0')) { in utf8byte()
3045 if (u8c->ccc == STOPPER) in utf8byte()
3050 } else if ((*u8c->s & 0xC0) == 0x80) { in utf8byte()
3052 if (!u8c->p) in utf8byte()
3053 u8c->len--; in utf8byte()
3054 return (unsigned char)*u8c->s++; in utf8byte()
3058 if (u8c->p) { in utf8byte()
3059 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3061 leaf = utf8nlookup(u8c->tree, u8c->hangul, in utf8byte()
3062 u8c->s, u8c->len); in utf8byte()
3070 if (ages[LEAF_GEN(leaf)] > u8c->tree->maxage) { in utf8byte()
3073 u8c->len -= utf8clen(u8c->s); in utf8byte()
3074 u8c->p = u8c->s + utf8clen(u8c->s); in utf8byte()
3075 u8c->s = LEAF_STR(leaf); in utf8byte()
3077 if (*u8c->s == '\0') { in utf8byte()
3078 if (u8c->ccc == STOPPER) in utf8byte()
3083 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s); in utf8byte()
3086 u8c->unichar = utf8decode(u8c->s); in utf8byte()
3092 if (ccc != STOPPER && u8c->ccc < ccc && ccc < u8c->nccc) in utf8byte()
3093 u8c->nccc = ccc; in utf8byte()
3099 if (ccc == u8c->ccc) { in utf8byte()
3100 if (!u8c->p) in utf8byte()
3101 u8c->len--; in utf8byte()
3102 return (unsigned char)*u8c->s++; in utf8byte()
3107 if (u8c->nccc == STOPPER) { in utf8byte()
3113 assert(u8c->ccc == STOPPER); in utf8byte()
3114 u8c->ccc = MINCCC - 1; in utf8byte()
3115 u8c->nccc = ccc; in utf8byte()
3116 u8c->sp = u8c->p; in utf8byte()
3117 u8c->ss = u8c->s; in utf8byte()
3118 u8c->slen = u8c->len; in utf8byte()
3119 if (!u8c->p) in utf8byte()
3120 u8c->len -= utf8clen(u8c->s); in utf8byte()
3121 u8c->s += utf8clen(u8c->s); in utf8byte()
3124 if (!u8c->p) in utf8byte()
3125 u8c->len -= utf8clen(u8c->s); in utf8byte()
3126 u8c->s += utf8clen(u8c->s); in utf8byte()
3127 } else if (u8c->nccc != MAXCCC + 1) { in utf8byte()
3129 u8c->ccc = u8c->nccc; in utf8byte()
3130 u8c->nccc = MAXCCC + 1; in utf8byte()
3131 u8c->s = u8c->ss; in utf8byte()
3132 u8c->p = u8c->sp; in utf8byte()
3133 u8c->len = u8c->slen; in utf8byte()
3136 u8c->ccc = STOPPER; in utf8byte()
3137 u8c->nccc = STOPPER; in utf8byte()
3138 u8c->sp = NULL; in utf8byte()
3139 u8c->ss = NULL; in utf8byte()
3140 u8c->slen = 0; in utf8byte()
3152 struct utf8cursor u8c; in normalize_line() local
3157 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3159 while ((c = utf8byte(&u8c)) > 0) in normalize_line()
3172 if (utf8cursor(&u8c, tree, s)) in normalize_line()
3174 while ((c = utf8byte(&u8c)) > 0) in normalize_line()