… | |
… | |
683 | struct search_list_level *le,*leu; |
683 | struct search_list_level *le,*leu; |
684 | int level=this_->level; |
684 | int level=this_->level; |
685 | struct attr attr2; |
685 | struct attr attr2; |
686 | int has_street_name=0; |
686 | int has_street_name=0; |
687 | |
687 | |
688 | // dbg(0,"******* enter *******\n"); |
688 | //dbg(0,"******* enter *******\n"); |
689 | le=&this_->levels[level]; |
689 | le=&this_->levels[level]; |
690 | //dbg(0,"le=%p\n", le); |
690 | //dbg(0,"le=%p\n", le); |
691 | for (;;) |
691 | for (;;) |
692 | { |
692 | { |
693 | //dbg(0,"le->search=%p\n", le->search); |
693 | //dbg(0,"le->search=%p\n", le->search); |
… | |
… | |
717 | break; |
717 | break; |
718 | if (slc->selected == leu->selected) |
718 | if (slc->selected == leu->selected) |
719 | break; |
719 | break; |
720 | } |
720 | } |
721 | } |
721 | } |
722 | if (le->parent) |
722 | //if (le->parent) |
723 | { |
723 | //{ |
724 | //dbg(0,"mapset_search_new with item(%d,%d)\n", le->parent->item.id_hi, le->parent->item.id_lo); |
724 | // //dbg(0,"mapset_search_new with item(%d,%d)\n", le->parent->item.id_hi, le->parent->item.id_lo); |
725 | } |
725 | //} |
|
|
726 | //else |
|
|
727 | //{ |
|
|
728 | // dbg(0,"NO parent!!\n"); |
|
|
729 | //} |
726 | //dbg(0,"############## attr=%s\n", attr_to_name(le->attr->type)); |
730 | // dbg(0,"############## attr=%s\n", attr_to_name(le->attr->type)); |
727 | le->search=mapset_search_new(this_->ms, &le->parent->item, le->attr, le->partial); |
731 | le->search=mapset_search_new(this_->ms, &le->parent->item, le->attr, le->partial); |
|
|
732 | // ** DOC ** mapset_search_new(struct mapset *ms, struct item *item, struct attr *search_attr, int partial) |
728 | le->hash=g_hash_table_new(search_item_hash_hash, search_item_hash_equal); |
733 | le->hash=g_hash_table_new(search_item_hash_hash, search_item_hash_equal); |
729 | } |
734 | } |
730 | //dbg(0,"le->search=%p\n", le->search); |
735 | //dbg(0,"le->search=%p\n", le->search); |
731 | if (!this_->item) |
736 | if (!this_->item) |
732 | { |
737 | { |
… | |
… | |
1422 | {882, "WS", "WS", "WSM", /* 882 */ "Samoa"}, |
1427 | {882, "WS", "WS", "WSM", /* 882 */ "Samoa"}, |
1423 | {887, "YAR", "YE", "YEM", /* 887 */ "Yemen"}, |
1428 | {887, "YAR", "YE", "YEM", /* 887 */ "Yemen"}, |
1424 | {175, NULL, "YT", "MYT", /* 175 */ "Mayotte"}, |
1429 | {175, NULL, "YT", "MYT", /* 175 */ "Mayotte"}, |
1425 | {710, "ZA", "ZA", "ZAF", /* 710 */ "South Africa"}, |
1430 | {710, "ZA", "ZA", "ZAF", /* 710 */ "South Africa"}, |
1426 | {894, "Z", "ZM", "ZMB", /* 894 */ "Zambia"}, |
1431 | {894, "Z", "ZM", "ZMB", /* 894 */ "Zambia"}, |
1427 | {716, "ZW", "ZW", "ZWE", /* 716 */ "Zimbabwe"} |
1432 | {716, "ZW", "ZW", "ZWE", /* 716 */ "Zimbabwe"}, |
1428 | // {999, "*", "*", "*", "* Unknown, add is_in tags to those cities"}, |
1433 | {999, "*", "*", "*", "Unknown"}, |
1429 | }; |
1434 | }; |
1430 | |
1435 | |
1431 | |
1436 | |
1432 | static int |
1437 | static int |
1433 | ascii_cmp_local(char *name, char *match, int partial) |
1438 | ascii_cmp_local(char *name, char *match, int partial) |
… | |
… | |
1692 | |
1697 | |
1693 | // search_full_world(addr,partial,jni,search_country_flags,search_country_string); |
1698 | // search_full_world(addr,partial,jni,search_country_flags,search_country_string); |
1694 | |
1699 | |
1695 | dbg(0,"-- START --\n"); |
1700 | dbg(0,"-- START --\n"); |
1696 | |
1701 | |
1697 | // search in "attr_country_all" -> seems to be when item is in no country |
1702 | // search in "attr_country_all" -> seems to be when item is in no country?? or not |
|
|
1703 | /* |
1698 | dbg(0,"-- country all start --\n"); |
1704 | dbg(0,"-- country all start --\n"); |
1699 | while (tmp) |
1705 | while (tmp) |
1700 | { |
1706 | { |
1701 | dbg(0,"s=%s\n",tmp->data); |
1707 | dbg(0,"s=%s\n",tmp->data); |
1702 | attr.u.str=tmp->data; |
1708 | attr.u.str=tmp->data; |
1703 | search_list_search(sl, &attr, partial); |
1709 | search_list_search(sl, &attr, partial); |
1704 | result_list=search_address__country(result_list, sl, phrases, tmp, partial, jni); |
1710 | result_list=search_address__country(result_list, sl, phrases, tmp, partial, jni); |
1705 | tmp=g_list_next(tmp); |
1711 | tmp=g_list_next(tmp); |
1706 | } |
1712 | } |
1707 | dbg(0,"-- country all end --\n"); |
1713 | dbg(0,"-- country all end --\n"); |
|
|
1714 | */ |
1708 | |
1715 | |
1709 | // normal search stuff -------- START ---------- |
1716 | // normal search stuff -------- START ---------- |
1710 | if (search_country_flags == 1) |
1717 | if (search_country_flags == 1) |
1711 | { |
1718 | { |
1712 | dbg(0,"-- country default start --\n"); |
1719 | dbg(0,"-- country default start --\n"); |
1713 | while (phrases) |
1720 | while (phrases) |
1714 | { |
1721 | { |
1715 | dbg(0,"s=%s\n",phrases->data); |
1722 | // dbg(0,"s=%s\n",phrases->data); |
1716 | // set default country |
1723 | // set default country |
1717 | search_list_search(sl, country_default(), 0); |
1724 | search_list_search(sl, country_default(), 0); |
1718 | ret=search_address__country(ret, sl, phrases, NULL, partial, jni); |
1725 | ret=search_address__country(ret, sl, phrases, NULL, partial, jni); |
1719 | phrases=g_list_next(phrases); |
1726 | phrases=g_list_next(phrases); |
1720 | } |
1727 | } |
… | |
… | |
1727 | struct attr country; |
1734 | struct attr country; |
1728 | country.type=attr_country_iso2; |
1735 | country.type=attr_country_iso2; |
1729 | country.u.str=search_country_string; |
1736 | country.u.str=search_country_string; |
1730 | while (phrases) |
1737 | while (phrases) |
1731 | { |
1738 | { |
1732 | dbg(0,"s=%s\n",phrases->data); |
1739 | // dbg(0,"s=%s\n",phrases->data); |
1733 | search_list_search(sl, &country, 0); |
1740 | search_list_search(sl, &country, 0); |
1734 | // set a country |
1741 | // set a country |
1735 | ret=search_address__country(ret, sl, phrases, NULL, partial, jni); |
1742 | ret=search_address__country(ret, sl, phrases, NULL, partial, jni); |
1736 | phrases=g_list_next(phrases); |
1743 | phrases=g_list_next(phrases); |
1737 | } |
1744 | } |
… | |
… | |
1749 | if (all_country_list[j1].iso2 != NULL) |
1756 | if (all_country_list[j1].iso2 != NULL) |
1750 | { |
1757 | { |
1751 | phrases=phrases_first; |
1758 | phrases=phrases_first; |
1752 | while (phrases) |
1759 | while (phrases) |
1753 | { |
1760 | { |
1754 | //dbg(0,"s country=%s\n",all_country_list[j1].iso2); |
1761 | // dbg(0,"s country=%s\n",all_country_list[j1].iso2); |
1755 | //dbg(0,"s=%s\n",phrases->data); |
1762 | // dbg(0,"s=%s\n",phrases->data); |
1756 | country.type=attr_country_iso2; |
1763 | country.type=attr_country_iso2; |
1757 | country.u.str=all_country_list[j1].iso2; |
1764 | country.u.str=all_country_list[j1].iso2; |
1758 | search_list_search(sl, &country, 0); |
1765 | search_list_search(sl, &country, 0); |
1759 | ret=search_address__country(ret, sl, phrases, NULL, partial, jni); |
1766 | ret=search_address__country(ret, sl, phrases, NULL, partial, jni); |
1760 | phrases=g_list_next(phrases); |
1767 | phrases=g_list_next(phrases); |