navit
0.5.3-trunk
|
#include <stdlib.h>
#include <glib.h>
#include <string.h>
#include <math.h>
#include "debug.h"
#include "projection.h"
#include "item.h"
#include "xmlconfig.h"
#include "map.h"
#include "mapset.h"
#include "coord.h"
#include "transform.h"
#include "search.h"
#include "country.h"
#include "linguistics.h"
#include "geom.h"
#include "util.h"
#include "search_houseno_interpol.h"
#include "layout.h"
Data Structures | |
struct | search_list_level |
struct | search_list |
struct | phrase |
Functions | |
static struct search_list_result * | search_list_result_dup (struct search_list_result *slr) |
static void | search_list_country_destroy (struct search_list_country *this_) |
static void | search_list_town_destroy (struct search_list_town *this_) |
static void | search_list_street_destroy (struct search_list_street *this_) |
static void | search_list_house_number_destroy (struct search_list_house_number *this_) |
static guint | search_item_hash_hash (gconstpointer key) |
static gboolean | search_item_hash_equal (gconstpointer a, gconstpointer b) |
struct search_list * | search_list_new (struct mapset *ms) |
Create new instance of search_list to run a search. More... | |
static void | search_list_search_free (struct search_list *sl, int level) |
int | search_list_level (enum attr_type attr_type) |
Determine search list level for given attr_type. More... | |
char * | search_fix_spaces (const char *str) |
Replaces ',' and '/' by ' ', deduplicates spaces within the string and strips spaces from both ends of the string. More... | |
static GList * | search_split_phrases (char *str) |
static char * | search_phrase_str (struct phrase *p) |
static int | search_phrase_used (struct phrase *p, GList *used_phrases) |
static gint | search_by_address_compare (gconstpointer a, gconstpointer b) |
static GList * | search_by_address_attr (GList *results, struct search_list *sl, GList *phrases, GList *exclude, enum attr_type attr_type, int wordcount) |
static void | search_by_address (struct search_list *this_, char *addr) |
static void | search_address_results_free (struct search_list *this_) |
void | search_list_search (struct search_list *this_, struct attr *search_attr, int partial) |
Start a search. More... | |
struct search_list_common * | search_list_select (struct search_list *this_, enum attr_type attr_type, int id, int mode) |
static void | search_list_common_addattr (struct attr *attr, struct search_list_common *common) |
static void | search_list_common_new (struct item *item, struct search_list_common *common) |
static void | search_list_common_dup (struct search_list_common *src, struct search_list_common *dst) |
static void | search_list_common_destroy (struct search_list_common *common) |
static struct search_list_country * | search_list_country_new (struct item *item) |
static struct search_list_country * | search_list_country_dup (struct search_list_country *this_) |
static struct search_list_town * | search_list_town_new (struct item *item) |
static struct search_list_town * | search_list_town_dup (struct search_list_town *this_) |
static struct search_list_street * | search_list_street_new (struct item *item) |
static struct search_list_street * | search_list_street_dup (struct search_list_street *this_) |
static struct search_list_house_number * | search_list_house_number_new (struct item *item, struct house_number_interpolation *inter, char *inter_match, int inter_partial) |
static struct search_list_house_number * | search_list_house_number_dup (struct search_list_house_number *this_) |
static void | search_list_result_destroy (int level, void *p) |
char * | search_postal_merge (char *mask, char *new) |
char * | search_postal_merge_replace (char *mask, char *new) |
static int | postal_match (char *postal, char *mask) |
static int | search_add_result (struct search_list_level *le, struct search_list_common *slc) |
struct search_list_result * | search_list_get_result (struct search_list *this_) |
Get (next) result from a search. More... | |
void | search_list_destroy (struct search_list *this_) |
void | search_init (void) |
|
static |
Referenced by search_list_get_result().
|
static |
References search_list_level::hash, search_list_level::list, search_list_common::postal, search_list_common::postal_mask, and search_postal_merge().
Referenced by search_list_get_result().
|
static |
References search_list::address_results, search_list::address_results_pos, search_list_result::c, search_list_result::country, search_list_result::house_number, search_list_country_destroy(), search_list_house_number_destroy(), search_list_street_destroy(), search_list_town_destroy(), search_list_result::street, and search_list_result::town.
Referenced by search_list_search().
|
static |
|
static |
References attr_to_name(), dbg, search_list_result::id, lvl_debug, p, search_by_address_compare(), search_list_get_result(), search_list_result_dup(), search_list_search(), search_phrase_str(), search_phrase_used(), attr::str, attr::type, attr::u, and phrase::wordcount.
Referenced by search_by_address().
|
static |
References search_list_result::id.
Referenced by search_by_address_attr().
char* search_fix_spaces | ( | const char * | str | ) |
Replaces ',' and '/' by ' ', deduplicates spaces within the string and strips spaces from both ends of the string.
pointer | to the string to cleanup |
References c.
Referenced by search_by_address(), and start_search().
void search_init | ( | void | ) |
Referenced by main_real().
|
static |
References item_is_equal_id.
Referenced by search_list_get_result().
|
static |
References item::id_hi, item::id_lo, and key.
Referenced by search_list_get_result().
|
static |
References attr_generic_prepend_attr(), search_list_common::attrs, search_list_common::county_name, search_list_common::district_name, search_list_common::postal, search_list_common::postal_mask, attr::str, search_list_common::town_name, attr::type, and attr::u.
Referenced by search_list_common_dup(), and search_list_common_new().
|
static |
References attr_list_free(), search_list_common::attrs, search_list_common::c, search_list_common::county_name, search_list_common::district_name, search_list_common::postal, search_list_common::postal_mask, and search_list_common::town_name.
Referenced by search_list_house_number_destroy(), search_list_street_destroy(), and search_list_town_destroy().
|
static |
References search_list_common::attrs, search_list_common::c, and search_list_common_addattr().
Referenced by search_list_house_number_dup(), search_list_street_dup(), and search_list_town_dup().
|
static |
References search_list_common::attrs, search_list_common::county_name, search_list_common::district_name, item_attr_get(), item::map, map_convert_free(), map_convert_string(), search_list_common::postal, search_list_common::postal_mask, search_list_common_addattr(), attr::str, search_list_common::town_name, attr::type, and attr::u.
Referenced by search_list_house_number_new(), search_list_street_new(), and search_list_town_new().
|
static |
References search_list_country::car, search_list_country::flag, search_list_country::iso2, search_list_country::iso3, and search_list_country::name.
Referenced by search_address_results_free(), and search_list_result_destroy().
|
static |
References search_list_country::car, search_list_country::flag, search_list_country::iso2, search_list_country::iso3, and search_list_country::name.
Referenced by search_list_result_dup().
|
static |
References search_list_country::car, search_list_country::common, search_list_country::flag, search_list_country::iso2, search_list_country::iso3, item, search_list_common::item, item_attr_get(), search_list_country::name, attr::str, strtolower(), and attr::u.
Referenced by search_list_get_result().
void search_list_destroy | ( | struct search_list * | this_ | ) |
struct search_list_result* search_list_get_result | ( | struct search_list * | this_ | ) |
Get (next) result from a search.
this_ | search_list representing the search |
References search_list::address_results_pos, search_list_level::attr, search_list_common::c, search_list_result::c, search_list_country::common, search_list_town::common, search_list_street::common, search_list_house_number::common, search_list_result::country, search_list_level::curr, dbg, search_list_level::hash, search_list_result::house_number, search_list_house_number::house_number_interpolation, house_number_interpolation_clear_all(), search_list_result::id, search_list::inter, search_list::item, search_list_common::item, item_attr_get(), search_list_level::last, search_list::level, search_list::levels, lvl_debug, mapset_search_destroy(), mapset_search_get_item(), mapset_search_new(), search_list::ms, search_list_street::name, navit_utf8_strcasecmp(), p, search_list_level::parent, search_list_common::parent, search_list_level::partial, search_list::postal, postal_match(), search_list::result, search_list_level::search, search_add_result(), search_item_hash_equal(), search_item_hash_hash(), search_list_country_new(), search_list_house_number_destroy(), search_list_house_number_new(), search_list_result_destroy(), search_list_street_new(), search_list_town_new(), search_list_level::selected, search_list_common::selected, attr::str, search_list_result::street, search_list_result::town, attr::u, and search_list::use_address_results.
Referenced by android_search_idle(), changed(), gui_internal_search_idle(), gui_internal_search_list_set_default_country(), Java_org_navitproject_navit_NavitAddressSearchActivity_callbackStartAddressSearch(), Java_org_navitproject_navit_NavitGraphics_getAllCountries(), Java_org_navitproject_navit_NavitGraphics_getDefaultCountry(), NGQProxySearch::NGQProxySearch(), notify_apply(), notify_textchange(), request_search_list_get_result(), search_by_address_attr(), NGQProxySearch::searchXml(), NGQProxySearch::setCountryName(), NGQProxySearch::setPointToResult(), and Backend::updateSearch().
|
static |
|
static |
References search_list_house_number::common, search_list_house_number::house_number, map_convert_dup(), and search_list_common_dup().
Referenced by search_list_result_dup().
|
static |
References search_list_common::c, search_list_house_number::common, search_list_house_number::house_number, search_list_house_number::house_number_interpolation, item, search_list_common::item, item_attr_get(), item::map, map_convert_string(), search_house_number_coordinate(), search_list_common_new(), search_next_interpolated_house_number(), attr::str, and attr::u.
Referenced by search_list_get_result().
int search_list_level | ( | enum attr_type attr_type attr_type | ) |
Determine search list level for given attr_type.
attr_type | attribute value |
References attr_to_name(), dbg, and lvl_error.
Referenced by android_search_idle(), search_list_search(), and search_list_select().
struct search_list* search_list_new | ( | struct mapset * | ms | ) |
Create new instance of search_list to run a search.
ms | mapset that is to be searched |
References search_list::ms.
Referenced by create_destination_window(), destination_address(), gui_internal_search_list_new(), Java_org_navitproject_navit_NavitAddressSearchActivity_callbackStartAddressSearch(), Java_org_navitproject_navit_NavitGraphics_getAllCountries(), Java_org_navitproject_navit_NavitGraphics_getDefaultCountry(), NGQProxySearch::NGQProxySearch(), request_search_list_new(), search_by_address(), and Backend::updateSearch().
|
static |
References p, search_list_country_destroy(), search_list_house_number_destroy(), search_list_street_destroy(), and search_list_town_destroy().
Referenced by search_list_get_result(), and search_list_search_free().
|
static |
Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
References search_list_result::c, search_list_result::country, search_list_result::house_number, search_list_result::id, search_list_country_dup(), search_list_house_number_dup(), search_list_street_dup(), search_list_town_dup(), search_list_result::street, and search_list_result::town.
Referenced by search_by_address_attr().
void search_list_search | ( | struct search_list * | this_, |
struct attr * | search_attr, | ||
int | partial | ||
) |
Start a search.
this | search_list to use for the search |
search_attr | attributes to use for the search |
partial | do partial search? (1=yes,0=no) |
References search_list_level::attr, attr_dup(), attr_to_name(), search_list_level::curr, dbg, house_number_interpolation_clear_all(), search_list_result::id, search_list::inter, search_list::item, search_list::level, search_list::levels, search_list_level::list, lvl_info, search_list_level::partial, search_list::postal, search_list::result, search_address_results_free(), search_by_address(), search_list_level(), search_list_search_free(), attr::str, attr::type, attr::u, and search_list::use_address_results.
Referenced by android_search_idle(), changed(), gui_internal_search_changed(), gui_internal_search_list_set_default_country(), Java_org_navitproject_navit_NavitAddressSearchActivity_callbackStartAddressSearch(), Java_org_navitproject_navit_NavitGraphics_getAllCountries(), Java_org_navitproject_navit_NavitGraphics_getDefaultCountry(), NGQProxySearch::NGQProxySearch(), notify_apply(), notify_textchange(), request_search_list_search(), search_by_address_attr(), NGQProxySearch::searchXml(), NGQProxySearch::setCountryName(), NGQProxySearch::setPointToResult(), NGQProxySearch::setStreetName(), NGQProxySearch::setTownName(), start_search(), and Backend::updateSearch().
|
static |
struct search_list_common* search_list_select | ( | struct search_list * | this_, |
enum attr_type attr_type attr_type | , | ||
int | id, | ||
int | mode | ||
) |
References search_list_level::last, search_list::levels, search_list_level::list, search_list_level(), search_list_level::selected, and search_list_common::selected.
Referenced by gui_internal_cmd2_town(), gui_internal_search_house_number(), gui_internal_search_house_number_in_street(), gui_internal_search_street(), gui_internal_search_street_in_town(), gui_internal_search_town(), gui_internal_search_town_in_country(), and request_search_list_select().
|
static |
References search_list_street::common, map_convert_free(), search_list_street::name, and search_list_common_destroy().
Referenced by search_address_results_free(), and search_list_result_destroy().
|
static |
References search_list_street::common, map_convert_dup(), search_list_street::name, and search_list_common_dup().
Referenced by search_list_result_dup().
|
static |
References c, search_list_common::c, search_list_street::common, geom_line_middle(), item, search_list_common::item, item_attr_get(), item_coord_get(), item::map, map_convert_string(), map_projection(), search_list_street::name, p, pcoord::pro, search_list_common_new(), attr::str, attr::u, pcoord::x, and pcoord::y.
Referenced by search_list_get_result().
|
static |
References search_list_town::common, search_list_town::county, map_convert_free(), and search_list_common_destroy().
Referenced by search_address_results_free(), and search_list_result_destroy().
|
static |
References search_list_town::common, search_list_town::county, map_convert_dup(), and search_list_common_dup().
Referenced by search_list_result_dup().
|
static |
References c, search_list_common::c, search_list_town::common, search_list_town::county, dbg, item::id_hi, item::id_lo, attr::item, item, search_list_common::item, item_attr_get(), item_coord_get(), search_list_town::itemt, lvl_debug, item::map, map_convert_string(), map_projection(), pcoord::pro, search_list_common_new(), attr::str, attr::u, pcoord::x, and pcoord::y.
Referenced by search_list_get_result().
|
static |
References p.
Referenced by search_by_address_attr().
References dbg, phrase::end, lvl_debug, p, and phrase::start.
Referenced by search_by_address_attr().
char* search_postal_merge | ( | char * | mask, |
char * | new | ||
) |
References dbg, and lvl_debug.
Referenced by search_add_result(), and search_postal_merge_replace().
char* search_postal_merge_replace | ( | char * | mask, |
char * | new | ||
) |
References search_postal_merge().
|
static |
References phrase::end, phrase::start, and phrase::wordcount.
Referenced by search_by_address().