switch from libdbi to lbsqlite3

The choice of libdbi was one of the biggest early mistakes in (back
then) OpenBSC development.  A database abstraction library that
prevents you from using proper prepared statements.  Let's finally
abandon it and use sqlite3 directly, just like we do in osmo-hlr.

I decided to remove the database migration code as it would be relatively
cumbersome to port all of it to direct sqlite3 with prepared statements,
and it is prone to introduction of all kinds of errors.  Since we don't
have a body of older database files and comprehensive migration tests,
it is safer to not offer migration code of uncertain quality.  The last
schema revision (5) was introduced 5 years ago in 2017 (osmo-msc
v1.1.0), so it is considered an exceptionally rare case.  People can
install osmo-msc 1.1.0 through 1.8.0 to upgrade to v5 before using
this new 'direct sqlite3' version of osmo-msc.

Change-Id: Ia334904289f92d014e7bd16b02b3b5817c12c790
Related: OS#5559, OS#5563, OS#5564
diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h
index d9463a6..fc1781b 100644
--- a/include/osmocom/msc/db.h
+++ b/include/osmocom/msc/db.h
@@ -1,5 +1,6 @@
 /* (C) 2008 by Jan Luebbe <jluebbe@debian.org>
  * (C) 2009 by Holger Hans Peter Freyther <zecke@selfish.org>
+ * (C) 2022 by Harald Welte <laforge@osmocom.org>
  * All Rights Reserved
  *
  * This program is free software; you can redistribute it and/or modify
@@ -30,7 +31,7 @@
 struct gsm_sms;
 
 /* one time initialisation */
-int db_init(const char *name);
+int db_init(void *ctx, const char *fname, bool enable_sqlite_logging);
 int db_prepare(void);
 int db_fini(void);
 
@@ -39,12 +40,12 @@
 struct gsm_sms *db_sms_get(struct gsm_network *net, unsigned long long id);
 struct gsm_sms *db_sms_get_next_unsent(struct gsm_network *net,
 				       unsigned long long min_sms_id,
-				       unsigned int max_failed);
+				       int max_failed);
 struct gsm_sms *db_sms_get_next_unsent_rr_msisdn(struct gsm_network *net,
 						 const char *last_msisdn,
-						 unsigned int max_failed);
+						 int max_failed);
 struct gsm_sms *db_sms_get_unsent_for_subscr(struct vlr_subscr *vsub,
-					     unsigned int max_failed);
+					     int max_failed);
 int db_sms_mark_delivered(struct gsm_sms *sms);
 int db_sms_inc_deliver_attempts(struct gsm_sms *sms);
 int db_sms_delete_by_msisdn(const char *msisdn);