+int get_notify_count(gchar *notify_type)
+{
+ sqlite3 *db = NULL;
+ sqlite3 *res = NULL;
+ gint rc = 0, result = 0;
+ gchar sql[1024];
+
+ rc = sqlite3_open("/home/user/.config/hildon-desktop/notifications.db", &db);
+ if (rc){
+ fprintf(stderr, "error open db %d %s\n", rc, sqlite3_errmsg(db));
+ }else {
+ snprintf(sql, sizeof(sql)-1, "select count(id) from notifications where icon_name='general_%s'", notify_type);
+ rc = sqlite3_prepare(db, sql, sizeof(sql)-1, &res, NULL);
+ if (rc != SQLITE_OK){
+ fprintf(stderr, "error prepare %d %s\n", rc, sql);
+ }
+ if (sqlite3_step(res) != SQLITE_ROW){
+ fprintf(stderr, "not sqlite_row\n");
+ }
+ result = sqlite3_column_int(res, 0);
+ //fprintf(stderr, "count missing calls = %d\n", call_count);
+ sqlite3_finalize(res);
+
+ sqlite3_close(db);
+ }
+ return result;
+}
+