From 18657a960e125336f704ea058e25c27bd3900dcb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 5 May 2024 19:28:19 +0200 Subject: Adding upstream version 3.40.1. Signed-off-by: Daniel Baumann --- www/c3ref/auto_extension.html | 163 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 www/c3ref/auto_extension.html (limited to 'www/c3ref/auto_extension.html') diff --git a/www/c3ref/auto_extension.html b/www/c3ref/auto_extension.html new file mode 100644 index 0000000..9eddf12 --- /dev/null +++ b/www/c3ref/auto_extension.html @@ -0,0 +1,163 @@ + + + + + +Automatically Load Statically Linked Extensions + + + +
+ + + +
+
+Small. Fast. Reliable.
Choose any three. +
+ + +
+
+ + + +
+
+
+ + +
+

SQLite C Interface

+

Automatically Load Statically Linked Extensions

+
+
+int sqlite3_auto_extension(void(*xEntryPoint)(void));
+
+

+This interface causes the xEntryPoint() function to be invoked for +each new database connection that is created. The idea here is that +xEntryPoint() is the entry point for a statically linked SQLite extension +that is to be automatically loaded into all new database connections.

+ +

Even though the function prototype shows that xEntryPoint() takes +no arguments and returns void, SQLite invokes xEntryPoint() with three +arguments and expects an integer result as if the signature of the +entry point where as follows:

+ +

+   int xEntryPoint(
+     sqlite3 *db,
+     const char **pzErrMsg,
+     const struct sqlite3_api_routines *pThunk
+   );
+

+ +

If the xEntryPoint routine encounters an error, it should make *pzErrMsg +point to an appropriate error message (obtained from sqlite3_mprintf()) +and return an appropriate error code. SQLite ensures that *pzErrMsg +is NULL before calling the xEntryPoint(). SQLite will invoke +sqlite3_free() on *pzErrMsg after xEntryPoint() returns. If any +xEntryPoint() returns an error, the sqlite3_open(), sqlite3_open16(), +or sqlite3_open_v2() call that provoked the xEntryPoint() will fail.

+ +

Calling sqlite3_auto_extension(X) with an entry point X that is already +on the list of automatic extensions is a harmless no-op. No entry point +will be called more than once for each database connection that is opened.

+ +

See also: sqlite3_reset_auto_extension() +and sqlite3_cancel_auto_extension() +

See also lists of + Objects, + Constants, and + Functions.

+ -- cgit v1.2.3