Lines Matching refs:u8c
420 int utf8ncursor(struct utf8cursor *u8c, const struct unicode_map *um, in utf8ncursor() argument
425 u8c->um = um; in utf8ncursor()
426 u8c->n = n; in utf8ncursor()
427 u8c->s = s; in utf8ncursor()
428 u8c->p = NULL; in utf8ncursor()
429 u8c->ss = NULL; in utf8ncursor()
430 u8c->sp = NULL; in utf8ncursor()
431 u8c->len = len; in utf8ncursor()
432 u8c->slen = 0; in utf8ncursor()
433 u8c->ccc = STOPPER; in utf8ncursor()
434 u8c->nccc = STOPPER; in utf8ncursor()
436 if (u8c->len != len) in utf8ncursor()
471 int utf8byte(struct utf8cursor *u8c) in utf8byte() argument
478 if (u8c->p && *u8c->s == '\0') { in utf8byte()
479 u8c->s = u8c->p; in utf8byte()
480 u8c->p = NULL; in utf8byte()
484 if (!u8c->p && (u8c->len == 0 || *u8c->s == '\0')) { in utf8byte()
486 if (u8c->ccc == STOPPER) in utf8byte()
491 } else if ((*u8c->s & 0xC0) == 0x80) { in utf8byte()
493 if (!u8c->p) in utf8byte()
494 u8c->len--; in utf8byte()
495 return (unsigned char)*u8c->s++; in utf8byte()
499 if (u8c->p) { in utf8byte()
500 leaf = utf8lookup(u8c->um, u8c->n, u8c->hangul, u8c->s); in utf8byte()
502 leaf = utf8nlookup(u8c->um, u8c->n, u8c->hangul, in utf8byte()
503 u8c->s, u8c->len); in utf8byte()
512 if (u8c->um->tables->utf8agetab[LEAF_GEN(leaf)] > in utf8byte()
513 u8c->um->ntab[u8c->n]->maxage) { in utf8byte()
516 u8c->len -= utf8clen(u8c->s); in utf8byte()
517 u8c->p = u8c->s + utf8clen(u8c->s); in utf8byte()
518 u8c->s = LEAF_STR(leaf); in utf8byte()
520 if (*u8c->s == '\0') { in utf8byte()
521 if (u8c->ccc == STOPPER) in utf8byte()
527 leaf = utf8lookup(u8c->um, u8c->n, u8c->hangul, u8c->s); in utf8byte()
537 if (ccc != STOPPER && u8c->ccc < ccc && ccc < u8c->nccc) in utf8byte()
538 u8c->nccc = ccc; in utf8byte()
544 if (ccc == u8c->ccc) { in utf8byte()
545 if (!u8c->p) in utf8byte()
546 u8c->len--; in utf8byte()
547 return (unsigned char)*u8c->s++; in utf8byte()
552 if (u8c->nccc == STOPPER) { in utf8byte()
558 u8c->ccc = MINCCC - 1; in utf8byte()
559 u8c->nccc = ccc; in utf8byte()
560 u8c->sp = u8c->p; in utf8byte()
561 u8c->ss = u8c->s; in utf8byte()
562 u8c->slen = u8c->len; in utf8byte()
563 if (!u8c->p) in utf8byte()
564 u8c->len -= utf8clen(u8c->s); in utf8byte()
565 u8c->s += utf8clen(u8c->s); in utf8byte()
568 if (!u8c->p) in utf8byte()
569 u8c->len -= utf8clen(u8c->s); in utf8byte()
570 u8c->s += utf8clen(u8c->s); in utf8byte()
571 } else if (u8c->nccc != MAXCCC + 1) { in utf8byte()
573 u8c->ccc = u8c->nccc; in utf8byte()
574 u8c->nccc = MAXCCC + 1; in utf8byte()
575 u8c->s = u8c->ss; in utf8byte()
576 u8c->p = u8c->sp; in utf8byte()
577 u8c->len = u8c->slen; in utf8byte()
580 u8c->ccc = STOPPER; in utf8byte()
581 u8c->nccc = STOPPER; in utf8byte()
582 u8c->sp = NULL; in utf8byte()
583 u8c->ss = NULL; in utf8byte()
584 u8c->slen = 0; in utf8byte()