@@ -108,6 +108,36 @@ module sqlite
108108 integer , parameter , public :: SQLITE_DBSTATUS_CACHE_SPILL = 12
109109 integer , parameter , public :: SQLITE_DBSTATUS_MAX = 12 ! Largest defined DBSTATUS.
110110
111+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_SINGLETHREAD = 1 ! nil
112+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_MULTITHREAD = 2 ! nil
113+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_SERIALIZED = 3 ! nil
114+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_MALLOC = 4 ! sqlite3_mem_methods*
115+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_GETMALLOC = 5 ! sqlite3_mem_methods*
116+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_SCRATCH = 6 ! No longer used
117+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_PAGECACHE = 7 ! void*, int sz, int N
118+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_HEAP = 8 ! void*, int nByte, int min
119+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_MEMSTATUS = 9 ! boolean
120+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_MUTEX = 10 ! sqlite3_mutex_methods*
121+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_GETMUTEX = 11 ! sqlite3_mutex_methods*
122+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_CHUNKALLOC = 12 ! unused
123+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_LOOKASIDE = 13 ! int int
124+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_PCACHE = 14 ! no-op
125+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_GETPCACHE = 15 ! no-op
126+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_LOG = 16 ! xFunc, void*
127+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_URI = 17 ! int
128+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_PCACHE2 = 18 ! sqlite3_pcache_methods2*
129+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_GETPCACHE2 = 19 ! sqlite3_pcache_methods2*
130+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_COVERING_INDEX_SCAN = 20 ! int
131+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_SQLLOG = 21 ! xSqllog, void*
132+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_MMAP_SIZE = 22 ! sqlite3_int64, sqlite3_int64
133+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_WIN32_HEAPSIZE = 23 ! int nByte
134+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_PCACHE_HDRSZ = 24 ! int *psz
135+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_PMASZ = 25 ! unsigned int szPma
136+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_STMTJRNL_SPILL = 26 ! int nByte
137+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_SMALL_MALLOC = 27 ! boolean
138+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_SORTERREF_SIZE = 28 ! int nByte
139+ integer (kind= c_int), parameter , public :: SQLITE_CONFIG_MEMDB_MAXSIZE = 29 ! sqlite3_int64
140+
111141 integer (kind= c_size_t), parameter , public :: SQLITE_STATIC = 0
112142 integer (kind= c_size_t), parameter , public :: SQLITE_TRANSIENT = - 1
113143
@@ -123,6 +153,10 @@ module sqlite
123153 public :: sqlite3_column_int64
124154 public :: sqlite3_column_text
125155 public :: sqlite3_column_type
156+ public :: sqlite3_config
157+ public :: sqlite3_config_funptr_ptr_
158+ public :: sqlite3_config_int_
159+ public :: sqlite3_config_null_
126160 public :: sqlite3_data_count
127161 public :: sqlite3_db_status
128162 public :: sqlite3_errcode
@@ -132,6 +166,7 @@ module sqlite
132166 public :: sqlite3_exec_
133167 public :: sqlite3_finalize
134168 public :: sqlite3_free
169+ public :: sqlite3_initialize
135170 public :: sqlite3_last_insert_rowid
136171 public :: sqlite3_libversion
137172 public :: sqlite3_libversion_
@@ -143,6 +178,7 @@ module sqlite
143178 public :: sqlite3_prepare_v2
144179 public :: sqlite3_prepare_v2_
145180 public :: sqlite3_reset
181+ public :: sqlite3_shutdown
146182 public :: sqlite3_sleep
147183 public :: sqlite3_sourceid
148184 public :: sqlite3_sourceid_
@@ -267,6 +303,33 @@ function sqlite3_column_type(stmt, icol) bind(c, name='sqlite3_column_type')
267303 integer (kind= c_int) :: sqlite3_column_type
268304 end function sqlite3_column_type
269305
306+ ! int sqlite3_config(int option, ...)
307+ function sqlite3_config_funptr_ptr_ (option , funptr , ptr ) bind(c, name= ' sqlite3_config' )
308+ import :: c_funptr, c_int, c_ptr
309+ implicit none
310+ integer (kind= c_int), intent (in ), value :: option
311+ type (c_funptr), intent (in ), value :: funptr
312+ type (c_ptr), intent (in ), value :: ptr
313+ integer (kind= c_int) :: sqlite3_config_funptr_ptr_
314+ end function sqlite3_config_funptr_ptr_
315+
316+ ! int sqlite3_config(int option, ...)
317+ function sqlite3_config_int_ (option , arg ) bind(c, name= ' sqlite3_config' )
318+ import :: c_int
319+ implicit none
320+ integer (kind= c_int), intent (in ), value :: option
321+ integer (kind= c_int), intent (in ), value :: arg
322+ integer (kind= c_int) :: sqlite3_config_int_
323+ end function sqlite3_config_int_
324+
325+ ! int sqlite3_config(int option, ...)
326+ function sqlite3_config_null_ (option ) bind(c, name= ' sqlite3_config' )
327+ import :: c_int
328+ implicit none
329+ integer (kind= c_int), intent (in ), value :: option
330+ integer (kind= c_int) :: sqlite3_config_null_
331+ end function sqlite3_config_null_
332+
270333 ! int sqlite3_data_count(sqlite3_stmt *stmt)
271334 function sqlite3_data_count (stmt ) bind(c, name= ' sqlite3_data_count' )
272335 import :: c_int, c_ptr
@@ -323,6 +386,13 @@ function sqlite3_finalize(stmt) bind(c, name='sqlite3_finalize')
323386 integer (kind= c_int) :: sqlite3_finalize
324387 end function sqlite3_finalize
325388
389+ ! int sqlite3_initialize(void)
390+ function sqlite3_initialize () bind(c, name= ' sqlite3_initialize' )
391+ import :: c_int
392+ implicit none
393+ integer (kind= c_int) :: sqlite3_initialize
394+ end function sqlite3_initialize
395+
326396 ! sqlite3_int64 sqlite3_last_insert_rowid(sqlite3 *db)
327397 function sqlite3_last_insert_rowid (db ) bind(c, name= ' sqlite3_last_insert_rowid' )
328398 import :: c_int64_t, c_ptr
@@ -386,6 +456,13 @@ function sqlite3_reset(stmt) bind(c, name='sqlite3_reset')
386456 integer (kind= c_int) :: sqlite3_reset
387457 end function sqlite3_reset
388458
459+ ! int sqlite3_shutdown(void)
460+ function sqlite3_shutdown () bind(c, name= ' sqlite3_shutdown' )
461+ import :: c_int
462+ implicit none
463+ integer (kind= c_int) :: sqlite3_shutdown
464+ end function sqlite3_shutdown
465+
389466 ! int sqlite3_sleep(int t)
390467 function sqlite3_sleep (t ) bind(c, name= ' sqlite3_sleep' )
391468 import :: c_int
@@ -531,6 +608,12 @@ function c_strlen(str) bind(c, name='strlen')
531608 integer (c_size_t) :: c_strlen
532609 end function c_strlen
533610 end interface
611+
612+ interface sqlite3_config
613+ module procedure :: sqlite3_config_funptr_ptr
614+ module procedure :: sqlite3_config_int
615+ module procedure :: sqlite3_config_null
616+ end interface
534617contains
535618 pure function copy (a )
536619 character , intent (in ) :: a(:)
@@ -584,6 +667,30 @@ function sqlite3_column_text(stmt, icol)
584667 call c_f_str_ptr(ptr, sqlite3_column_text)
585668 end function sqlite3_column_text
586669
670+ function sqlite3_config_int (option , arg )
671+ integer , intent (in ) :: option
672+ integer , intent (in ) :: arg
673+ integer :: sqlite3_config_int
674+
675+ sqlite3_config_int = sqlite3_config_int_(option, arg)
676+ end function sqlite3_config_int
677+
678+ function sqlite3_config_funptr_ptr (option , funptr , ptr )
679+ integer , intent (in ) :: option
680+ type (c_funptr), intent (in ) :: funptr
681+ type (c_ptr), intent (in ) :: ptr
682+ integer :: sqlite3_config_funptr_ptr
683+
684+ sqlite3_config_funptr_ptr = sqlite3_config_funptr_ptr_(option, funptr, ptr)
685+ end function sqlite3_config_funptr_ptr
686+
687+ function sqlite3_config_null (option )
688+ integer , intent (in ) :: option
689+ integer :: sqlite3_config_null
690+
691+ sqlite3_config_null = sqlite3_config_null_(option)
692+ end function sqlite3_config_null
693+
587694 function sqlite3_errmsg (db )
588695 type (c_ptr), intent (in ) :: db
589696 character (len= :), allocatable :: sqlite3_errmsg
0 commit comments