Lines Matching defs:leaf

123  *                            node, otherwise it is a leaf node
148 * leaf[0]: The unicode version, stored as a generation number that is
152 * leaf[1]: Canonical Combining Class. During normalization, we need
160 * leaf[2]: Decomposition. If leaf[1] == 255, then leaf[2] is the
383 void *leaf = NULL;
386 while (!leaf && node) {
394 leaf = node->right;
403 leaf = node->left;
410 return leaf;
527 * Insert a new leaf into the tree, and collapse any subtrees that are
533 static int insert(struct tree *tree, char *key, int keylen, void *leaf)
559 *cursor = leaf;
576 /* Keep left, drop right leaf. */
577 leaf = node->left;
582 tree->root = leaf;
585 parent->left = leaf;
594 parent->right = leaf;
640 * Fully populated subtrees that end at the same leaf have already
938 * Compute the index of each node and leaf, which is the offset in the
1417 struct unicode_data *leaf = l;
1419 printf("%*sleaf @ %p code %X ccc %d gen %d", indent, "", leaf,
1420 leaf->code, leaf->ccc, leaf->gen);
1422 if (leaf->utf8nfdi && leaf->utf8nfdi[0] == HANGUL)
1424 else if (leaf->utf8nfdi)
1425 printf(" nfdi \"%s\"", (const char*)leaf->utf8nfdi);
1432 struct unicode_data *leaf = l;
1434 printf("%*sleaf @ %p code %X ccc %d gen %d", indent, "", leaf,
1435 leaf->code, leaf->ccc, leaf->gen);
1437 if (leaf->utf8nfdicf)
1438 printf(" nfdicf \"%s\"", (const char*)leaf->utf8nfdicf);
1439 else if (leaf->utf8nfdi && leaf->utf8nfdi[0] == HANGUL)
1441 else if (leaf->utf8nfdi)
1442 printf(" nfdi \"%s\"", (const char*)leaf->utf8nfdi);
1453 struct unicode_data *leaf = l;
1455 if (leaf->utf8nfdicf)
1462 struct unicode_data *leaf = l;
1464 return leaf->correction;
1469 struct unicode_data *leaf = l;
1472 if (HANGUL_SYLLABLE(leaf->code))
1474 else if (leaf->utf8nfdi)
1475 size += strlen(leaf->utf8nfdi) + 1;
1481 struct unicode_data *leaf = l;
1484 if (HANGUL_SYLLABLE(leaf->code))
1486 else if (leaf->utf8nfdicf)
1487 size += strlen(leaf->utf8nfdicf) + 1;
1488 else if (leaf->utf8nfdi)
1489 size += strlen(leaf->utf8nfdi) + 1;
1495 struct unicode_data *leaf = l;
1497 return &tree->leafindex[leaf->code];
1502 struct unicode_data *leaf = l;
1504 return &tree->leafindex[leaf->code];
1509 struct unicode_data *leaf = l;
1512 *data++ = leaf->gen;
1514 if (HANGUL_SYLLABLE(leaf->code)) {
1517 } else if (leaf->utf8nfdi) {
1519 s = (unsigned char*)leaf->utf8nfdi;
1523 *data++ = leaf->ccc;
1530 struct unicode_data *leaf = l;
1533 *data++ = leaf->gen;
1535 if (HANGUL_SYLLABLE(leaf->code)) {
1538 } else if (leaf->utf8nfdicf) {
1540 s = (unsigned char*)leaf->utf8nfdicf;
1543 } else if (leaf->utf8nfdi) {
1545 s = (unsigned char*)leaf->utf8nfdi;
1549 *data++ = leaf->ccc;
1748 utf8leaf_t *leaf;
1765 leaf = utf8lookup(tree, hangul, key);
1767 if (!leaf) {
1777 if (data->gen != LEAF_GEN(leaf))
1779 if (LEAF_CCC(leaf) == DECOMPOSE) {
1787 LEAF_STR(leaf))) {
1796 LEAF_STR(leaf)))
1799 LEAF_STR(leaf))) {
1803 } else if (data->ccc != LEAF_CCC(leaf)) {
1813 if (leaf) {
1816 LEAF_GEN(leaf),
1817 LEAF_CCC(leaf),
1818 LEAF_CCC(leaf) == DECOMPOSE ?
1819 LEAF_STR(leaf) : "");
2676 /* Fill in base of leaf. */
2700 * Returns the leaf if one exists, NULL otherwise.
2777 * Returns the leaf if one exists, NULL otherwise.
2805 utf8leaf_t *leaf;
2814 leaf = utf8lookup(tree, hangul, s);
2815 if (!leaf)
2817 leaf_age = ages[LEAF_GEN(leaf)];
2832 utf8leaf_t *leaf;
2841 leaf = utf8lookup(tree, hangul, s);
2842 if (!leaf)
2844 leaf_age = ages[LEAF_GEN(leaf)];
2858 utf8leaf_t *leaf;
2867 leaf = utf8nlookup(tree, hangul, s, len);
2868 if (!leaf)
2870 leaf_age = ages[LEAF_GEN(leaf)];
2885 utf8leaf_t *leaf;
2894 leaf = utf8nlookup(tree, hangul, s, len);
2895 if (!leaf)
2897 leaf_age = ages[LEAF_GEN(leaf)];
2914 utf8leaf_t *leaf;
2921 leaf = utf8lookup(tree, hangul, s);
2922 if (!leaf)
2924 if (ages[LEAF_GEN(leaf)] > tree->maxage)
2926 else if (LEAF_CCC(leaf) == DECOMPOSE)
2927 ret += strlen(LEAF_STR(leaf));
2941 utf8leaf_t *leaf;
2948 leaf = utf8nlookup(tree, hangul, s, len);
2949 if (!leaf)
2951 if (ages[LEAF_GEN(leaf)] > tree->maxage)
2953 else if (LEAF_CCC(leaf) == DECOMPOSE)
2954 ret += strlen(LEAF_STR(leaf));
3059 utf8leaf_t *leaf;
3086 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s);
3088 leaf = utf8nlookup(u8c->tree, u8c->hangul,
3092 /* No leaf found implies that the input is a binary blob. */
3093 if (!leaf)
3097 if (ages[LEAF_GEN(leaf)] > u8c->tree->maxage) {
3099 } else if ((ccc = LEAF_CCC(leaf)) == DECOMPOSE) {
3102 u8c->s = LEAF_STR(leaf);
3110 leaf = utf8lookup(u8c->tree, u8c->hangul, u8c->s);
3111 ccc = LEAF_CCC(leaf);