1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Get clean builds for MS tools. Add build examples for extension glommer (basexx.c)

Make sure extensions build for dynamic load and built into shell.

FossilOrigin-Name: da940d507e9e31a84daedede44a56f743198d7258a9e83892511fe8dd4c78d2b
This commit is contained in:
larrybr
2022-11-21 02:18:12 +00:00
parent 423003dca9
commit b5aaf0f285
4 changed files with 30 additions and 10 deletions

View File

@ -84,7 +84,7 @@ static const ubyte b64DigitValues[128] = {
41,42,43,44, 45,46,47,48, 49,50,51,ND, ND,ND,ND,ND
};
static const char b64Numerals[64]
static const char b64Numerals[64+1]
= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
#define BX_DV_PROTO(c) ((((ubyte)(c))<0x80)? b64DigitValues[c] : 0x80)

View File

@ -16,6 +16,23 @@
**
** Presently, it combines the base64.c and base85.c extensions. However,
** it can be used as a template for other combinations.
**
** Example usages:
**
** - Build a runtime-loadable extension from SQLite checkout directory:
** *Nix, OSX: gcc -O2 -shared -I. -fPIC -o basexx.so ext/misc/basexx.c
** Win32: cl /Os -I. ext/misc/basexx.c -link -dll -out:basexx.dll
**
** - Incorporate as built-in in sqlite3 shell:
** *Nix, OSX with gcc on a like platform:
** export mop1=-DSQLITE_SHELL_EXTSRC=ext/misc/basexx.c
** export mop2=-DSQLITE_SHELL_EXTFUNCS=BASEXX
** make sqlite3 "OPTS=$mop1 $mop2"
** Win32 with Microsoft toolset on Windows:
** set mop1=-DSQLITE_SHELL_EXTSRC=ext/misc/basexx.c
** set mop2=-DSQLITE_SHELL_EXTFUNCS=BASEXX
** set mops="OPTS=%mop1% %mop2%"
** nmake -f Makefile.msc sqlite3.exe %mops%
*/
#ifndef SQLITE_SHELL_EXTFUNCS /* Guard for #include as built-in extension. */
@ -44,7 +61,10 @@ static void init_api_ptr(const sqlite3_api_routines *pApi){
#define sqlite3_base_init sqlite3_base85_init
#include "base85.c"
static int sqlite3_basexx_init(sqlite3 *db, char **pzErr,
#ifdef _WIN32
__declspec(dllexport)
#endif
int sqlite3_basexx_init(sqlite3 *db, char **pzErr,
const sqlite3_api_routines *pApi){
init_api_ptr(pApi);
int rc1 = BASE64_INIT(db);