sqlite3_stmt *select_way_nodes;
sqlite3_stmt *select_way_name;
sqlite3_stmt *select_way_name_nls;
+ sqlite3_stmt *select_way_name_search;
sqlite3_stmt *select_way_ref;
sqlite3_stmt *select_place;
sqlite3_stmt *select_near_place;
-1, &sql.select_way2, NULL)!=SQLITE_OK)
return FALSE;
+if (sqlite3_prepare_v2(db, "select w.wid,w.name as name from way_names where w.type between $WTS and $WTY and w.name like ? "
+ " union "
+ " select w.wid,n.name as name from way_names as w,way_names_nls as n on w.wid=n.wid where "
+ " w.type between $WTS and $WTY and n.name like ? order by name",
+ -1, &sql.select_way_name_search, NULL)!=SQLITE_OK)
+ return FALSE;
+
if (sqlite3_prepare_v2(db, "select wn.t,lat,lon from way_n2n as wn,nodes where wsid=? and wn.f=? and wn.t=nodes.nid limit 1",
-1, &sql.select_way_next_seg, NULL)!=SQLITE_OK)
return FALSE;
if (sqlite3_prepare_v2(db, "select name from way_names where wid=?",
-1, &sql.select_way_name, NULL)!=SQLITE_OK)
return FALSE;
-#if 0
-if (sqlite3_prepare_v2(db, "select name from way_names_nls where wid=? and lang=?",
- -1, &sql.select_way_name, NULL)!=SQLITE_OK)
- return FALSE;
-#endif
/* Way ref and int_ref */
if (sqlite3_prepare_v2(db, "select ref,int_ref from way_ref where rid=?",
void
osm_deinit(void)
{
+sqlite3_finalize(sql.select_way_ref);
+sqlite3_finalize(sql.select_way_name);
+sqlite3_finalize(sql.select_way_next_seg);
+sqlite3_finalize(sql.select_way_prev_seg);
+sqlite3_finalize(sql.select_way_name_search);
+sqlite3_finalize(sql.select_way2);
+sqlite3_finalize(sql.select_place);
+sqlite3_finalize(sql.select_near_place);
osmdb=NULL;
g_hash_table_destroy(place_cache);
g_timer_destroy(dbt);