From 73c10467282a5de147c7069caa945dcea0a81003 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 5 Nov 2007 19:21:36 +0200 Subject: [PATCH] Add flag to say if osm db is usable or not. Not used for anything yet. --- src/osm-db.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/osm-db.c b/src/osm-db.c index 2663ffe..6455e6a 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -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; } -- 2.39.5