SQLite

Check-in [ca96e0df29]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Clarifications to the sqlite3_auto_extension() documentation.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ca96e0df29cad4a9c7395a0acf623d8a19cb4725
User & Date: drh 2010-09-17 22:39:07.000
Context
2010-09-18
15:03
Add tests to e_select.test. (check-in: 0ee9e75571 user: dan tags: trunk)
2010-09-17
22:39
Clarifications to the sqlite3_auto_extension() documentation. (check-in: ca96e0df29 user: drh tags: trunk)
19:45
Updates to the documentation for sqlite3_create_collation(). (check-in: 3df7715a77 user: drh tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/sqlite.h.in.
4354
4355
4356
4357
4358
4359
4360
4361

4362
4363

4364
4365



4366



4367
4368
4369









4370

4371

4372
4373
4374
4375







4376
4377




4378
4379
4380
4381
4382
4383
4384

4385
4386

4387
4388
4389
4390
4391
4392
4393
4394
4395
4354
4355
4356
4357
4358
4359
4360

4361
4362

4363


4364
4365
4366
4367
4368
4369
4370



4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381

4382




4383
4384
4385
4386
4387
4388
4389


4390
4391
4392
4393
4394
4395
4396
4397
4398
4399

4400


4401


4402
4403
4404
4405
4406
4407
4408







-
+

-
+
-
-
+
+
+

+
+
+
-
-
-
+
+
+
+
+
+
+
+
+

+
-
+
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+






-
+
-
-
+
-
-







** ^Call the sqlite3_enable_load_extension() routine with onoff==1
** to turn extension loading on and call it with onoff==0 to turn
** it back off again.
*/
int sqlite3_enable_load_extension(sqlite3 *db, int onoff);

/*
** CAPI3REF: Automatically Load An Extensions
** CAPI3REF: Automatically Load Statically Linked Extensions
**
** ^This API can be invoked at program startup in order to register
** ^This interface causes the xEntryPoint() function to be invoked for
** one or more statically linked extensions that will be available
** to all new [database connections].
** 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 and integer result as if the signature of the
** ^(This routine stores a pointer to the extension entry point
** in an array that is obtained from [sqlite3_malloc()].  That memory
** is deallocated by [sqlite3_reset_auto_extension()].)^
** entry point where as follows:
**
** <blockquote><pre>
** &nbsp;  int xEntryPoint(
** &nbsp;    sqlite3 *db,
** &nbsp;    const char **pzErrMsg,
** &nbsp;    const struct sqlite3_api_routines *pThunk
** &nbsp;  );
** </pre></blockquote>)^
**
** If the xEntryPoint routine encounters an error, it should make *pzErrMsg
** ^This function registers an extension entry point that is
** point to an appropriate error message (obtained from [sqlite3_mprintf()])
** automatically invoked whenever a new [database connection]
** is opened using [sqlite3_open()], [sqlite3_open16()],
** or [sqlite3_open_v2()].
** ^Duplicate extensions are detected so calling this routine
** 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
** multiple times with the same extension is harmless.
** ^Automatic extensions apply across all threads.
** 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()].
*/
int sqlite3_auto_extension(void (*xEntryPoint)(void));

/*
** CAPI3REF: Reset Automatic Extension Loading
**
** ^(This function disables all previously registered automatic
** ^This interface disables all automatic extensions previously
** extensions. It undoes the effect of all prior
** [sqlite3_auto_extension()] calls.)^
** registered using [sqlite3_auto_extension()].
**
** ^This function disables automatic extensions in all threads.
*/
void sqlite3_reset_auto_extension(void);

/*
** The interface to the virtual-table mechanism is currently considered
** to be experimental.  The interface might change in incompatible ways.
** If this is a problem for you, do not use the interface at this time.