]> err.no Git - mapper/commitdiff
Add flag to say if osm db is usable or not. Not used for anything yet.
authorKaj-Michael Lang <milang@onion.tal.org>
Mon, 5 Nov 2007 17:21:36 +0000 (19:21 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Mon, 5 Nov 2007 17:21:36 +0000 (19:21 +0200)
src/osm-db.c

index 2663ffe41e0d178be762e604f39f7ca5f0235c91..6455e6a27562ca9dce46ca6be66248f5fca69e71 100644 (file)
@@ -47,6 +47,7 @@
 #define OSM_RANGE_STOP  (65535)
 
 static sqlite3 *osmdb;
+static gboolean osm_db_ok;
 
 struct sql_select_stmt {
        sqlite3_stmt *select_way;
@@ -222,6 +223,7 @@ if (osmdb!=NULL) {
        sqlite3_finalize(sql.select_near_place);
 }
 osmdb=NULL;
+osm_db_ok=FALSE;
 g_hash_table_destroy(place_cache);
 g_timer_destroy(dbt);
 }
@@ -229,6 +231,7 @@ g_timer_destroy(dbt);
 gboolean
 osm_init(sqlite3 **db)
 {
+osm_db_ok=FALSE;
 place_cache=g_hash_table_new(g_direct_hash, g_direct_equal);
 dbt=g_timer_new();
 
@@ -243,6 +246,7 @@ if (osm_db_prepare(osmdb)==FALSE) {
        g_printf("SQLITE: %s\n", sqlite3_errmsg(osmdb));
        return FALSE;
 }
+osm_db_ok=TRUE;
 return TRUE;
 }