@@ -193,6 +193,7 @@ module sqlite3
193193 public :: sqlite3_close_
194194 public :: sqlite3_close_v2
195195 public :: sqlite3_close_v2_
196+ public :: sqlite3_column_bytes
196197 public :: sqlite3_column_count
197198 public :: sqlite3_column_double
198199 public :: sqlite3_column_int
@@ -319,42 +320,42 @@ function sqlite3_backup_step(p, npage) bind(c, name='sqlite3_backup_step')
319320 integer (kind= c_int) :: sqlite3_backup_step
320321 end function sqlite3_backup_step
321322
322- ! int sqlite3_bind_double(sqlite3_stmt *stmt, int idx , double val)
323- function sqlite3_bind_double (stmt , idx , val ) bind(c, name= ' sqlite3_bind_double' )
323+ ! int sqlite3_bind_double(sqlite3_stmt *stmt, int icol , double val)
324+ function sqlite3_bind_double (stmt , icol , val ) bind(c, name= ' sqlite3_bind_double' )
324325 import :: c_double, c_int, c_ptr
325326 implicit none
326327 type (c_ptr), intent (in ), value :: stmt
327- integer (kind= c_int), intent (in ), value :: idx
328+ integer (kind= c_int), intent (in ), value :: icol
328329 real (kind= c_double), intent (in ), value :: val
329330 integer (kind= c_int) :: sqlite3_bind_double
330331 end function sqlite3_bind_double
331332
332- ! int sqlite3_bind_int(sqlite3_stmt *stmt, int idx , int val)
333- function sqlite3_bind_int (stmt , idx , val ) bind(c, name= ' sqlite3_bind_int' )
333+ ! int sqlite3_bind_int(sqlite3_stmt *stmt, int icol , int val)
334+ function sqlite3_bind_int (stmt , icol , val ) bind(c, name= ' sqlite3_bind_int' )
334335 import :: c_int, c_ptr
335336 implicit none
336337 type (c_ptr), intent (in ), value :: stmt
337- integer (kind= c_int), intent (in ), value :: idx
338+ integer (kind= c_int), intent (in ), value :: icol
338339 integer (kind= c_int), intent (in ), value :: val
339340 integer (kind= c_int) :: sqlite3_bind_int
340341 end function sqlite3_bind_int
341342
342- ! int sqlite3_bind_int(sqlite3_stmt *stmt, int idx , int val)
343- function sqlite3_bind_int64 (stmt , idx , val ) bind(c, name= ' sqlite3_bind_int64' )
343+ ! int sqlite3_bind_int(sqlite3_stmt *stmt, int icol , int val)
344+ function sqlite3_bind_int64 (stmt , icol , val ) bind(c, name= ' sqlite3_bind_int64' )
344345 import :: c_int, c_int64_t, c_ptr
345346 implicit none
346347 type (c_ptr), intent (in ), value :: stmt
347- integer (kind= c_int), intent (in ), value :: idx
348+ integer (kind= c_int), intent (in ), value :: icol
348349 integer (kind= c_int64_t), intent (in ), value :: val
349350 integer (kind= c_int) :: sqlite3_bind_int64
350351 end function sqlite3_bind_int64
351352
352- ! int sqlite3_bind_null(sqlite3_stmt *stmt, int idx )
353- function sqlite3_bind_null (stmt , idx ) bind(c, name= ' sqlite3_bind_null' )
353+ ! int sqlite3_bind_null(sqlite3_stmt *stmt, int icol )
354+ function sqlite3_bind_null (stmt , icol ) bind(c, name= ' sqlite3_bind_null' )
354355 import :: c_int, c_ptr
355356 implicit none
356357 type (c_ptr), intent (in ), value :: stmt
357- integer (kind= c_int), intent (in ), value :: idx
358+ integer (kind= c_int), intent (in ), value :: icol
358359 integer (kind= c_int) :: sqlite3_bind_null
359360 end function sqlite3_bind_null
360361
@@ -375,12 +376,12 @@ function sqlite3_bind_parameter_index_(stmt, name) bind(c, name='sqlite3_bind_pa
375376 integer (kind= c_int) :: sqlite3_bind_parameter_index_
376377 end function sqlite3_bind_parameter_index_
377378
378- ! int sqlite3_bind_text(sqlite3_stmt *stmt, int idx , const char *val, int l, void(*)(void*))
379- function sqlite3_bind_text_ (stmt , idx , val , l , destructor ) bind(c, name= ' sqlite3_bind_text' )
379+ ! int sqlite3_bind_text(sqlite3_stmt *stmt, int icol , const char *val, int l, void(*)(void*))
380+ function sqlite3_bind_text_ (stmt , icol , val , l , destructor ) bind(c, name= ' sqlite3_bind_text' )
380381 import :: c_char, c_funptr, c_int, c_ptr, c_size_t
381382 implicit none
382383 type (c_ptr), intent (in ), value :: stmt
383- integer (kind= c_int), intent (in ), value :: idx
384+ integer (kind= c_int), intent (in ), value :: icol
384385 character (kind= c_char), intent (in ) :: val
385386 integer (kind= c_int), intent (in ), value :: l
386387 integer (kind= c_size_t), intent (in ), value :: destructor
@@ -430,6 +431,15 @@ function sqlite3_close_v2_(db) bind(c, name='sqlite3_close_v2')
430431 integer (kind= c_int) :: sqlite3_close_v2_
431432 end function sqlite3_close_v2_
432433
434+ ! int sqlite3_column_bytes(sqlite3_stmt *stmt, int icol)
435+ function sqlite3_column_bytes (stmt , icol ) bind(c, name= ' sqlite3_column_bytes' )
436+ import :: c_int, c_ptr
437+ implicit none
438+ type (c_ptr), intent (in ), value :: stmt
439+ integer (kind= c_int), intent (in ), value :: icol
440+ integer (kind= c_int) :: sqlite3_column_bytes
441+ end function sqlite3_column_bytes
442+
433443 ! int sqlite3_column_count(sqlite3_stmt *stmt)
434444 function sqlite3_column_count (stmt ) bind(c, name= ' sqlite3_column_count' )
435445 import :: c_int, c_ptr
@@ -438,57 +448,57 @@ function sqlite3_column_count(stmt) bind(c, name='sqlite3_column_count')
438448 integer (kind= c_int) :: sqlite3_column_count
439449 end function sqlite3_column_count
440450
441- ! double sqlite3_column_double(sqlite3_stmt *stmt, int idx )
442- function sqlite3_column_double (stmt , idx ) bind(c, name= ' sqlite3_column_double' )
451+ ! double sqlite3_column_double(sqlite3_stmt *stmt, int icol )
452+ function sqlite3_column_double (stmt , icol ) bind(c, name= ' sqlite3_column_double' )
443453 import :: c_double, c_int, c_ptr
444454 implicit none
445455 type (c_ptr), intent (in ), value :: stmt
446- integer (kind= c_int), intent (in ), value :: idx
456+ integer (kind= c_int), intent (in ), value :: icol
447457 real (kind= c_double) :: sqlite3_column_double
448458 end function sqlite3_column_double
449459
450- ! int sqlite3_column_int(sqlite3_stmt *stmt, int idx )
451- function sqlite3_column_int (stmt , idx ) bind(c, name= ' sqlite3_column_int' )
460+ ! int sqlite3_column_int(sqlite3_stmt *stmt, int icol )
461+ function sqlite3_column_int (stmt , icol ) bind(c, name= ' sqlite3_column_int' )
452462 import :: c_int, c_ptr
453463 implicit none
454464 type (c_ptr), intent (in ), value :: stmt
455- integer (kind= c_int), intent (in ), value :: idx
465+ integer (kind= c_int), intent (in ), value :: icol
456466 integer (kind= c_int) :: sqlite3_column_int
457467 end function sqlite3_column_int
458468
459- ! sqlite3_int64 sqlite3_column_int64(sqlite3_stmt *stmt, int idx )
460- function sqlite3_column_int64 (stmt , idx ) bind(c, name= ' sqlite3_column_int64' )
469+ ! sqlite3_int64 sqlite3_column_int64(sqlite3_stmt *stmt, int icol )
470+ function sqlite3_column_int64 (stmt , icol ) bind(c, name= ' sqlite3_column_int64' )
461471 import :: c_int, c_int64_t, c_ptr
462472 implicit none
463473 type (c_ptr), intent (in ), value :: stmt
464- integer (kind= c_int), intent (in ), value :: idx
474+ integer (kind= c_int), intent (in ), value :: icol
465475 integer (kind= c_int) :: sqlite3_column_int64
466476 end function sqlite3_column_int64
467477
468- ! const char *sqlite3_column_name(sqlite3_stmt *stmt, int idx )
469- function sqlite3_column_name_ (stmt , idx ) bind(c, name= ' sqlite3_column_name' )
478+ ! const char *sqlite3_column_name(sqlite3_stmt *stmt, int icol )
479+ function sqlite3_column_name_ (stmt , icol ) bind(c, name= ' sqlite3_column_name' )
470480 import :: c_int, c_ptr
471481 implicit none
472482 type (c_ptr), intent (in ), value :: stmt
473- integer (kind= c_int), intent (in ), value :: idx
483+ integer (kind= c_int), intent (in ), value :: icol
474484 type (c_ptr) :: sqlite3_column_name_
475485 end function sqlite3_column_name_
476486
477- ! const unsigned char *sqlite3_column_text(sqlite3_stmt *stmt, int idx )
478- function sqlite3_column_text_ (stmt , idx ) bind(c, name= ' sqlite3_column_text' )
487+ ! const unsigned char *sqlite3_column_text(sqlite3_stmt *stmt, int icol )
488+ function sqlite3_column_text_ (stmt , icol ) bind(c, name= ' sqlite3_column_text' )
479489 import :: c_int, c_ptr
480490 implicit none
481491 type (c_ptr), intent (in ), value :: stmt
482- integer (kind= c_int), intent (in ), value :: idx
492+ integer (kind= c_int), intent (in ), value :: icol
483493 type (c_ptr) :: sqlite3_column_text_
484494 end function sqlite3_column_text_
485495
486- ! int sqlite3_column_type(sqlite3_stmt *stmt, int idx )
487- function sqlite3_column_type (stmt , idx ) bind(c, name= ' sqlite3_column_type' )
496+ ! int sqlite3_column_type(sqlite3_stmt *stmt, int icol )
497+ function sqlite3_column_type (stmt , icol ) bind(c, name= ' sqlite3_column_type' )
488498 import :: c_int, c_ptr
489499 implicit none
490500 type (c_ptr), intent (in ), value :: stmt
491- integer (kind= c_int), intent (in ), value :: idx
501+ integer (kind= c_int), intent (in ), value :: icol
492502 integer (kind= c_int) :: sqlite3_column_type
493503 end function sqlite3_column_type
494504
@@ -891,30 +901,30 @@ end subroutine sqlite3_str_reset
891901
892902#if SQLITE_ENABLE_COLUMN_METADATA
893903 interface
894- ! const char *sqlite3_column_database_name(sqlite3_stmt *stmt, int idx )
895- function sqlite3_column_database_name_ (stmt , idx ) bind(c, name= ' sqlite3_column_database_name' )
904+ ! const char *sqlite3_column_database_name(sqlite3_stmt *stmt, int icol )
905+ function sqlite3_column_database_name_ (stmt , icol ) bind(c, name= ' sqlite3_column_database_name' )
896906 import :: c_int, c_ptr
897907 implicit none
898908 type (c_ptr), intent (in ), value :: stmt
899- integer (kind= c_int), intent (in ), value :: idx
909+ integer (kind= c_int), intent (in ), value :: icol
900910 type (c_ptr) :: sqlite3_column_database_name_
901911 end function sqlite3_column_database_name_
902912
903- ! const char *sqlite3_column_origin_name(sqlite3_stmt *stmt, int idx )
904- function sqlite3_column_origin_name_ (stmt , idx ) bind(c, name= ' sqlite3_column_origin_name' )
913+ ! const char *sqlite3_column_origin_name(sqlite3_stmt *stmt, int icol )
914+ function sqlite3_column_origin_name_ (stmt , icol ) bind(c, name= ' sqlite3_column_origin_name' )
905915 import :: c_int, c_ptr
906916 implicit none
907917 type (c_ptr), intent (in ), value :: stmt
908- integer (kind= c_int), intent (in ), value :: idx
918+ integer (kind= c_int), intent (in ), value :: icol
909919 type (c_ptr) :: sqlite3_column_origin_name_
910920 end function sqlite3_column_origin_name_
911921
912- ! const char *sqlite3_column_table_name(sqlite3_stmt *stmt, int idx )
913- function sqlite3_column_table_name_ (stmt , idx ) bind(c, name= ' sqlite3_column_table_name' )
922+ ! const char *sqlite3_column_table_name(sqlite3_stmt *stmt, int icol )
923+ function sqlite3_column_table_name_ (stmt , icol ) bind(c, name= ' sqlite3_column_table_name' )
914924 import :: c_int, c_ptr
915925 implicit none
916926 type (c_ptr), intent (in ), value :: stmt
917- integer (kind= c_int), intent (in ), value :: idx
927+ integer (kind= c_int), intent (in ), value :: icol
918928 type (c_ptr) :: sqlite3_column_table_name_
919929 end function sqlite3_column_table_name_
920930 end interface
@@ -941,21 +951,21 @@ function sqlite3_bind_parameter_index(stmt, name)
941951 sqlite3_bind_parameter_index = sqlite3_bind_parameter_index_(stmt, name // c_null_char)
942952 end function sqlite3_bind_parameter_index
943953
944- function sqlite3_bind_text (stmt , idx , val , destructor )
954+ function sqlite3_bind_text (stmt , icol , val , destructor )
945955 ! ! Binds text to column. This wrapper passes destructor
946956 ! ! `SQLITE_TRANSIENT` by default!
947957 type (c_ptr), intent (inout ) :: stmt
948- integer , intent (in ) :: idx
958+ integer , intent (in ) :: icol
949959 character (len=* ), intent (in ) :: val
950960 integer (kind= c_size_t), intent (in ), optional :: destructor
951961 integer :: sqlite3_bind_text
952962
953963 if (present (destructor)) then
954- sqlite3_bind_text = sqlite3_bind_text_(stmt, idx , val, len (val), destructor)
964+ sqlite3_bind_text = sqlite3_bind_text_(stmt, icol , val, len (val), destructor)
955965 return
956966 end if
957967
958- sqlite3_bind_text = sqlite3_bind_text_(stmt, idx , val, len (val), SQLITE_TRANSIENT)
968+ sqlite3_bind_text = sqlite3_bind_text_(stmt, icol , val, len (val), SQLITE_TRANSIENT)
959969 end function sqlite3_bind_text
960970
961971 function sqlite3_close (db )
@@ -974,23 +984,23 @@ function sqlite3_close_v2(db)
974984 if (sqlite3_close_v2 == SQLITE_OK) db = c_null_ptr
975985 end function sqlite3_close_v2
976986
977- function sqlite3_column_name (stmt , idx )
987+ function sqlite3_column_name (stmt , icol )
978988 type (c_ptr), intent (inout ) :: stmt
979- integer , intent (in ) :: idx
989+ integer , intent (in ) :: icol
980990 character (len= :), allocatable :: sqlite3_column_name
981991 type (c_ptr) :: ptr
982992
983- ptr = sqlite3_column_name_(stmt, idx )
993+ ptr = sqlite3_column_name_(stmt, icol )
984994 call c_f_str_ptr(ptr, sqlite3_column_name)
985995 end function sqlite3_column_name
986996
987- function sqlite3_column_text (stmt , idx )
997+ function sqlite3_column_text (stmt , icol )
988998 type (c_ptr), intent (inout ) :: stmt
989- integer , intent (in ) :: idx
999+ integer , intent (in ) :: icol
9901000 character (len= :), allocatable :: sqlite3_column_text
9911001 type (c_ptr) :: ptr
9921002
993- ptr = sqlite3_column_text_(stmt, idx )
1003+ ptr = sqlite3_column_text_(stmt, icol )
9941004 call c_f_str_ptr(ptr, sqlite3_column_text)
9951005 end function sqlite3_column_text
9961006
@@ -1169,33 +1179,33 @@ subroutine sqlite3_log(ierr_code, str)
11691179 end subroutine sqlite3_log
11701180
11711181#if SQLITE_ENABLE_COLUMN_METADATA
1172- function sqlite3_column_database_name (stmt , idx )
1182+ function sqlite3_column_database_name (stmt , icol )
11731183 type (c_ptr), intent (inout ) :: stmt
1174- integer , intent (in ) :: idx
1184+ integer , intent (in ) :: icol
11751185 character (len= :), allocatable :: sqlite3_column_database_name
11761186 type (c_ptr) :: ptr
11771187
1178- ptr = sqlite3_column_database_name_(stmt, idx )
1188+ ptr = sqlite3_column_database_name_(stmt, icol )
11791189 call c_f_str_ptr(ptr, sqlite3_column_database_name)
11801190 end function sqlite3_column_database_name
11811191
1182- function sqlite3_column_origin_name (stmt , idx )
1192+ function sqlite3_column_origin_name (stmt , icol )
11831193 type (c_ptr), intent (inout ) :: stmt
1184- integer , intent (in ) :: idx
1194+ integer , intent (in ) :: icol
11851195 character (len= :), allocatable :: sqlite3_column_origin_name
11861196 type (c_ptr) :: ptr
11871197
1188- ptr = sqlite3_column_origin_name_(stmt, idx )
1198+ ptr = sqlite3_column_origin_name_(stmt, icol )
11891199 call c_f_str_ptr(ptr, sqlite3_column_origin_name)
11901200 end function sqlite3_column_origin_name
11911201
1192- function sqlite3_column_table_name (stmt , idx )
1202+ function sqlite3_column_table_name (stmt , icol )
11931203 type (c_ptr), intent (inout ) :: stmt
1194- integer , intent (in ) :: idx
1204+ integer , intent (in ) :: icol
11951205 character (len= :), allocatable :: sqlite3_column_table_name
11961206 type (c_ptr) :: ptr
11971207
1198- ptr = sqlite3_column_table_name_(stmt, idx )
1208+ ptr = sqlite3_column_table_name_(stmt, icol )
11991209 call c_f_str_ptr(ptr, sqlite3_column_table_name)
12001210 end function sqlite3_column_table_name
12011211#endif
0 commit comments