SQLITE3_AUTO_EXTENSION(3) | Library Functions Manual | SQLITE3_AUTO_EXTENSION(3) |
sqlite3_auto_extension
—
sqlite3_auto_extension
(void(*xEntryPoint)(void));
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.
December 19, 2018 | NetBSD 9.2 |