mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Extend wasm build to enable inclusion of client-custom C code, initialized via the SQLITE_EXTRA_INIT mechanism, per discussion in [forum:1e1c04f3ed1bc96b|forum post 1e1c04f3ed1bc96b].
FossilOrigin-Name: 68a52cafff60f19c9c998133d04f192b1e8b23f78b8cee13807d76845ef5e13d
This commit is contained in:
22
ext/wasm/example_extra_init.c
Normal file
22
ext/wasm/example_extra_init.c
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
** If the canonical build process finds the file
|
||||
** sqlite3_wasm_extra_init.c in the main wasm build directory, it
|
||||
** arranges to include that file in the build of sqlite3.wasm and
|
||||
** defines SQLITE_EXTRA_INIT=sqlite3_wasm_extra_init.
|
||||
**
|
||||
** sqlite3_wasm_extra_init() must be a function with this signature:
|
||||
**
|
||||
** int sqlite3_wasm_extra_init(const char *)
|
||||
**
|
||||
** and the sqlite3 library will call it with an argument of NULL one
|
||||
** time during sqlite3_initialize(). If it returns non-0,
|
||||
** initialization of the library will fail.
|
||||
*/
|
||||
|
||||
#include "sqlite3.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int sqlite3_wasm_extra_init(const char *z){
|
||||
fprintf(stderr,"%s: %s()\n", __FILE__, __func__);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user