aboutsummaryrefslogtreecommitdiffstats
path: root/src/sqlite.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sqlite.c')
-rw-r--r--src/sqlite.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sqlite.c b/src/sqlite.c
index ac860f55bcd..c2f90d6a871 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -55,6 +55,7 @@ DEF_DLL_FN (SQLITE_API const char*, sqlite3_errmsg, (sqlite3*));
55#if SQLITE_VERSION_NUMBER >= 3007015 55#if SQLITE_VERSION_NUMBER >= 3007015
56DEF_DLL_FN (SQLITE_API const char*, sqlite3_errstr, (int)); 56DEF_DLL_FN (SQLITE_API const char*, sqlite3_errstr, (int));
57#endif 57#endif
58DEF_DLL_FN (SQLITE_API const char*, sqlite3_libversion, (void));
58DEF_DLL_FN (SQLITE_API int, sqlite3_step, (sqlite3_stmt*)); 59DEF_DLL_FN (SQLITE_API int, sqlite3_step, (sqlite3_stmt*));
59DEF_DLL_FN (SQLITE_API int, sqlite3_changes, (sqlite3*)); 60DEF_DLL_FN (SQLITE_API int, sqlite3_changes, (sqlite3*));
60DEF_DLL_FN (SQLITE_API int, sqlite3_column_count, (sqlite3_stmt*)); 61DEF_DLL_FN (SQLITE_API int, sqlite3_column_count, (sqlite3_stmt*));
@@ -96,6 +97,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension,
96# if SQLITE_VERSION_NUMBER >= 3007015 97# if SQLITE_VERSION_NUMBER >= 3007015
97# undef sqlite3_errstr 98# undef sqlite3_errstr
98# endif 99# endif
100# undef sqlite3_libversion
99# undef sqlite3_step 101# undef sqlite3_step
100# undef sqlite3_changes 102# undef sqlite3_changes
101# undef sqlite3_column_count 103# undef sqlite3_column_count
@@ -124,6 +126,7 @@ DEF_DLL_FN (SQLITE_API int, sqlite3_load_extension,
124# if SQLITE_VERSION_NUMBER >= 3007015 126# if SQLITE_VERSION_NUMBER >= 3007015
125# define sqlite3_errstr fn_sqlite3_errstr 127# define sqlite3_errstr fn_sqlite3_errstr
126# endif 128# endif
129# define sqlite3_libversion fn_sqlite3_libversion
127# define sqlite3_step fn_sqlite3_step 130# define sqlite3_step fn_sqlite3_step
128# define sqlite3_changes fn_sqlite3_changes 131# define sqlite3_changes fn_sqlite3_changes
129# define sqlite3_column_count fn_sqlite3_column_count 132# define sqlite3_column_count fn_sqlite3_column_count
@@ -155,6 +158,7 @@ load_dll_functions (HMODULE library)
155#if SQLITE_VERSION_NUMBER >= 3007015 158#if SQLITE_VERSION_NUMBER >= 3007015
156 LOAD_DLL_FN (library, sqlite3_errstr); 159 LOAD_DLL_FN (library, sqlite3_errstr);
157#endif 160#endif
161 LOAD_DLL_FN (library, sqlite3_libversion);
158 LOAD_DLL_FN (library, sqlite3_step); 162 LOAD_DLL_FN (library, sqlite3_step);
159 LOAD_DLL_FN (library, sqlite3_changes); 163 LOAD_DLL_FN (library, sqlite3_changes);
160 LOAD_DLL_FN (library, sqlite3_column_count); 164 LOAD_DLL_FN (library, sqlite3_column_count);
@@ -763,6 +767,15 @@ This will free the resources held by SET. */)
763 return Qt; 767 return Qt;
764} 768}
765 769
770DEFUN ("sqlite-version", Fsqlite_version, Ssqlite_version, 0, 0, 0,
771 doc: /* SQLite library version string. */)
772 (void)
773{
774 if (!init_sqlite_functions ())
775 error ("sqlite support is not available");
776 return build_string (sqlite3_libversion ());
777}
778
766#endif /* HAVE_SQLITE3 */ 779#endif /* HAVE_SQLITE3 */
767 780
768DEFUN ("sqlitep", Fsqlitep, Ssqlitep, 1, 1, 0, 781DEFUN ("sqlitep", Fsqlitep, Ssqlitep, 1, 1, 0,
@@ -814,6 +827,7 @@ syms_of_sqlite (void)
814 defsubr (&Ssqlite_columns); 827 defsubr (&Ssqlite_columns);
815 defsubr (&Ssqlite_more_p); 828 defsubr (&Ssqlite_more_p);
816 defsubr (&Ssqlite_finalize); 829 defsubr (&Ssqlite_finalize);
830 defsubr (&Ssqlite_version);
817 DEFSYM (Qset, "set"); 831 DEFSYM (Qset, "set");
818 DEFSYM (Qfull, "full"); 832 DEFSYM (Qfull, "full");
819#endif 833#endif