In case there is any interest here is a proof-of-concept change implementing the above:
```
Index: src/main.c
==================================================================
--- src/main.c
+++ src/main.c
@@ -427,19 +427,17 @@
** This routine should only be called when there are no outstanding
** database connections or memory allocations. This routine is not
** threadsafe. Failure to heed these warnings can lead to unpredictable
** behavior.
*/
-int sqlite3_config(int op, ...){
- va_list ap;
+int sqlite3_vconfig(int op, va_list ap){
int rc = SQLITE_OK;
/* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
** the SQLite library is in use. */
if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT;
- va_start(ap, op);
switch( op ){
/* Mutex configuration options are only available in a threadsafe
** compile.
*/
@@ -730,10 +728,18 @@
default: {
rc = SQLITE_ERROR;
break;
}
}
+ return rc;
+}
+
+int sqlite3_config(int op, ...){
+ va_list ap;
+ int rc;
+ va_start(ap, op);
+ rc = sqlite3_vconfig(op, ap);
va_end(ap);
return rc;
}
/*
@@ -912,14 +918,12 @@
}
/*
** Configuration settings for an individual database connection
*/
-int sqlite3_db_config(sqlite3 *db, int op, ...){
- va_list ap;
+int sqlite3_db_vconfig(sqlite3 *db, int op, va_list ap){
int rc;
- va_start(ap, op);
switch( op ){
case SQLITE_DBCONFIG_MAINDBNAME: {
/* IMP: R-06824-28531 */
/* IMP: R-36257-52125 */
db->aDb[0].zDbSName = va_arg(ap,char*);
@@ -979,10 +983,18 @@
}
}
break;
}
}
+ return rc;
+}
+
+int sqlite3_db_config(sqlite3 *db, int op, ...){
+ va_list ap;
+ int rc;
+ va_start(ap, op);
+ rc = sqlite3_db_vconfig(db, op, ap);
va_end(ap);
return rc;
}
/*
```