db_prepare(void)
{
/* Way nodes */
-sqlite3_prepare(db, "insert into nodes (nid,lat,lon,l) values (?, ?, ?, 0)",
+sqlite3_prepare_v2(db, "insert into nodes (nid,lat,lon,l) values (?, ?, ?, 0)",
-1, &sql.insert_node, NULL);
-sqlite3_prepare(db, "select lat,lon,l from nodes where nid=?",
+sqlite3_prepare_v2(db, "select lat,lon,l from nodes where nid=?",
-1, &sql.select_node, NULL);
-sqlite3_prepare(db, "delete from nodes", -1, &sql.delete_nodes, NULL);
-sqlite3_prepare(db, "update nodes set l=l+1 where nid=?", -1, &sql.update_node, NULL);
+sqlite3_prepare_v2(db, "delete from nodes", -1, &sql.delete_nodes, NULL);
+sqlite3_prepare_v2(db, "update nodes set l=l+1 where nid=?", -1, &sql.update_node, NULL);
/* Places */
-sqlite3_prepare(db, "insert into places (nid,type,name,isin) values (?, ?, ?, ?)",
+sqlite3_prepare_v2(db, "insert into places (nid,type,name,isin) values (?, ?, ?, ?)",
-1, &sql.insert_place, NULL);
-sqlite3_prepare(db, "delete from places", -1, &sql.delete_place, NULL);
+sqlite3_prepare_v2(db, "delete from places", -1, &sql.delete_place, NULL);
/* POI nodes */
-sqlite3_prepare(db, "insert into poi (osm_id, lat, lon, label, desc, cat_id, public, priority)"
+sqlite3_prepare_v2(db, "insert into poi (osm_id, lat, lon, label, desc, cat_id, public, priority)"
" values (?, ?, ?, ?, ?, ?, 1, ?)", -1, &sql.insert_poi, NULL);
-sqlite3_prepare(db, "delete from poi where osm_id>0", -1, &sql.delete_osm_poi, NULL);
+sqlite3_prepare_v2(db, "delete from poi where osm_id>0", -1, &sql.delete_osm_poi, NULL);
/* Ways */
-sqlite3_prepare(db, "insert into way (wid,nodes,type,flags) values (?, ?, ?, ?)",
+sqlite3_prepare_v2(db, "insert into way (wid,nodes,type,flags) values (?, ?, ?, ?)",
-1, &sql.insert_way_data, NULL);
-sqlite3_prepare(db, "delete from way", -1,
+sqlite3_prepare_v2(db, "delete from way", -1,
&sql.delete_way, NULL);
-sqlite3_prepare(db, "insert into way_seg (wsid,num,node) values (?, ?, ?)",
+sqlite3_prepare_v2(db, "insert into way_seg (wsid,num,node) values (?, ?, ?)",
-1, &sql.insert_way_seg, NULL);
-sqlite3_prepare(db, "delete from way_seg", -1,
+sqlite3_prepare_v2(db, "delete from way_seg", -1,
&sql.delete_way_seg, NULL);
-sqlite3_prepare(db, "insert into way_names (wid,name) values (?, ?)",
+sqlite3_prepare_v2(db, "insert into way_names (wid,name) values (?, ?)",
-1, &sql.insert_way_name, NULL);
-sqlite3_prepare(db, "delete from way_names", -1,
+sqlite3_prepare_v2(db, "delete from way_names", -1,
&sql.delete_way_name, NULL);
-sqlite3_prepare(db, "insert into way_ref (rid,ref,int_ref) values (?, ?, ?)",
+sqlite3_prepare_v2(db, "insert into way_ref (rid,ref,int_ref) values (?, ?, ?)",
-1, &sql.insert_way_ref, NULL);
-sqlite3_prepare(db, "delete from way_ref", -1,
+sqlite3_prepare_v2(db, "delete from way_ref", -1,
&sql.delete_way_ref, NULL);
}
if (value->data==NULL)
return;
-if (value->data->name==NULL)
- return;
-
if (value->data->type>NODE_POI_START && value->data->type<NODE_POI_END) {
db_insert_poi(value);
/* Free the extra info, we don't need it anymore */
for (i=0; nodeinfo[i].k; i++) {
if (strcasecmp (nodeinfo[i].k, k)==0 && strcasecmp (v, nodeinfo[i].v)==0) {
cnode->data->type=nodeinfo[i].type;
+ break;
}
}
}
if (wayinfo[i].oneway==TRUE)
cway->flags|=W_ONEWAY;
cway->type=wayinfo[i].type;
+ break;
}
}
}