├── Bin ├── sqlite3win32.dll ├── sqlite3win32.obj ├── sqlite3win32.res ├── sqlite3win32helper.cobj ├── sqlite3win32stubs.cobj └── sqlite3win64.obj ├── Lib ├── build.bat ├── build_dll_x86.bat ├── build_dll_x86_v140_xp.bat ├── build_obj_x64.bat ├── build_obj_x86_v140_xp.bat ├── build_v140_xp.bat ├── sqlite3 │ ├── ext │ │ └── regexp.c │ ├── shell.c │ ├── sqlite3.c │ ├── sqlite3.h │ └── sqlite3ext.h ├── sqlite3win32.def ├── sqlite3win32helper.c └── sqlite3win32stubs.cpp └── README.md /Bin/sqlite3win32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBForumsCommunity/sqlite3win32/91c30b94b14d82e1c98bd5ed44dd08fd7b632ae6/Bin/sqlite3win32.dll -------------------------------------------------------------------------------- /Bin/sqlite3win32.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBForumsCommunity/sqlite3win32/91c30b94b14d82e1c98bd5ed44dd08fd7b632ae6/Bin/sqlite3win32.obj -------------------------------------------------------------------------------- /Bin/sqlite3win32.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBForumsCommunity/sqlite3win32/91c30b94b14d82e1c98bd5ed44dd08fd7b632ae6/Bin/sqlite3win32.res -------------------------------------------------------------------------------- /Bin/sqlite3win32helper.cobj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBForumsCommunity/sqlite3win32/91c30b94b14d82e1c98bd5ed44dd08fd7b632ae6/Bin/sqlite3win32helper.cobj -------------------------------------------------------------------------------- /Bin/sqlite3win32stubs.cobj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBForumsCommunity/sqlite3win32/91c30b94b14d82e1c98bd5ed44dd08fd7b632ae6/Bin/sqlite3win32stubs.cobj -------------------------------------------------------------------------------- /Bin/sqlite3win64.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VBForumsCommunity/sqlite3win32/91c30b94b14d82e1c98bd5ed44dd08fd7b632ae6/Bin/sqlite3win64.obj -------------------------------------------------------------------------------- /Lib/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set cl_exe="C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\cl.exe" /nologo /MD /O2 /Og- /Gz 4 | set bin_dir=..\Bin 5 | set bin_file=sqlite3win32.dll 6 | 7 | call "C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\vcvars32.bat" 8 | 9 | pushd %~dp0 10 | 11 | %cl_exe% /LD sqlite3win32stubs.cpp sqlite3win32helper.c /Fe%bin_file% /link /DEF:sqlite3win32.def 12 | copy %bin_file% %bin_dir% > nul 13 | copy *.obj %bin_dir%\*.cobj > nul 14 | 15 | :cleanup 16 | del /q *.exp *.lib *.obj *.dll ~$* 17 | 18 | popd 19 | 20 | pause -------------------------------------------------------------------------------- /Lib/build_dll_x86.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set cl_exe="C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\cl.exe" /nologo /MD /O2 /Og- /Gz 4 | set bin_dir=..\Bin 5 | set bin_file=sqlite3win32.dll 6 | 7 | call "C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\vcvars32.bat" 8 | 9 | pushd %~dp0 10 | 11 | %cl_exe% /LD sqlite3win32stubs.cpp sqlite3win32helper.c /Fe%bin_file% /link /DEF:sqlite3win32.def 12 | copy %bin_file% %bin_dir% > nul 13 | copy *.obj %bin_dir%\*.cobj > nul 14 | 15 | :cleanup 16 | del /q *.exp *.lib *.obj *.dll ~$* 17 | 18 | popd 19 | 20 | pause -------------------------------------------------------------------------------- /Lib/build_dll_x86_v140_xp.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set cl_exe="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" /nologo /MT /O2 /Gz 4 | set bin_dir=..\Bin 5 | set bin_file=sqlite3win32.dll 6 | 7 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat" 8 | 9 | set "include=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include;%include%" 10 | set "lib=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib;%lib%" 11 | 12 | pushd %~dp0 13 | 14 | %cl_exe% /LD sqlite3win32stubs.cpp sqlite3win32helper.c /Fe%bin_file% /link /DEF:sqlite3win32.def 15 | copy %bin_file% %bin_dir% > nul 16 | copy *.obj %bin_dir%\*.cobj > nul 17 | 18 | :cleanup 19 | del /q *.exp *.lib *.obj *.dll ~$* 20 | 21 | popd 22 | 23 | pause -------------------------------------------------------------------------------- /Lib/build_obj_x64.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set cl_exe="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\cl.exe" /nologo /c /Gw /Gy /GS- 4 | set bin_dir=..\Bin 5 | set bin_file=sqlite3win64.obj 6 | 7 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvars64.bat" 8 | 9 | pushd %~dp0 10 | 11 | %cl_exe% sqlite3win32helper.c /Fo%bin_file% 12 | copy %bin_file% %bin_dir% > nul 13 | 14 | :cleanup 15 | del /q *.exp *.lib *.obj *.dll ~$* 16 | 17 | popd 18 | 19 | pause -------------------------------------------------------------------------------- /Lib/build_obj_x86_v140_xp.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set cl_exe="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" /nologo /c /Gw /Gy /GS- 4 | set bin_dir=..\Bin 5 | set bin_file=sqlite3win32.obj 6 | 7 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat" 8 | 9 | set "include=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include;%include%" 10 | set "lib=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib;%lib%" 11 | 12 | pushd %~dp0 13 | 14 | %cl_exe% sqlite3win32helper.c /Fo%bin_file% 15 | copy %bin_file% %bin_dir% > nul 16 | 17 | :cleanup 18 | del /q *.exp *.lib *.obj *.dll ~$* 19 | 20 | popd 21 | 22 | pause -------------------------------------------------------------------------------- /Lib/build_v140_xp.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal 3 | set cl_exe="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe" /nologo /MT /O2 /Gz 4 | :: /arch:IA32 5 | set bin_dir=..\Bin 6 | set bin_file=sqlite3win32.dll 7 | 8 | call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat" 9 | 10 | set "include=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\include;%include%" 11 | set "lib=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\lib;%lib%" 12 | 13 | pushd %~dp0 14 | 15 | %cl_exe% /LD sqlite3win32stubs.cpp sqlite3win32helper.c /Fe%bin_file% /link /DEF:sqlite3win32.def 16 | copy %bin_file% %bin_dir% > nul 17 | copy *.obj %bin_dir%\*.cobj > nul 18 | 19 | :cleanup 20 | del /q *.exp *.lib *.obj *.dll ~$* 21 | 22 | popd 23 | 24 | pause -------------------------------------------------------------------------------- /Lib/sqlite3/ext/regexp.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** 2012-11-13 3 | ** 4 | ** The author disclaims copyright to this source code. In place of 5 | ** a legal notice, here is a blessing: 6 | ** 7 | ** May you do good and not evil. 8 | ** May you find forgiveness for yourself and forgive others. 9 | ** May you share freely, never taking more than you give. 10 | ** 11 | ****************************************************************************** 12 | ** 13 | ** The code in this file implements a compact but reasonably 14 | ** efficient regular-expression matcher for posix extended regular 15 | ** expressions against UTF8 text. 16 | ** 17 | ** This file is an SQLite extension. It registers a single function 18 | ** named "regexp(A,B)" where A is the regular expression and B is the 19 | ** string to be matched. By registering this function, SQLite will also 20 | ** then implement the "B regexp A" operator. Note that with the function 21 | ** the regular expression comes first, but with the operator it comes 22 | ** second. 23 | ** 24 | ** The following regular expression syntax is supported: 25 | ** 26 | ** X* zero or more occurrences of X 27 | ** X+ one or more occurrences of X 28 | ** X? zero or one occurrences of X 29 | ** X{p,q} between p and q occurrences of X 30 | ** (X) match X 31 | ** X|Y X or Y 32 | ** ^X X occurring at the beginning of the string 33 | ** X$ X occurring at the end of the string 34 | ** . Match any single character 35 | ** \c Character c where c is one of \{}()[]|*+?. 36 | ** \c C-language escapes for c in afnrtv. ex: \t or \n 37 | ** \uXXXX Where XXXX is exactly 4 hex digits, unicode value XXXX 38 | ** \xXX Where XX is exactly 2 hex digits, unicode value XX 39 | ** [abc] Any single character from the set abc 40 | ** [^abc] Any single character not in the set abc 41 | ** [a-z] Any single character in the range a-z 42 | ** [^a-z] Any single character not in the range a-z 43 | ** \b Word boundary 44 | ** \w Word character. [A-Za-z0-9_] 45 | ** \W Non-word character 46 | ** \d Digit 47 | ** \D Non-digit 48 | ** \s Whitespace character 49 | ** \S Non-whitespace character 50 | ** 51 | ** A nondeterministic finite automaton (NFA) is used for matching, so the 52 | ** performance is bounded by O(N*M) where N is the size of the regular 53 | ** expression and M is the size of the input string. The matcher never 54 | ** exhibits exponential behavior. Note that the X{p,q} operator expands 55 | ** to p copies of X following by q-p copies of X? and that the size of the 56 | ** regular expression in the O(N*M) performance bound is computed after 57 | ** this expansion. 58 | */ 59 | #include 60 | #include 61 | /* #include "sqlite3ext.h" */ 62 | SQLITE_EXTENSION_INIT1 63 | 64 | /* 65 | ** The following #defines change the names of some functions implemented in 66 | ** this file to prevent name collisions with C-library functions of the 67 | ** same name. 68 | */ 69 | #define re_match sqlite3re_match 70 | #define re_compile sqlite3re_compile 71 | #define re_free sqlite3re_free 72 | 73 | /* The end-of-input character */ 74 | #define RE_EOF 0 /* End of input */ 75 | #define RE_START 0xfffffff /* Start of input - larger than an UTF-8 */ 76 | 77 | /* The NFA is implemented as sequence of opcodes taken from the following 78 | ** set. Each opcode has a single integer argument. 79 | */ 80 | #define RE_OP_MATCH 1 /* Match the one character in the argument */ 81 | #define RE_OP_ANY 2 /* Match any one character. (Implements ".") */ 82 | #define RE_OP_ANYSTAR 3 /* Special optimized version of .* */ 83 | #define RE_OP_FORK 4 /* Continue to both next and opcode at iArg */ 84 | #define RE_OP_GOTO 5 /* Jump to opcode at iArg */ 85 | #define RE_OP_ACCEPT 6 /* Halt and indicate a successful match */ 86 | #define RE_OP_CC_INC 7 /* Beginning of a [...] character class */ 87 | #define RE_OP_CC_EXC 8 /* Beginning of a [^...] character class */ 88 | #define RE_OP_CC_VALUE 9 /* Single value in a character class */ 89 | #define RE_OP_CC_RANGE 10 /* Range of values in a character class */ 90 | #define RE_OP_WORD 11 /* Perl word character [A-Za-z0-9_] */ 91 | #define RE_OP_NOTWORD 12 /* Not a perl word character */ 92 | #define RE_OP_DIGIT 13 /* digit: [0-9] */ 93 | #define RE_OP_NOTDIGIT 14 /* Not a digit */ 94 | #define RE_OP_SPACE 15 /* space: [ \t\n\r\v\f] */ 95 | #define RE_OP_NOTSPACE 16 /* Not a digit */ 96 | #define RE_OP_BOUNDARY 17 /* Boundary between word and non-word */ 97 | #define RE_OP_ATSTART 18 /* Currently at the start of the string */ 98 | 99 | #if defined(SQLITE_DEBUG) 100 | /* Opcode names used for symbolic debugging */ 101 | static const char *ReOpName[] = { 102 | "EOF", 103 | "MATCH", 104 | "ANY", 105 | "ANYSTAR", 106 | "FORK", 107 | "GOTO", 108 | "ACCEPT", 109 | "CC_INC", 110 | "CC_EXC", 111 | "CC_VALUE", 112 | "CC_RANGE", 113 | "WORD", 114 | "NOTWORD", 115 | "DIGIT", 116 | "NOTDIGIT", 117 | "SPACE", 118 | "NOTSPACE", 119 | "BOUNDARY", 120 | "ATSTART", 121 | }; 122 | #endif /* SQLITE_DEBUG */ 123 | 124 | 125 | /* Each opcode is a "state" in the NFA */ 126 | typedef unsigned short ReStateNumber; 127 | 128 | /* Because this is an NFA and not a DFA, multiple states can be active at 129 | ** once. An instance of the following object records all active states in 130 | ** the NFA. The implementation is optimized for the common case where the 131 | ** number of actives states is small. 132 | */ 133 | typedef struct ReStateSet { 134 | unsigned nState; /* Number of current states */ 135 | ReStateNumber *aState; /* Current states */ 136 | } ReStateSet; 137 | 138 | /* An input string read one character at a time. 139 | */ 140 | typedef struct ReInput ReInput; 141 | struct ReInput { 142 | const unsigned char *z; /* All text */ 143 | int i; /* Next byte to read */ 144 | int mx; /* EOF when i>=mx */ 145 | }; 146 | 147 | /* A compiled NFA (or an NFA that is in the process of being compiled) is 148 | ** an instance of the following object. 149 | */ 150 | typedef struct ReCompiled ReCompiled; 151 | struct ReCompiled { 152 | ReInput sIn; /* Regular expression text */ 153 | const char *zErr; /* Error message to return */ 154 | char *aOp; /* Operators for the virtual machine */ 155 | int *aArg; /* Arguments to each operator */ 156 | unsigned (*xNextChar)(ReInput*); /* Next character function */ 157 | unsigned char zInit[12]; /* Initial text to match */ 158 | int nInit; /* Number of bytes in zInit */ 159 | unsigned nState; /* Number of entries in aOp[] and aArg[] */ 160 | unsigned nAlloc; /* Slots allocated for aOp[] and aArg[] */ 161 | }; 162 | 163 | /* Add a state to the given state set if it is not already there */ 164 | static void re_add_state(ReStateSet *pSet, int newState){ 165 | unsigned i; 166 | for(i=0; inState; i++) if( pSet->aState[i]==newState ) return; 167 | pSet->aState[pSet->nState++] = (ReStateNumber)newState; 168 | } 169 | 170 | /* Extract the next unicode character from *pzIn and return it. Advance 171 | ** *pzIn to the first byte past the end of the character returned. To 172 | ** be clear: this routine converts utf8 to unicode. This routine is 173 | ** optimized for the common case where the next character is a single byte. 174 | */ 175 | static unsigned re_next_char(ReInput *p){ 176 | unsigned c; 177 | if( p->i>=p->mx ) return 0; 178 | c = p->z[p->i++]; 179 | if( c>=0x80 ){ 180 | if( (c&0xe0)==0xc0 && p->imx && (p->z[p->i]&0xc0)==0x80 ){ 181 | c = (c&0x1f)<<6 | (p->z[p->i++]&0x3f); 182 | if( c<0x80 ) c = 0xfffd; 183 | }else if( (c&0xf0)==0xe0 && p->i+1mx && (p->z[p->i]&0xc0)==0x80 184 | && (p->z[p->i+1]&0xc0)==0x80 ){ 185 | c = (c&0x0f)<<12 | ((p->z[p->i]&0x3f)<<6) | (p->z[p->i+1]&0x3f); 186 | p->i += 2; 187 | if( c<=0x7ff || (c>=0xd800 && c<=0xdfff) ) c = 0xfffd; 188 | }else if( (c&0xf8)==0xf0 && p->i+3mx && (p->z[p->i]&0xc0)==0x80 189 | && (p->z[p->i+1]&0xc0)==0x80 && (p->z[p->i+2]&0xc0)==0x80 ){ 190 | c = (c&0x07)<<18 | ((p->z[p->i]&0x3f)<<12) | ((p->z[p->i+1]&0x3f)<<6) 191 | | (p->z[p->i+2]&0x3f); 192 | p->i += 3; 193 | if( c<=0xffff || c>0x10ffff ) c = 0xfffd; 194 | }else{ 195 | c = 0xfffd; 196 | } 197 | } 198 | return c; 199 | } 200 | static unsigned re_next_char_nocase(ReInput *p){ 201 | unsigned c = re_next_char(p); 202 | if( c>='A' && c<='Z' ) c += 'a' - 'A'; 203 | return c; 204 | } 205 | 206 | /* Return true if c is a perl "word" character: [A-Za-z0-9_] */ 207 | static int re_word_char(int c){ 208 | return (c>='0' && c<='9') || (c>='a' && c<='z') 209 | || (c>='A' && c<='Z') || c=='_'; 210 | } 211 | 212 | /* Return true if c is a "digit" character: [0-9] */ 213 | static int re_digit_char(int c){ 214 | return (c>='0' && c<='9'); 215 | } 216 | 217 | /* Return true if c is a perl "space" character: [ \t\r\n\v\f] */ 218 | static int re_space_char(int c){ 219 | return c==' ' || c=='\t' || c=='\n' || c=='\r' || c=='\v' || c=='\f'; 220 | } 221 | 222 | /* Run a compiled regular expression on the zero-terminated input 223 | ** string zIn[]. Return true on a match and false if there is no match. 224 | */ 225 | static int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){ 226 | ReStateSet aStateSet[2], *pThis, *pNext; 227 | ReStateNumber aSpace[100]; 228 | ReStateNumber *pToFree; 229 | unsigned int i = 0; 230 | unsigned int iSwap = 0; 231 | int c = RE_START; 232 | int cPrev = 0; 233 | int rc = 0; 234 | ReInput in; 235 | 236 | in.z = zIn; 237 | in.i = 0; 238 | in.mx = nIn>=0 ? nIn : (int)strlen((char const*)zIn); 239 | 240 | /* Look for the initial prefix match, if there is one. */ 241 | if( pRe->nInit ){ 242 | unsigned char x = pRe->zInit[0]; 243 | while( in.i+pRe->nInit<=in.mx 244 | && (zIn[in.i]!=x || 245 | strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0) 246 | ){ 247 | in.i++; 248 | } 249 | if( in.i+pRe->nInit>in.mx ) return 0; 250 | c = RE_START-1; 251 | } 252 | 253 | if( pRe->nState<=(sizeof(aSpace)/(sizeof(aSpace[0])*2)) ){ 254 | pToFree = 0; 255 | aStateSet[0].aState = aSpace; 256 | }else{ 257 | pToFree = sqlite3_malloc64( sizeof(ReStateNumber)*2*pRe->nState ); 258 | if( pToFree==0 ) return -1; 259 | aStateSet[0].aState = pToFree; 260 | } 261 | aStateSet[1].aState = &aStateSet[0].aState[pRe->nState]; 262 | pNext = &aStateSet[1]; 263 | pNext->nState = 0; 264 | re_add_state(pNext, 0); 265 | while( c!=RE_EOF && pNext->nState>0 ){ 266 | cPrev = c; 267 | c = pRe->xNextChar(&in); 268 | pThis = pNext; 269 | pNext = &aStateSet[iSwap]; 270 | iSwap = 1 - iSwap; 271 | pNext->nState = 0; 272 | for(i=0; inState; i++){ 273 | int x = pThis->aState[i]; 274 | switch( pRe->aOp[x] ){ 275 | case RE_OP_MATCH: { 276 | if( pRe->aArg[x]==c ) re_add_state(pNext, x+1); 277 | break; 278 | } 279 | case RE_OP_ATSTART: { 280 | if( cPrev==RE_START ) re_add_state(pThis, x+1); 281 | break; 282 | } 283 | case RE_OP_ANY: { 284 | if( c!=0 ) re_add_state(pNext, x+1); 285 | break; 286 | } 287 | case RE_OP_WORD: { 288 | if( re_word_char(c) ) re_add_state(pNext, x+1); 289 | break; 290 | } 291 | case RE_OP_NOTWORD: { 292 | if( !re_word_char(c) && c!=0 ) re_add_state(pNext, x+1); 293 | break; 294 | } 295 | case RE_OP_DIGIT: { 296 | if( re_digit_char(c) ) re_add_state(pNext, x+1); 297 | break; 298 | } 299 | case RE_OP_NOTDIGIT: { 300 | if( !re_digit_char(c) && c!=0 ) re_add_state(pNext, x+1); 301 | break; 302 | } 303 | case RE_OP_SPACE: { 304 | if( re_space_char(c) ) re_add_state(pNext, x+1); 305 | break; 306 | } 307 | case RE_OP_NOTSPACE: { 308 | if( !re_space_char(c) && c!=0 ) re_add_state(pNext, x+1); 309 | break; 310 | } 311 | case RE_OP_BOUNDARY: { 312 | if( re_word_char(c)!=re_word_char(cPrev) ) re_add_state(pThis, x+1); 313 | break; 314 | } 315 | case RE_OP_ANYSTAR: { 316 | re_add_state(pNext, x); 317 | re_add_state(pThis, x+1); 318 | break; 319 | } 320 | case RE_OP_FORK: { 321 | re_add_state(pThis, x+pRe->aArg[x]); 322 | re_add_state(pThis, x+1); 323 | break; 324 | } 325 | case RE_OP_GOTO: { 326 | re_add_state(pThis, x+pRe->aArg[x]); 327 | break; 328 | } 329 | case RE_OP_ACCEPT: { 330 | rc = 1; 331 | goto re_match_end; 332 | } 333 | case RE_OP_CC_EXC: { 334 | if( c==0 ) break; 335 | /* fall-through */ goto re_op_cc_inc; 336 | } 337 | case RE_OP_CC_INC: re_op_cc_inc: { 338 | int j = 1; 339 | int n = pRe->aArg[x]; 340 | int hit = 0; 341 | for(j=1; j>0 && jaOp[x+j]==RE_OP_CC_VALUE ){ 343 | if( pRe->aArg[x+j]==c ){ 344 | hit = 1; 345 | j = -1; 346 | } 347 | }else{ 348 | if( pRe->aArg[x+j]<=c && pRe->aArg[x+j+1]>=c ){ 349 | hit = 1; 350 | j = -1; 351 | }else{ 352 | j++; 353 | } 354 | } 355 | } 356 | if( pRe->aOp[x]==RE_OP_CC_EXC ) hit = !hit; 357 | if( hit ) re_add_state(pNext, x+n); 358 | break; 359 | } 360 | } 361 | } 362 | } 363 | for(i=0; inState; i++){ 364 | int x = pNext->aState[i]; 365 | while( pRe->aOp[x]==RE_OP_GOTO ) x += pRe->aArg[x]; 366 | if( pRe->aOp[x]==RE_OP_ACCEPT ){ rc = 1; break; } 367 | } 368 | re_match_end: 369 | sqlite3_free(pToFree); 370 | return rc; 371 | } 372 | 373 | /* Resize the opcode and argument arrays for an RE under construction. 374 | */ 375 | static int re_resize(ReCompiled *p, int N){ 376 | char *aOp; 377 | int *aArg; 378 | aOp = sqlite3_realloc64(p->aOp, N*sizeof(p->aOp[0])); 379 | if( aOp==0 ) return 1; 380 | p->aOp = aOp; 381 | aArg = sqlite3_realloc64(p->aArg, N*sizeof(p->aArg[0])); 382 | if( aArg==0 ) return 1; 383 | p->aArg = aArg; 384 | p->nAlloc = N; 385 | return 0; 386 | } 387 | 388 | /* Insert a new opcode and argument into an RE under construction. The 389 | ** insertion point is just prior to existing opcode iBefore. 390 | */ 391 | static int re_insert(ReCompiled *p, int iBefore, int op, int arg){ 392 | int i; 393 | if( p->nAlloc<=p->nState && re_resize(p, p->nAlloc*2) ) return 0; 394 | for(i=p->nState; i>iBefore; i--){ 395 | p->aOp[i] = p->aOp[i-1]; 396 | p->aArg[i] = p->aArg[i-1]; 397 | } 398 | p->nState++; 399 | p->aOp[iBefore] = (char)op; 400 | p->aArg[iBefore] = arg; 401 | return iBefore; 402 | } 403 | 404 | /* Append a new opcode and argument to the end of the RE under construction. 405 | */ 406 | static int re_append(ReCompiled *p, int op, int arg){ 407 | return re_insert(p, p->nState, op, arg); 408 | } 409 | 410 | /* Make a copy of N opcodes starting at iStart onto the end of the RE 411 | ** under construction. 412 | */ 413 | static void re_copy(ReCompiled *p, int iStart, int N){ 414 | if( p->nState+N>=p->nAlloc && re_resize(p, p->nAlloc*2+N) ) return; 415 | memcpy(&p->aOp[p->nState], &p->aOp[iStart], N*sizeof(p->aOp[0])); 416 | memcpy(&p->aArg[p->nState], &p->aArg[iStart], N*sizeof(p->aArg[0])); 417 | p->nState += N; 418 | } 419 | 420 | /* Return true if c is a hexadecimal digit character: [0-9a-fA-F] 421 | ** If c is a hex digit, also set *pV = (*pV)*16 + valueof(c). If 422 | ** c is not a hex digit *pV is unchanged. 423 | */ 424 | static int re_hex(int c, int *pV){ 425 | if( c>='0' && c<='9' ){ 426 | c -= '0'; 427 | }else if( c>='a' && c<='f' ){ 428 | c -= 'a' - 10; 429 | }else if( c>='A' && c<='F' ){ 430 | c -= 'A' - 10; 431 | }else{ 432 | return 0; 433 | } 434 | *pV = (*pV)*16 + (c & 0xff); 435 | return 1; 436 | } 437 | 438 | /* A backslash character has been seen, read the next character and 439 | ** return its interpretation. 440 | */ 441 | static unsigned re_esc_char(ReCompiled *p){ 442 | static const char zEsc[] = "afnrtv\\()*.+?[$^{|}]"; 443 | static const char zTrans[] = "\a\f\n\r\t\v"; 444 | int i, v = 0; 445 | char c; 446 | if( p->sIn.i>=p->sIn.mx ) return 0; 447 | c = p->sIn.z[p->sIn.i]; 448 | if( c=='u' && p->sIn.i+4sIn.mx ){ 449 | const unsigned char *zIn = p->sIn.z + p->sIn.i; 450 | if( re_hex(zIn[1],&v) 451 | && re_hex(zIn[2],&v) 452 | && re_hex(zIn[3],&v) 453 | && re_hex(zIn[4],&v) 454 | ){ 455 | p->sIn.i += 5; 456 | return v; 457 | } 458 | } 459 | if( c=='x' && p->sIn.i+2sIn.mx ){ 460 | const unsigned char *zIn = p->sIn.z + p->sIn.i; 461 | if( re_hex(zIn[1],&v) 462 | && re_hex(zIn[2],&v) 463 | ){ 464 | p->sIn.i += 3; 465 | return v; 466 | } 467 | } 468 | for(i=0; zEsc[i] && zEsc[i]!=c; i++){} 469 | if( zEsc[i] ){ 470 | if( i<6 ) c = zTrans[i]; 471 | p->sIn.i++; 472 | }else{ 473 | p->zErr = "unknown \\ escape"; 474 | } 475 | return c; 476 | } 477 | 478 | /* Forward declaration */ 479 | static const char *re_subcompile_string(ReCompiled*); 480 | 481 | /* Peek at the next byte of input */ 482 | static unsigned char rePeek(ReCompiled *p){ 483 | return p->sIn.isIn.mx ? p->sIn.z[p->sIn.i] : 0; 484 | } 485 | 486 | /* Compile RE text into a sequence of opcodes. Continue up to the 487 | ** first unmatched ")" character, then return. If an error is found, 488 | ** return a pointer to the error message string. 489 | */ 490 | static const char *re_subcompile_re(ReCompiled *p){ 491 | const char *zErr; 492 | int iStart, iEnd, iGoto; 493 | iStart = p->nState; 494 | zErr = re_subcompile_string(p); 495 | if( zErr ) return zErr; 496 | while( rePeek(p)=='|' ){ 497 | iEnd = p->nState; 498 | re_insert(p, iStart, RE_OP_FORK, iEnd + 2 - iStart); 499 | iGoto = re_append(p, RE_OP_GOTO, 0); 500 | p->sIn.i++; 501 | zErr = re_subcompile_string(p); 502 | if( zErr ) return zErr; 503 | p->aArg[iGoto] = p->nState - iGoto; 504 | } 505 | return 0; 506 | } 507 | 508 | /* Compile an element of regular expression text (anything that can be 509 | ** an operand to the "|" operator). Return NULL on success or a pointer 510 | ** to the error message if there is a problem. 511 | */ 512 | static const char *re_subcompile_string(ReCompiled *p){ 513 | int iPrev = -1; 514 | int iStart; 515 | unsigned c; 516 | const char *zErr; 517 | while( (c = p->xNextChar(&p->sIn))!=0 ){ 518 | iStart = p->nState; 519 | switch( c ){ 520 | case '|': 521 | case ')': { 522 | p->sIn.i--; 523 | return 0; 524 | } 525 | case '(': { 526 | zErr = re_subcompile_re(p); 527 | if( zErr ) return zErr; 528 | if( rePeek(p)!=')' ) return "unmatched '('"; 529 | p->sIn.i++; 530 | break; 531 | } 532 | case '.': { 533 | if( rePeek(p)=='*' ){ 534 | re_append(p, RE_OP_ANYSTAR, 0); 535 | p->sIn.i++; 536 | }else{ 537 | re_append(p, RE_OP_ANY, 0); 538 | } 539 | break; 540 | } 541 | case '*': { 542 | if( iPrev<0 ) return "'*' without operand"; 543 | re_insert(p, iPrev, RE_OP_GOTO, p->nState - iPrev + 1); 544 | re_append(p, RE_OP_FORK, iPrev - p->nState + 1); 545 | break; 546 | } 547 | case '+': { 548 | if( iPrev<0 ) return "'+' without operand"; 549 | re_append(p, RE_OP_FORK, iPrev - p->nState); 550 | break; 551 | } 552 | case '?': { 553 | if( iPrev<0 ) return "'?' without operand"; 554 | re_insert(p, iPrev, RE_OP_FORK, p->nState - iPrev+1); 555 | break; 556 | } 557 | case '$': { 558 | re_append(p, RE_OP_MATCH, RE_EOF); 559 | break; 560 | } 561 | case '^': { 562 | re_append(p, RE_OP_ATSTART, 0); 563 | break; 564 | } 565 | case '{': { 566 | int m = 0, n = 0; 567 | int sz, j; 568 | if( iPrev<0 ) return "'{m,n}' without operand"; 569 | while( (c=rePeek(p))>='0' && c<='9' ){ m = m*10 + c - '0'; p->sIn.i++; } 570 | n = m; 571 | if( c==',' ){ 572 | p->sIn.i++; 573 | n = 0; 574 | while( (c=rePeek(p))>='0' && c<='9' ){ n = n*10 + c-'0'; p->sIn.i++; } 575 | } 576 | if( c!='}' ) return "unmatched '{'"; 577 | if( n>0 && nsIn.i++; 579 | sz = p->nState - iPrev; 580 | if( m==0 ){ 581 | if( n==0 ) return "both m and n are zero in '{m,n}'"; 582 | re_insert(p, iPrev, RE_OP_FORK, sz+1); 583 | iPrev++; 584 | n--; 585 | }else{ 586 | for(j=1; j0 ){ 593 | re_append(p, RE_OP_FORK, -sz); 594 | } 595 | break; 596 | } 597 | case '[': { 598 | int iFirst = p->nState; 599 | if( rePeek(p)=='^' ){ 600 | re_append(p, RE_OP_CC_EXC, 0); 601 | p->sIn.i++; 602 | }else{ 603 | re_append(p, RE_OP_CC_INC, 0); 604 | } 605 | while( (c = p->xNextChar(&p->sIn))!=0 ){ 606 | if( c=='[' && rePeek(p)==':' ){ 607 | return "POSIX character classes not supported"; 608 | } 609 | if( c=='\\' ) c = re_esc_char(p); 610 | if( rePeek(p)=='-' ){ 611 | re_append(p, RE_OP_CC_RANGE, c); 612 | p->sIn.i++; 613 | c = p->xNextChar(&p->sIn); 614 | if( c=='\\' ) c = re_esc_char(p); 615 | re_append(p, RE_OP_CC_RANGE, c); 616 | }else{ 617 | re_append(p, RE_OP_CC_VALUE, c); 618 | } 619 | if( rePeek(p)==']' ){ p->sIn.i++; break; } 620 | } 621 | if( c==0 ) return "unclosed '['"; 622 | p->aArg[iFirst] = p->nState - iFirst; 623 | break; 624 | } 625 | case '\\': { 626 | int specialOp = 0; 627 | switch( rePeek(p) ){ 628 | case 'b': specialOp = RE_OP_BOUNDARY; break; 629 | case 'd': specialOp = RE_OP_DIGIT; break; 630 | case 'D': specialOp = RE_OP_NOTDIGIT; break; 631 | case 's': specialOp = RE_OP_SPACE; break; 632 | case 'S': specialOp = RE_OP_NOTSPACE; break; 633 | case 'w': specialOp = RE_OP_WORD; break; 634 | case 'W': specialOp = RE_OP_NOTWORD; break; 635 | } 636 | if( specialOp ){ 637 | p->sIn.i++; 638 | re_append(p, specialOp, 0); 639 | }else{ 640 | c = re_esc_char(p); 641 | re_append(p, RE_OP_MATCH, c); 642 | } 643 | break; 644 | } 645 | default: { 646 | re_append(p, RE_OP_MATCH, c); 647 | break; 648 | } 649 | } 650 | iPrev = iStart; 651 | } 652 | return 0; 653 | } 654 | 655 | /* Free and reclaim all the memory used by a previously compiled 656 | ** regular expression. Applications should invoke this routine once 657 | ** for every call to re_compile() to avoid memory leaks. 658 | */ 659 | static void re_free(ReCompiled *pRe){ 660 | if( pRe ){ 661 | sqlite3_free(pRe->aOp); 662 | sqlite3_free(pRe->aArg); 663 | sqlite3_free(pRe); 664 | } 665 | } 666 | 667 | /* 668 | ** Compile a textual regular expression in zIn[] into a compiled regular 669 | ** expression suitable for us by re_match() and return a pointer to the 670 | ** compiled regular expression in *ppRe. Return NULL on success or an 671 | ** error message if something goes wrong. 672 | */ 673 | static const char *re_compile(ReCompiled **ppRe, const char *zIn, int noCase){ 674 | ReCompiled *pRe; 675 | const char *zErr; 676 | int i, j; 677 | 678 | *ppRe = 0; 679 | pRe = sqlite3_malloc( sizeof(*pRe) ); 680 | if( pRe==0 ){ 681 | return "out of memory"; 682 | } 683 | memset(pRe, 0, sizeof(*pRe)); 684 | pRe->xNextChar = noCase ? re_next_char_nocase : re_next_char; 685 | if( re_resize(pRe, 30) ){ 686 | re_free(pRe); 687 | return "out of memory"; 688 | } 689 | if( zIn[0]=='^' ){ 690 | zIn++; 691 | }else{ 692 | re_append(pRe, RE_OP_ANYSTAR, 0); 693 | } 694 | pRe->sIn.z = (unsigned char*)zIn; 695 | pRe->sIn.i = 0; 696 | pRe->sIn.mx = (int)strlen(zIn); 697 | zErr = re_subcompile_re(pRe); 698 | if( zErr ){ 699 | re_free(pRe); 700 | return zErr; 701 | } 702 | if( pRe->sIn.i>=pRe->sIn.mx ){ 703 | re_append(pRe, RE_OP_ACCEPT, 0); 704 | *ppRe = pRe; 705 | }else{ 706 | re_free(pRe); 707 | return "unrecognized character"; 708 | } 709 | 710 | /* The following is a performance optimization. If the regex begins with 711 | ** ".*" (if the input regex lacks an initial "^") and afterwards there are 712 | ** one or more matching characters, enter those matching characters into 713 | ** zInit[]. The re_match() routine can then search ahead in the input 714 | ** string looking for the initial match without having to run the whole 715 | ** regex engine over the string. Do not worry able trying to match 716 | ** unicode characters beyond plane 0 - those are very rare and this is 717 | ** just an optimization. */ 718 | if( pRe->aOp[0]==RE_OP_ANYSTAR && !noCase ){ 719 | for(j=0, i=1; j<(int)sizeof(pRe->zInit)-2 && pRe->aOp[i]==RE_OP_MATCH; i++){ 720 | unsigned x = pRe->aArg[i]; 721 | if( x<=127 ){ 722 | pRe->zInit[j++] = (unsigned char)x; 723 | }else if( x<=0xfff ){ 724 | pRe->zInit[j++] = (unsigned char)(0xc0 | (x>>6)); 725 | pRe->zInit[j++] = 0x80 | (x&0x3f); 726 | }else if( x<=0xffff ){ 727 | pRe->zInit[j++] = (unsigned char)(0xe0 | (x>>12)); 728 | pRe->zInit[j++] = 0x80 | ((x>>6)&0x3f); 729 | pRe->zInit[j++] = 0x80 | (x&0x3f); 730 | }else{ 731 | break; 732 | } 733 | } 734 | if( j>0 && pRe->zInit[j-1]==0 ) j--; 735 | pRe->nInit = j; 736 | } 737 | return pRe->zErr; 738 | } 739 | 740 | /* 741 | ** Implementation of the regexp() SQL function. This function implements 742 | ** the build-in REGEXP operator. The first argument to the function is the 743 | ** pattern and the second argument is the string. So, the SQL statements: 744 | ** 745 | ** A REGEXP B 746 | ** 747 | ** is implemented as regexp(B,A). 748 | */ 749 | static void re_sql_func( 750 | sqlite3_context *context, 751 | int argc, 752 | sqlite3_value **argv 753 | ){ 754 | ReCompiled *pRe; /* Compiled regular expression */ 755 | const char *zPattern; /* The regular expression */ 756 | const unsigned char *zStr;/* String being searched */ 757 | const char *zErr; /* Compile error message */ 758 | int setAux = 0; /* True to invoke sqlite3_set_auxdata() */ 759 | 760 | (void)argc; /* Unused */ 761 | pRe = sqlite3_get_auxdata(context, 0); 762 | if( pRe==0 ){ 763 | zPattern = (const char*)sqlite3_value_text(argv[0]); 764 | if( zPattern==0 ) return; 765 | zErr = re_compile(&pRe, zPattern, 0); 766 | if( zErr ){ 767 | re_free(pRe); 768 | sqlite3_result_error(context, zErr, -1); 769 | return; 770 | } 771 | if( pRe==0 ){ 772 | sqlite3_result_error_nomem(context); 773 | return; 774 | } 775 | setAux = 1; 776 | } 777 | zStr = (const unsigned char*)sqlite3_value_text(argv[1]); 778 | if( zStr!=0 ){ 779 | sqlite3_result_int(context, re_match(pRe, zStr, -1)); 780 | } 781 | if( setAux ){ 782 | sqlite3_set_auxdata(context, 0, pRe, (void(*)(void*))re_free); 783 | } 784 | } 785 | 786 | #if defined(SQLITE_DEBUG) 787 | /* 788 | ** This function is used for testing and debugging only. It is only available 789 | ** if the SQLITE_DEBUG compile-time option is used. 790 | ** 791 | ** Compile a regular expression and then convert the compiled expression into 792 | ** text and return that text. 793 | */ 794 | static void re_bytecode_func( 795 | sqlite3_context *context, 796 | int argc, 797 | sqlite3_value **argv 798 | ){ 799 | const char *zPattern; 800 | const char *zErr; 801 | ReCompiled *pRe; 802 | sqlite3_str *pStr; 803 | int i; 804 | int n; 805 | char *z; 806 | 807 | zPattern = (const char*)sqlite3_value_text(argv[0]); 808 | if( zPattern==0 ) return; 809 | zErr = re_compile(&pRe, zPattern, 0); 810 | if( zErr ){ 811 | re_free(pRe); 812 | sqlite3_result_error(context, zErr, -1); 813 | return; 814 | } 815 | if( pRe==0 ){ 816 | sqlite3_result_error_nomem(context); 817 | return; 818 | } 819 | pStr = sqlite3_str_new(0); 820 | if( pStr==0 ) goto re_bytecode_func_err; 821 | if( pRe->nInit>0 ){ 822 | sqlite3_str_appendf(pStr, "INIT "); 823 | for(i=0; inInit; i++){ 824 | sqlite3_str_appendf(pStr, "%02x", pRe->zInit[i]); 825 | } 826 | sqlite3_str_appendf(pStr, "\n"); 827 | } 828 | for(i=0; (unsigned)inState; i++){ 829 | sqlite3_str_appendf(pStr, "%-8s %4d\n", 830 | ReOpName[(unsigned char)pRe->aOp[i]], pRe->aArg[i]); 831 | } 832 | n = sqlite3_str_length(pStr); 833 | z = sqlite3_str_finish(pStr); 834 | if( n==0 ){ 835 | sqlite3_free(z); 836 | }else{ 837 | sqlite3_result_text(context, z, n-1, sqlite3_free); 838 | } 839 | 840 | re_bytecode_func_err: 841 | re_free(pRe); 842 | } 843 | 844 | #endif /* SQLITE_DEBUG */ 845 | 846 | 847 | /* 848 | ** Invoke this routine to register the regexp() function with the 849 | ** SQLite database connection. 850 | */ 851 | #ifdef _WIN32 852 | __declspec(dllexport) 853 | #endif 854 | SQLITE_API int sqlite3_regexp_init( 855 | sqlite3 *db, 856 | char **pzErrMsg, 857 | const sqlite3_api_routines *pApi 858 | ){ 859 | int rc = SQLITE_OK; 860 | SQLITE_EXTENSION_INIT2(pApi); 861 | (void)pzErrMsg; /* Unused parameter */ 862 | rc = sqlite3_create_function(db, "regexp", 2, SQLITE_UTF8|SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS, 0, re_sql_func, 0, 0); 863 | 864 | #if defined(SQLITE_DEBUG) 865 | if( rc==SQLITE_OK ){ 866 | rc = sqlite3_create_function(db, "regexp_bytecode", 1, SQLITE_UTF8|SQLITE_DETERMINISTIC|SQLITE_INNOCUOUS, 0, re_bytecode_func, 0, 0); 867 | } 868 | #endif /* SQLITE_DEBUG */ 869 | 870 | return rc; 871 | } 872 | -------------------------------------------------------------------------------- /Lib/sqlite3/sqlite3ext.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** 2006 June 7 3 | ** 4 | ** The author disclaims copyright to this source code. In place of 5 | ** a legal notice, here is a blessing: 6 | ** 7 | ** May you do good and not evil. 8 | ** May you find forgiveness for yourself and forgive others. 9 | ** May you share freely, never taking more than you give. 10 | ** 11 | ************************************************************************* 12 | ** This header file defines the SQLite interface for use by 13 | ** shared libraries that want to be imported as extensions into 14 | ** an SQLite instance. Shared libraries that intend to be loaded 15 | ** as extensions by SQLite should #include this file instead of 16 | ** sqlite3.h. 17 | */ 18 | #ifndef SQLITE3EXT_H 19 | #define SQLITE3EXT_H 20 | #include "sqlite3.h" 21 | 22 | /* 23 | ** The following structure holds pointers to all of the SQLite API 24 | ** routines. 25 | ** 26 | ** WARNING: In order to maintain backwards compatibility, add new 27 | ** interfaces to the end of this structure only. If you insert new 28 | ** interfaces in the middle of this structure, then older different 29 | ** versions of SQLite will not be able to load each other's shared 30 | ** libraries! 31 | */ 32 | struct sqlite3_api_routines { 33 | void * (*aggregate_context)(sqlite3_context*,int nBytes); 34 | int (*aggregate_count)(sqlite3_context*); 35 | int (*bind_blob)(sqlite3_stmt*,int,const void*,int n,void(*)(void*)); 36 | int (*bind_double)(sqlite3_stmt*,int,double); 37 | int (*bind_int)(sqlite3_stmt*,int,int); 38 | int (*bind_int64)(sqlite3_stmt*,int,sqlite_int64); 39 | int (*bind_null)(sqlite3_stmt*,int); 40 | int (*bind_parameter_count)(sqlite3_stmt*); 41 | int (*bind_parameter_index)(sqlite3_stmt*,const char*zName); 42 | const char * (*bind_parameter_name)(sqlite3_stmt*,int); 43 | int (*bind_text)(sqlite3_stmt*,int,const char*,int n,void(*)(void*)); 44 | int (*bind_text16)(sqlite3_stmt*,int,const void*,int,void(*)(void*)); 45 | int (*bind_value)(sqlite3_stmt*,int,const sqlite3_value*); 46 | int (*busy_handler)(sqlite3*,int(*)(void*,int),void*); 47 | int (*busy_timeout)(sqlite3*,int ms); 48 | int (*changes)(sqlite3*); 49 | int (*close)(sqlite3*); 50 | int (*collation_needed)(sqlite3*,void*,void(*)(void*,sqlite3*, 51 | int eTextRep,const char*)); 52 | int (*collation_needed16)(sqlite3*,void*,void(*)(void*,sqlite3*, 53 | int eTextRep,const void*)); 54 | const void * (*column_blob)(sqlite3_stmt*,int iCol); 55 | int (*column_bytes)(sqlite3_stmt*,int iCol); 56 | int (*column_bytes16)(sqlite3_stmt*,int iCol); 57 | int (*column_count)(sqlite3_stmt*pStmt); 58 | const char * (*column_database_name)(sqlite3_stmt*,int); 59 | const void * (*column_database_name16)(sqlite3_stmt*,int); 60 | const char * (*column_decltype)(sqlite3_stmt*,int i); 61 | const void * (*column_decltype16)(sqlite3_stmt*,int); 62 | double (*column_double)(sqlite3_stmt*,int iCol); 63 | int (*column_int)(sqlite3_stmt*,int iCol); 64 | sqlite_int64 (*column_int64)(sqlite3_stmt*,int iCol); 65 | const char * (*column_name)(sqlite3_stmt*,int); 66 | const void * (*column_name16)(sqlite3_stmt*,int); 67 | const char * (*column_origin_name)(sqlite3_stmt*,int); 68 | const void * (*column_origin_name16)(sqlite3_stmt*,int); 69 | const char * (*column_table_name)(sqlite3_stmt*,int); 70 | const void * (*column_table_name16)(sqlite3_stmt*,int); 71 | const unsigned char * (*column_text)(sqlite3_stmt*,int iCol); 72 | const void * (*column_text16)(sqlite3_stmt*,int iCol); 73 | int (*column_type)(sqlite3_stmt*,int iCol); 74 | sqlite3_value* (*column_value)(sqlite3_stmt*,int iCol); 75 | void * (*commit_hook)(sqlite3*,int(*)(void*),void*); 76 | int (*complete)(const char*sql); 77 | int (*complete16)(const void*sql); 78 | int (*create_collation)(sqlite3*,const char*,int,void*, 79 | int(*)(void*,int,const void*,int,const void*)); 80 | int (*create_collation16)(sqlite3*,const void*,int,void*, 81 | int(*)(void*,int,const void*,int,const void*)); 82 | int (*create_function)(sqlite3*,const char*,int,int,void*, 83 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), 84 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), 85 | void (*xFinal)(sqlite3_context*)); 86 | int (*create_function16)(sqlite3*,const void*,int,int,void*, 87 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), 88 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), 89 | void (*xFinal)(sqlite3_context*)); 90 | int (*create_module)(sqlite3*,const char*,const sqlite3_module*,void*); 91 | int (*data_count)(sqlite3_stmt*pStmt); 92 | sqlite3 * (*db_handle)(sqlite3_stmt*); 93 | int (*declare_vtab)(sqlite3*,const char*); 94 | int (*enable_shared_cache)(int); 95 | int (*errcode)(sqlite3*db); 96 | const char * (*errmsg)(sqlite3*); 97 | const void * (*errmsg16)(sqlite3*); 98 | int (*exec)(sqlite3*,const char*,sqlite3_callback,void*,char**); 99 | int (*expired)(sqlite3_stmt*); 100 | int (*finalize)(sqlite3_stmt*pStmt); 101 | void (*free)(void*); 102 | void (*free_table)(char**result); 103 | int (*get_autocommit)(sqlite3*); 104 | void * (*get_auxdata)(sqlite3_context*,int); 105 | int (*get_table)(sqlite3*,const char*,char***,int*,int*,char**); 106 | int (*global_recover)(void); 107 | void (*interruptx)(sqlite3*); 108 | sqlite_int64 (*last_insert_rowid)(sqlite3*); 109 | const char * (*libversion)(void); 110 | int (*libversion_number)(void); 111 | void *(*malloc)(int); 112 | char * (*mprintf)(const char*,...); 113 | int (*open)(const char*,sqlite3**); 114 | int (*open16)(const void*,sqlite3**); 115 | int (*prepare)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); 116 | int (*prepare16)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); 117 | void * (*profile)(sqlite3*,void(*)(void*,const char*,sqlite_uint64),void*); 118 | void (*progress_handler)(sqlite3*,int,int(*)(void*),void*); 119 | void *(*realloc)(void*,int); 120 | int (*reset)(sqlite3_stmt*pStmt); 121 | void (*result_blob)(sqlite3_context*,const void*,int,void(*)(void*)); 122 | void (*result_double)(sqlite3_context*,double); 123 | void (*result_error)(sqlite3_context*,const char*,int); 124 | void (*result_error16)(sqlite3_context*,const void*,int); 125 | void (*result_int)(sqlite3_context*,int); 126 | void (*result_int64)(sqlite3_context*,sqlite_int64); 127 | void (*result_null)(sqlite3_context*); 128 | void (*result_text)(sqlite3_context*,const char*,int,void(*)(void*)); 129 | void (*result_text16)(sqlite3_context*,const void*,int,void(*)(void*)); 130 | void (*result_text16be)(sqlite3_context*,const void*,int,void(*)(void*)); 131 | void (*result_text16le)(sqlite3_context*,const void*,int,void(*)(void*)); 132 | void (*result_value)(sqlite3_context*,sqlite3_value*); 133 | void * (*rollback_hook)(sqlite3*,void(*)(void*),void*); 134 | int (*set_authorizer)(sqlite3*,int(*)(void*,int,const char*,const char*, 135 | const char*,const char*),void*); 136 | void (*set_auxdata)(sqlite3_context*,int,void*,void (*)(void*)); 137 | char * (*xsnprintf)(int,char*,const char*,...); 138 | int (*step)(sqlite3_stmt*); 139 | int (*table_column_metadata)(sqlite3*,const char*,const char*,const char*, 140 | char const**,char const**,int*,int*,int*); 141 | void (*thread_cleanup)(void); 142 | int (*total_changes)(sqlite3*); 143 | void * (*trace)(sqlite3*,void(*xTrace)(void*,const char*),void*); 144 | int (*transfer_bindings)(sqlite3_stmt*,sqlite3_stmt*); 145 | void * (*update_hook)(sqlite3*,void(*)(void*,int ,char const*,char const*, 146 | sqlite_int64),void*); 147 | void * (*user_data)(sqlite3_context*); 148 | const void * (*value_blob)(sqlite3_value*); 149 | int (*value_bytes)(sqlite3_value*); 150 | int (*value_bytes16)(sqlite3_value*); 151 | double (*value_double)(sqlite3_value*); 152 | int (*value_int)(sqlite3_value*); 153 | sqlite_int64 (*value_int64)(sqlite3_value*); 154 | int (*value_numeric_type)(sqlite3_value*); 155 | const unsigned char * (*value_text)(sqlite3_value*); 156 | const void * (*value_text16)(sqlite3_value*); 157 | const void * (*value_text16be)(sqlite3_value*); 158 | const void * (*value_text16le)(sqlite3_value*); 159 | int (*value_type)(sqlite3_value*); 160 | char *(*vmprintf)(const char*,va_list); 161 | /* Added ??? */ 162 | int (*overload_function)(sqlite3*, const char *zFuncName, int nArg); 163 | /* Added by 3.3.13 */ 164 | int (*prepare_v2)(sqlite3*,const char*,int,sqlite3_stmt**,const char**); 165 | int (*prepare16_v2)(sqlite3*,const void*,int,sqlite3_stmt**,const void**); 166 | int (*clear_bindings)(sqlite3_stmt*); 167 | /* Added by 3.4.1 */ 168 | int (*create_module_v2)(sqlite3*,const char*,const sqlite3_module*,void*, 169 | void (*xDestroy)(void *)); 170 | /* Added by 3.5.0 */ 171 | int (*bind_zeroblob)(sqlite3_stmt*,int,int); 172 | int (*blob_bytes)(sqlite3_blob*); 173 | int (*blob_close)(sqlite3_blob*); 174 | int (*blob_open)(sqlite3*,const char*,const char*,const char*,sqlite3_int64, 175 | int,sqlite3_blob**); 176 | int (*blob_read)(sqlite3_blob*,void*,int,int); 177 | int (*blob_write)(sqlite3_blob*,const void*,int,int); 178 | int (*create_collation_v2)(sqlite3*,const char*,int,void*, 179 | int(*)(void*,int,const void*,int,const void*), 180 | void(*)(void*)); 181 | int (*file_control)(sqlite3*,const char*,int,void*); 182 | sqlite3_int64 (*memory_highwater)(int); 183 | sqlite3_int64 (*memory_used)(void); 184 | sqlite3_mutex *(*mutex_alloc)(int); 185 | void (*mutex_enter)(sqlite3_mutex*); 186 | void (*mutex_free)(sqlite3_mutex*); 187 | void (*mutex_leave)(sqlite3_mutex*); 188 | int (*mutex_try)(sqlite3_mutex*); 189 | int (*open_v2)(const char*,sqlite3**,int,const char*); 190 | int (*release_memory)(int); 191 | void (*result_error_nomem)(sqlite3_context*); 192 | void (*result_error_toobig)(sqlite3_context*); 193 | int (*sleep)(int); 194 | void (*soft_heap_limit)(int); 195 | sqlite3_vfs *(*vfs_find)(const char*); 196 | int (*vfs_register)(sqlite3_vfs*,int); 197 | int (*vfs_unregister)(sqlite3_vfs*); 198 | int (*xthreadsafe)(void); 199 | void (*result_zeroblob)(sqlite3_context*,int); 200 | void (*result_error_code)(sqlite3_context*,int); 201 | int (*test_control)(int, ...); 202 | void (*randomness)(int,void*); 203 | sqlite3 *(*context_db_handle)(sqlite3_context*); 204 | int (*extended_result_codes)(sqlite3*,int); 205 | int (*limit)(sqlite3*,int,int); 206 | sqlite3_stmt *(*next_stmt)(sqlite3*,sqlite3_stmt*); 207 | const char *(*sql)(sqlite3_stmt*); 208 | int (*status)(int,int*,int*,int); 209 | int (*backup_finish)(sqlite3_backup*); 210 | sqlite3_backup *(*backup_init)(sqlite3*,const char*,sqlite3*,const char*); 211 | int (*backup_pagecount)(sqlite3_backup*); 212 | int (*backup_remaining)(sqlite3_backup*); 213 | int (*backup_step)(sqlite3_backup*,int); 214 | const char *(*compileoption_get)(int); 215 | int (*compileoption_used)(const char*); 216 | int (*create_function_v2)(sqlite3*,const char*,int,int,void*, 217 | void (*xFunc)(sqlite3_context*,int,sqlite3_value**), 218 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), 219 | void (*xFinal)(sqlite3_context*), 220 | void(*xDestroy)(void*)); 221 | int (*db_config)(sqlite3*,int,...); 222 | sqlite3_mutex *(*db_mutex)(sqlite3*); 223 | int (*db_status)(sqlite3*,int,int*,int*,int); 224 | int (*extended_errcode)(sqlite3*); 225 | void (*log)(int,const char*,...); 226 | sqlite3_int64 (*soft_heap_limit64)(sqlite3_int64); 227 | const char *(*sourceid)(void); 228 | int (*stmt_status)(sqlite3_stmt*,int,int); 229 | int (*strnicmp)(const char*,const char*,int); 230 | int (*unlock_notify)(sqlite3*,void(*)(void**,int),void*); 231 | int (*wal_autocheckpoint)(sqlite3*,int); 232 | int (*wal_checkpoint)(sqlite3*,const char*); 233 | void *(*wal_hook)(sqlite3*,int(*)(void*,sqlite3*,const char*,int),void*); 234 | int (*blob_reopen)(sqlite3_blob*,sqlite3_int64); 235 | int (*vtab_config)(sqlite3*,int op,...); 236 | int (*vtab_on_conflict)(sqlite3*); 237 | /* Version 3.7.16 and later */ 238 | int (*close_v2)(sqlite3*); 239 | const char *(*db_filename)(sqlite3*,const char*); 240 | int (*db_readonly)(sqlite3*,const char*); 241 | int (*db_release_memory)(sqlite3*); 242 | const char *(*errstr)(int); 243 | int (*stmt_busy)(sqlite3_stmt*); 244 | int (*stmt_readonly)(sqlite3_stmt*); 245 | int (*stricmp)(const char*,const char*); 246 | int (*uri_boolean)(const char*,const char*,int); 247 | sqlite3_int64 (*uri_int64)(const char*,const char*,sqlite3_int64); 248 | const char *(*uri_parameter)(const char*,const char*); 249 | char *(*xvsnprintf)(int,char*,const char*,va_list); 250 | int (*wal_checkpoint_v2)(sqlite3*,const char*,int,int*,int*); 251 | /* Version 3.8.7 and later */ 252 | int (*auto_extension)(void(*)(void)); 253 | int (*bind_blob64)(sqlite3_stmt*,int,const void*,sqlite3_uint64, 254 | void(*)(void*)); 255 | int (*bind_text64)(sqlite3_stmt*,int,const char*,sqlite3_uint64, 256 | void(*)(void*),unsigned char); 257 | int (*cancel_auto_extension)(void(*)(void)); 258 | int (*load_extension)(sqlite3*,const char*,const char*,char**); 259 | void *(*malloc64)(sqlite3_uint64); 260 | sqlite3_uint64 (*msize)(void*); 261 | void *(*realloc64)(void*,sqlite3_uint64); 262 | void (*reset_auto_extension)(void); 263 | void (*result_blob64)(sqlite3_context*,const void*,sqlite3_uint64, 264 | void(*)(void*)); 265 | void (*result_text64)(sqlite3_context*,const char*,sqlite3_uint64, 266 | void(*)(void*), unsigned char); 267 | int (*strglob)(const char*,const char*); 268 | /* Version 3.8.11 and later */ 269 | sqlite3_value *(*value_dup)(const sqlite3_value*); 270 | void (*value_free)(sqlite3_value*); 271 | int (*result_zeroblob64)(sqlite3_context*,sqlite3_uint64); 272 | int (*bind_zeroblob64)(sqlite3_stmt*, int, sqlite3_uint64); 273 | /* Version 3.9.0 and later */ 274 | unsigned int (*value_subtype)(sqlite3_value*); 275 | void (*result_subtype)(sqlite3_context*,unsigned int); 276 | /* Version 3.10.0 and later */ 277 | int (*status64)(int,sqlite3_int64*,sqlite3_int64*,int); 278 | int (*strlike)(const char*,const char*,unsigned int); 279 | int (*db_cacheflush)(sqlite3*); 280 | /* Version 3.12.0 and later */ 281 | int (*system_errno)(sqlite3*); 282 | /* Version 3.14.0 and later */ 283 | int (*trace_v2)(sqlite3*,unsigned,int(*)(unsigned,void*,void*,void*),void*); 284 | char *(*expanded_sql)(sqlite3_stmt*); 285 | /* Version 3.18.0 and later */ 286 | void (*set_last_insert_rowid)(sqlite3*,sqlite3_int64); 287 | /* Version 3.20.0 and later */ 288 | int (*prepare_v3)(sqlite3*,const char*,int,unsigned int, 289 | sqlite3_stmt**,const char**); 290 | int (*prepare16_v3)(sqlite3*,const void*,int,unsigned int, 291 | sqlite3_stmt**,const void**); 292 | int (*bind_pointer)(sqlite3_stmt*,int,void*,const char*,void(*)(void*)); 293 | void (*result_pointer)(sqlite3_context*,void*,const char*,void(*)(void*)); 294 | void *(*value_pointer)(sqlite3_value*,const char*); 295 | int (*vtab_nochange)(sqlite3_context*); 296 | int (*value_nochange)(sqlite3_value*); 297 | const char *(*vtab_collation)(sqlite3_index_info*,int); 298 | /* Version 3.24.0 and later */ 299 | int (*keyword_count)(void); 300 | int (*keyword_name)(int,const char**,int*); 301 | int (*keyword_check)(const char*,int); 302 | sqlite3_str *(*str_new)(sqlite3*); 303 | char *(*str_finish)(sqlite3_str*); 304 | void (*str_appendf)(sqlite3_str*, const char *zFormat, ...); 305 | void (*str_vappendf)(sqlite3_str*, const char *zFormat, va_list); 306 | void (*str_append)(sqlite3_str*, const char *zIn, int N); 307 | void (*str_appendall)(sqlite3_str*, const char *zIn); 308 | void (*str_appendchar)(sqlite3_str*, int N, char C); 309 | void (*str_reset)(sqlite3_str*); 310 | int (*str_errcode)(sqlite3_str*); 311 | int (*str_length)(sqlite3_str*); 312 | char *(*str_value)(sqlite3_str*); 313 | /* Version 3.25.0 and later */ 314 | int (*create_window_function)(sqlite3*,const char*,int,int,void*, 315 | void (*xStep)(sqlite3_context*,int,sqlite3_value**), 316 | void (*xFinal)(sqlite3_context*), 317 | void (*xValue)(sqlite3_context*), 318 | void (*xInv)(sqlite3_context*,int,sqlite3_value**), 319 | void(*xDestroy)(void*)); 320 | /* Version 3.26.0 and later */ 321 | const char *(*normalized_sql)(sqlite3_stmt*); 322 | /* Version 3.28.0 and later */ 323 | int (*stmt_isexplain)(sqlite3_stmt*); 324 | int (*value_frombind)(sqlite3_value*); 325 | /* Version 3.30.0 and later */ 326 | int (*drop_modules)(sqlite3*,const char**); 327 | /* Version 3.31.0 and later */ 328 | sqlite3_int64 (*hard_heap_limit64)(sqlite3_int64); 329 | const char *(*uri_key)(const char*,int); 330 | const char *(*filename_database)(const char*); 331 | const char *(*filename_journal)(const char*); 332 | const char *(*filename_wal)(const char*); 333 | /* Version 3.32.0 and later */ 334 | const char *(*create_filename)(const char*,const char*,const char*, 335 | int,const char**); 336 | void (*free_filename)(const char*); 337 | sqlite3_file *(*database_file_object)(const char*); 338 | /* Version 3.34.0 and later */ 339 | int (*txn_state)(sqlite3*,const char*); 340 | /* Version 3.36.1 and later */ 341 | sqlite3_int64 (*changes64)(sqlite3*); 342 | sqlite3_int64 (*total_changes64)(sqlite3*); 343 | /* Version 3.37.0 and later */ 344 | int (*autovacuum_pages)(sqlite3*, 345 | unsigned int(*)(void*,const char*,unsigned int,unsigned int,unsigned int), 346 | void*, void(*)(void*)); 347 | /* Version 3.38.0 and later */ 348 | int (*error_offset)(sqlite3*); 349 | int (*vtab_rhs_value)(sqlite3_index_info*,int,sqlite3_value**); 350 | int (*vtab_distinct)(sqlite3_index_info*); 351 | int (*vtab_in)(sqlite3_index_info*,int,int); 352 | int (*vtab_in_first)(sqlite3_value*,sqlite3_value**); 353 | int (*vtab_in_next)(sqlite3_value*,sqlite3_value**); 354 | /* Version 3.39.0 and later */ 355 | int (*deserialize)(sqlite3*,const char*,unsigned char*, 356 | sqlite3_int64,sqlite3_int64,unsigned); 357 | unsigned char *(*serialize)(sqlite3*,const char *,sqlite3_int64*, 358 | unsigned int); 359 | const char *(*db_name)(sqlite3*,int); 360 | /* Version 3.40.0 and later */ 361 | int (*value_encoding)(sqlite3_value*); 362 | /* Version 3.41.0 and later */ 363 | int (*is_interrupted)(sqlite3*); 364 | /* Version 3.43.0 and later */ 365 | int (*stmt_explain)(sqlite3_stmt*,int); 366 | /* Version 3.44.0 and later */ 367 | void *(*get_clientdata)(sqlite3*,const char*); 368 | int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*)); 369 | }; 370 | 371 | /* 372 | ** This is the function signature used for all extension entry points. It 373 | ** is also defined in the file "loadext.c". 374 | */ 375 | typedef int (*sqlite3_loadext_entry)( 376 | sqlite3 *db, /* Handle to the database. */ 377 | char **pzErrMsg, /* Used to set error string on failure. */ 378 | const sqlite3_api_routines *pThunk /* Extension API function pointers. */ 379 | ); 380 | 381 | /* 382 | ** The following macros redefine the API routines so that they are 383 | ** redirected through the global sqlite3_api structure. 384 | ** 385 | ** This header file is also used by the loadext.c source file 386 | ** (part of the main SQLite library - not an extension) so that 387 | ** it can get access to the sqlite3_api_routines structure 388 | ** definition. But the main library does not want to redefine 389 | ** the API. So the redefinition macros are only valid if the 390 | ** SQLITE_CORE macros is undefined. 391 | */ 392 | #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) 393 | #define sqlite3_aggregate_context sqlite3_api->aggregate_context 394 | #ifndef SQLITE_OMIT_DEPRECATED 395 | #define sqlite3_aggregate_count sqlite3_api->aggregate_count 396 | #endif 397 | #define sqlite3_bind_blob sqlite3_api->bind_blob 398 | #define sqlite3_bind_double sqlite3_api->bind_double 399 | #define sqlite3_bind_int sqlite3_api->bind_int 400 | #define sqlite3_bind_int64 sqlite3_api->bind_int64 401 | #define sqlite3_bind_null sqlite3_api->bind_null 402 | #define sqlite3_bind_parameter_count sqlite3_api->bind_parameter_count 403 | #define sqlite3_bind_parameter_index sqlite3_api->bind_parameter_index 404 | #define sqlite3_bind_parameter_name sqlite3_api->bind_parameter_name 405 | #define sqlite3_bind_text sqlite3_api->bind_text 406 | #define sqlite3_bind_text16 sqlite3_api->bind_text16 407 | #define sqlite3_bind_value sqlite3_api->bind_value 408 | #define sqlite3_busy_handler sqlite3_api->busy_handler 409 | #define sqlite3_busy_timeout sqlite3_api->busy_timeout 410 | #define sqlite3_changes sqlite3_api->changes 411 | #define sqlite3_close sqlite3_api->close 412 | #define sqlite3_collation_needed sqlite3_api->collation_needed 413 | #define sqlite3_collation_needed16 sqlite3_api->collation_needed16 414 | #define sqlite3_column_blob sqlite3_api->column_blob 415 | #define sqlite3_column_bytes sqlite3_api->column_bytes 416 | #define sqlite3_column_bytes16 sqlite3_api->column_bytes16 417 | #define sqlite3_column_count sqlite3_api->column_count 418 | #define sqlite3_column_database_name sqlite3_api->column_database_name 419 | #define sqlite3_column_database_name16 sqlite3_api->column_database_name16 420 | #define sqlite3_column_decltype sqlite3_api->column_decltype 421 | #define sqlite3_column_decltype16 sqlite3_api->column_decltype16 422 | #define sqlite3_column_double sqlite3_api->column_double 423 | #define sqlite3_column_int sqlite3_api->column_int 424 | #define sqlite3_column_int64 sqlite3_api->column_int64 425 | #define sqlite3_column_name sqlite3_api->column_name 426 | #define sqlite3_column_name16 sqlite3_api->column_name16 427 | #define sqlite3_column_origin_name sqlite3_api->column_origin_name 428 | #define sqlite3_column_origin_name16 sqlite3_api->column_origin_name16 429 | #define sqlite3_column_table_name sqlite3_api->column_table_name 430 | #define sqlite3_column_table_name16 sqlite3_api->column_table_name16 431 | #define sqlite3_column_text sqlite3_api->column_text 432 | #define sqlite3_column_text16 sqlite3_api->column_text16 433 | #define sqlite3_column_type sqlite3_api->column_type 434 | #define sqlite3_column_value sqlite3_api->column_value 435 | #define sqlite3_commit_hook sqlite3_api->commit_hook 436 | #define sqlite3_complete sqlite3_api->complete 437 | #define sqlite3_complete16 sqlite3_api->complete16 438 | #define sqlite3_create_collation sqlite3_api->create_collation 439 | #define sqlite3_create_collation16 sqlite3_api->create_collation16 440 | #define sqlite3_create_function sqlite3_api->create_function 441 | #define sqlite3_create_function16 sqlite3_api->create_function16 442 | #define sqlite3_create_module sqlite3_api->create_module 443 | #define sqlite3_create_module_v2 sqlite3_api->create_module_v2 444 | #define sqlite3_data_count sqlite3_api->data_count 445 | #define sqlite3_db_handle sqlite3_api->db_handle 446 | #define sqlite3_declare_vtab sqlite3_api->declare_vtab 447 | #define sqlite3_enable_shared_cache sqlite3_api->enable_shared_cache 448 | #define sqlite3_errcode sqlite3_api->errcode 449 | #define sqlite3_errmsg sqlite3_api->errmsg 450 | #define sqlite3_errmsg16 sqlite3_api->errmsg16 451 | #define sqlite3_exec sqlite3_api->exec 452 | #ifndef SQLITE_OMIT_DEPRECATED 453 | #define sqlite3_expired sqlite3_api->expired 454 | #endif 455 | #define sqlite3_finalize sqlite3_api->finalize 456 | #define sqlite3_free sqlite3_api->free 457 | #define sqlite3_free_table sqlite3_api->free_table 458 | #define sqlite3_get_autocommit sqlite3_api->get_autocommit 459 | #define sqlite3_get_auxdata sqlite3_api->get_auxdata 460 | #define sqlite3_get_table sqlite3_api->get_table 461 | #ifndef SQLITE_OMIT_DEPRECATED 462 | #define sqlite3_global_recover sqlite3_api->global_recover 463 | #endif 464 | #define sqlite3_interrupt sqlite3_api->interruptx 465 | #define sqlite3_last_insert_rowid sqlite3_api->last_insert_rowid 466 | #define sqlite3_libversion sqlite3_api->libversion 467 | #define sqlite3_libversion_number sqlite3_api->libversion_number 468 | #define sqlite3_malloc sqlite3_api->malloc 469 | #define sqlite3_mprintf sqlite3_api->mprintf 470 | #define sqlite3_open sqlite3_api->open 471 | #define sqlite3_open16 sqlite3_api->open16 472 | #define sqlite3_prepare sqlite3_api->prepare 473 | #define sqlite3_prepare16 sqlite3_api->prepare16 474 | #define sqlite3_prepare_v2 sqlite3_api->prepare_v2 475 | #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 476 | #define sqlite3_profile sqlite3_api->profile 477 | #define sqlite3_progress_handler sqlite3_api->progress_handler 478 | #define sqlite3_realloc sqlite3_api->realloc 479 | #define sqlite3_reset sqlite3_api->reset 480 | #define sqlite3_result_blob sqlite3_api->result_blob 481 | #define sqlite3_result_double sqlite3_api->result_double 482 | #define sqlite3_result_error sqlite3_api->result_error 483 | #define sqlite3_result_error16 sqlite3_api->result_error16 484 | #define sqlite3_result_int sqlite3_api->result_int 485 | #define sqlite3_result_int64 sqlite3_api->result_int64 486 | #define sqlite3_result_null sqlite3_api->result_null 487 | #define sqlite3_result_text sqlite3_api->result_text 488 | #define sqlite3_result_text16 sqlite3_api->result_text16 489 | #define sqlite3_result_text16be sqlite3_api->result_text16be 490 | #define sqlite3_result_text16le sqlite3_api->result_text16le 491 | #define sqlite3_result_value sqlite3_api->result_value 492 | #define sqlite3_rollback_hook sqlite3_api->rollback_hook 493 | #define sqlite3_set_authorizer sqlite3_api->set_authorizer 494 | #define sqlite3_set_auxdata sqlite3_api->set_auxdata 495 | #define sqlite3_snprintf sqlite3_api->xsnprintf 496 | #define sqlite3_step sqlite3_api->step 497 | #define sqlite3_table_column_metadata sqlite3_api->table_column_metadata 498 | #define sqlite3_thread_cleanup sqlite3_api->thread_cleanup 499 | #define sqlite3_total_changes sqlite3_api->total_changes 500 | #define sqlite3_trace sqlite3_api->trace 501 | #ifndef SQLITE_OMIT_DEPRECATED 502 | #define sqlite3_transfer_bindings sqlite3_api->transfer_bindings 503 | #endif 504 | #define sqlite3_update_hook sqlite3_api->update_hook 505 | #define sqlite3_user_data sqlite3_api->user_data 506 | #define sqlite3_value_blob sqlite3_api->value_blob 507 | #define sqlite3_value_bytes sqlite3_api->value_bytes 508 | #define sqlite3_value_bytes16 sqlite3_api->value_bytes16 509 | #define sqlite3_value_double sqlite3_api->value_double 510 | #define sqlite3_value_int sqlite3_api->value_int 511 | #define sqlite3_value_int64 sqlite3_api->value_int64 512 | #define sqlite3_value_numeric_type sqlite3_api->value_numeric_type 513 | #define sqlite3_value_text sqlite3_api->value_text 514 | #define sqlite3_value_text16 sqlite3_api->value_text16 515 | #define sqlite3_value_text16be sqlite3_api->value_text16be 516 | #define sqlite3_value_text16le sqlite3_api->value_text16le 517 | #define sqlite3_value_type sqlite3_api->value_type 518 | #define sqlite3_vmprintf sqlite3_api->vmprintf 519 | #define sqlite3_vsnprintf sqlite3_api->xvsnprintf 520 | #define sqlite3_overload_function sqlite3_api->overload_function 521 | #define sqlite3_prepare_v2 sqlite3_api->prepare_v2 522 | #define sqlite3_prepare16_v2 sqlite3_api->prepare16_v2 523 | #define sqlite3_clear_bindings sqlite3_api->clear_bindings 524 | #define sqlite3_bind_zeroblob sqlite3_api->bind_zeroblob 525 | #define sqlite3_blob_bytes sqlite3_api->blob_bytes 526 | #define sqlite3_blob_close sqlite3_api->blob_close 527 | #define sqlite3_blob_open sqlite3_api->blob_open 528 | #define sqlite3_blob_read sqlite3_api->blob_read 529 | #define sqlite3_blob_write sqlite3_api->blob_write 530 | #define sqlite3_create_collation_v2 sqlite3_api->create_collation_v2 531 | #define sqlite3_file_control sqlite3_api->file_control 532 | #define sqlite3_memory_highwater sqlite3_api->memory_highwater 533 | #define sqlite3_memory_used sqlite3_api->memory_used 534 | #define sqlite3_mutex_alloc sqlite3_api->mutex_alloc 535 | #define sqlite3_mutex_enter sqlite3_api->mutex_enter 536 | #define sqlite3_mutex_free sqlite3_api->mutex_free 537 | #define sqlite3_mutex_leave sqlite3_api->mutex_leave 538 | #define sqlite3_mutex_try sqlite3_api->mutex_try 539 | #define sqlite3_open_v2 sqlite3_api->open_v2 540 | #define sqlite3_release_memory sqlite3_api->release_memory 541 | #define sqlite3_result_error_nomem sqlite3_api->result_error_nomem 542 | #define sqlite3_result_error_toobig sqlite3_api->result_error_toobig 543 | #define sqlite3_sleep sqlite3_api->sleep 544 | #define sqlite3_soft_heap_limit sqlite3_api->soft_heap_limit 545 | #define sqlite3_vfs_find sqlite3_api->vfs_find 546 | #define sqlite3_vfs_register sqlite3_api->vfs_register 547 | #define sqlite3_vfs_unregister sqlite3_api->vfs_unregister 548 | #define sqlite3_threadsafe sqlite3_api->xthreadsafe 549 | #define sqlite3_result_zeroblob sqlite3_api->result_zeroblob 550 | #define sqlite3_result_error_code sqlite3_api->result_error_code 551 | #define sqlite3_test_control sqlite3_api->test_control 552 | #define sqlite3_randomness sqlite3_api->randomness 553 | #define sqlite3_context_db_handle sqlite3_api->context_db_handle 554 | #define sqlite3_extended_result_codes sqlite3_api->extended_result_codes 555 | #define sqlite3_limit sqlite3_api->limit 556 | #define sqlite3_next_stmt sqlite3_api->next_stmt 557 | #define sqlite3_sql sqlite3_api->sql 558 | #define sqlite3_status sqlite3_api->status 559 | #define sqlite3_backup_finish sqlite3_api->backup_finish 560 | #define sqlite3_backup_init sqlite3_api->backup_init 561 | #define sqlite3_backup_pagecount sqlite3_api->backup_pagecount 562 | #define sqlite3_backup_remaining sqlite3_api->backup_remaining 563 | #define sqlite3_backup_step sqlite3_api->backup_step 564 | #define sqlite3_compileoption_get sqlite3_api->compileoption_get 565 | #define sqlite3_compileoption_used sqlite3_api->compileoption_used 566 | #define sqlite3_create_function_v2 sqlite3_api->create_function_v2 567 | #define sqlite3_db_config sqlite3_api->db_config 568 | #define sqlite3_db_mutex sqlite3_api->db_mutex 569 | #define sqlite3_db_status sqlite3_api->db_status 570 | #define sqlite3_extended_errcode sqlite3_api->extended_errcode 571 | #define sqlite3_log sqlite3_api->log 572 | #define sqlite3_soft_heap_limit64 sqlite3_api->soft_heap_limit64 573 | #define sqlite3_sourceid sqlite3_api->sourceid 574 | #define sqlite3_stmt_status sqlite3_api->stmt_status 575 | #define sqlite3_strnicmp sqlite3_api->strnicmp 576 | #define sqlite3_unlock_notify sqlite3_api->unlock_notify 577 | #define sqlite3_wal_autocheckpoint sqlite3_api->wal_autocheckpoint 578 | #define sqlite3_wal_checkpoint sqlite3_api->wal_checkpoint 579 | #define sqlite3_wal_hook sqlite3_api->wal_hook 580 | #define sqlite3_blob_reopen sqlite3_api->blob_reopen 581 | #define sqlite3_vtab_config sqlite3_api->vtab_config 582 | #define sqlite3_vtab_on_conflict sqlite3_api->vtab_on_conflict 583 | /* Version 3.7.16 and later */ 584 | #define sqlite3_close_v2 sqlite3_api->close_v2 585 | #define sqlite3_db_filename sqlite3_api->db_filename 586 | #define sqlite3_db_readonly sqlite3_api->db_readonly 587 | #define sqlite3_db_release_memory sqlite3_api->db_release_memory 588 | #define sqlite3_errstr sqlite3_api->errstr 589 | #define sqlite3_stmt_busy sqlite3_api->stmt_busy 590 | #define sqlite3_stmt_readonly sqlite3_api->stmt_readonly 591 | #define sqlite3_stricmp sqlite3_api->stricmp 592 | #define sqlite3_uri_boolean sqlite3_api->uri_boolean 593 | #define sqlite3_uri_int64 sqlite3_api->uri_int64 594 | #define sqlite3_uri_parameter sqlite3_api->uri_parameter 595 | #define sqlite3_uri_vsnprintf sqlite3_api->xvsnprintf 596 | #define sqlite3_wal_checkpoint_v2 sqlite3_api->wal_checkpoint_v2 597 | /* Version 3.8.7 and later */ 598 | #define sqlite3_auto_extension sqlite3_api->auto_extension 599 | #define sqlite3_bind_blob64 sqlite3_api->bind_blob64 600 | #define sqlite3_bind_text64 sqlite3_api->bind_text64 601 | #define sqlite3_cancel_auto_extension sqlite3_api->cancel_auto_extension 602 | #define sqlite3_load_extension sqlite3_api->load_extension 603 | #define sqlite3_malloc64 sqlite3_api->malloc64 604 | #define sqlite3_msize sqlite3_api->msize 605 | #define sqlite3_realloc64 sqlite3_api->realloc64 606 | #define sqlite3_reset_auto_extension sqlite3_api->reset_auto_extension 607 | #define sqlite3_result_blob64 sqlite3_api->result_blob64 608 | #define sqlite3_result_text64 sqlite3_api->result_text64 609 | #define sqlite3_strglob sqlite3_api->strglob 610 | /* Version 3.8.11 and later */ 611 | #define sqlite3_value_dup sqlite3_api->value_dup 612 | #define sqlite3_value_free sqlite3_api->value_free 613 | #define sqlite3_result_zeroblob64 sqlite3_api->result_zeroblob64 614 | #define sqlite3_bind_zeroblob64 sqlite3_api->bind_zeroblob64 615 | /* Version 3.9.0 and later */ 616 | #define sqlite3_value_subtype sqlite3_api->value_subtype 617 | #define sqlite3_result_subtype sqlite3_api->result_subtype 618 | /* Version 3.10.0 and later */ 619 | #define sqlite3_status64 sqlite3_api->status64 620 | #define sqlite3_strlike sqlite3_api->strlike 621 | #define sqlite3_db_cacheflush sqlite3_api->db_cacheflush 622 | /* Version 3.12.0 and later */ 623 | #define sqlite3_system_errno sqlite3_api->system_errno 624 | /* Version 3.14.0 and later */ 625 | #define sqlite3_trace_v2 sqlite3_api->trace_v2 626 | #define sqlite3_expanded_sql sqlite3_api->expanded_sql 627 | /* Version 3.18.0 and later */ 628 | #define sqlite3_set_last_insert_rowid sqlite3_api->set_last_insert_rowid 629 | /* Version 3.20.0 and later */ 630 | #define sqlite3_prepare_v3 sqlite3_api->prepare_v3 631 | #define sqlite3_prepare16_v3 sqlite3_api->prepare16_v3 632 | #define sqlite3_bind_pointer sqlite3_api->bind_pointer 633 | #define sqlite3_result_pointer sqlite3_api->result_pointer 634 | #define sqlite3_value_pointer sqlite3_api->value_pointer 635 | /* Version 3.22.0 and later */ 636 | #define sqlite3_vtab_nochange sqlite3_api->vtab_nochange 637 | #define sqlite3_value_nochange sqlite3_api->value_nochange 638 | #define sqlite3_vtab_collation sqlite3_api->vtab_collation 639 | /* Version 3.24.0 and later */ 640 | #define sqlite3_keyword_count sqlite3_api->keyword_count 641 | #define sqlite3_keyword_name sqlite3_api->keyword_name 642 | #define sqlite3_keyword_check sqlite3_api->keyword_check 643 | #define sqlite3_str_new sqlite3_api->str_new 644 | #define sqlite3_str_finish sqlite3_api->str_finish 645 | #define sqlite3_str_appendf sqlite3_api->str_appendf 646 | #define sqlite3_str_vappendf sqlite3_api->str_vappendf 647 | #define sqlite3_str_append sqlite3_api->str_append 648 | #define sqlite3_str_appendall sqlite3_api->str_appendall 649 | #define sqlite3_str_appendchar sqlite3_api->str_appendchar 650 | #define sqlite3_str_reset sqlite3_api->str_reset 651 | #define sqlite3_str_errcode sqlite3_api->str_errcode 652 | #define sqlite3_str_length sqlite3_api->str_length 653 | #define sqlite3_str_value sqlite3_api->str_value 654 | /* Version 3.25.0 and later */ 655 | #define sqlite3_create_window_function sqlite3_api->create_window_function 656 | /* Version 3.26.0 and later */ 657 | #define sqlite3_normalized_sql sqlite3_api->normalized_sql 658 | /* Version 3.28.0 and later */ 659 | #define sqlite3_stmt_isexplain sqlite3_api->stmt_isexplain 660 | #define sqlite3_value_frombind sqlite3_api->value_frombind 661 | /* Version 3.30.0 and later */ 662 | #define sqlite3_drop_modules sqlite3_api->drop_modules 663 | /* Version 3.31.0 and later */ 664 | #define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64 665 | #define sqlite3_uri_key sqlite3_api->uri_key 666 | #define sqlite3_filename_database sqlite3_api->filename_database 667 | #define sqlite3_filename_journal sqlite3_api->filename_journal 668 | #define sqlite3_filename_wal sqlite3_api->filename_wal 669 | /* Version 3.32.0 and later */ 670 | #define sqlite3_create_filename sqlite3_api->create_filename 671 | #define sqlite3_free_filename sqlite3_api->free_filename 672 | #define sqlite3_database_file_object sqlite3_api->database_file_object 673 | /* Version 3.34.0 and later */ 674 | #define sqlite3_txn_state sqlite3_api->txn_state 675 | /* Version 3.36.1 and later */ 676 | #define sqlite3_changes64 sqlite3_api->changes64 677 | #define sqlite3_total_changes64 sqlite3_api->total_changes64 678 | /* Version 3.37.0 and later */ 679 | #define sqlite3_autovacuum_pages sqlite3_api->autovacuum_pages 680 | /* Version 3.38.0 and later */ 681 | #define sqlite3_error_offset sqlite3_api->error_offset 682 | #define sqlite3_vtab_rhs_value sqlite3_api->vtab_rhs_value 683 | #define sqlite3_vtab_distinct sqlite3_api->vtab_distinct 684 | #define sqlite3_vtab_in sqlite3_api->vtab_in 685 | #define sqlite3_vtab_in_first sqlite3_api->vtab_in_first 686 | #define sqlite3_vtab_in_next sqlite3_api->vtab_in_next 687 | /* Version 3.39.0 and later */ 688 | #ifndef SQLITE_OMIT_DESERIALIZE 689 | #define sqlite3_deserialize sqlite3_api->deserialize 690 | #define sqlite3_serialize sqlite3_api->serialize 691 | #endif 692 | #define sqlite3_db_name sqlite3_api->db_name 693 | /* Version 3.40.0 and later */ 694 | #define sqlite3_value_encoding sqlite3_api->value_encoding 695 | /* Version 3.41.0 and later */ 696 | #define sqlite3_is_interrupted sqlite3_api->is_interrupted 697 | /* Version 3.43.0 and later */ 698 | #define sqlite3_stmt_explain sqlite3_api->stmt_explain 699 | /* Version 3.44.0 and later */ 700 | #define sqlite3_get_clientdata sqlite3_api->get_clientdata 701 | #define sqlite3_set_clientdata sqlite3_api->set_clientdata 702 | #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ 703 | 704 | #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) 705 | /* This case when the file really is being compiled as a loadable 706 | ** extension */ 707 | # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; 708 | # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; 709 | # define SQLITE_EXTENSION_INIT3 \ 710 | extern const sqlite3_api_routines *sqlite3_api; 711 | #else 712 | /* This case when the file is being statically linked into the 713 | ** application */ 714 | # define SQLITE_EXTENSION_INIT1 /*no-op*/ 715 | # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ 716 | # define SQLITE_EXTENSION_INIT3 /*no-op*/ 717 | #endif 718 | 719 | #endif /* SQLITE3EXT_H */ 720 | -------------------------------------------------------------------------------- /Lib/sqlite3win32.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | sqlite3_aggregate_context=_sqlite3_aggregate_context@8 3 | sqlite3_auto_extension=_sqlite3_auto_extension@4 4 | sqlite3_autovacuum_pages=_sqlite3_autovacuum_pages@16 5 | sqlite3_backup_finish=_sqlite3_backup_finish@4 6 | sqlite3_backup_init=_sqlite3_backup_init@16 7 | sqlite3_backup_pagecount=_sqlite3_backup_pagecount@4 8 | sqlite3_backup_remaining=_sqlite3_backup_remaining@4 9 | sqlite3_backup_step=_sqlite3_backup_step@8 10 | sqlite3_bind_blob64=_sqlite3_bind_blob64@24 11 | sqlite3_bind_blob=_sqlite3_bind_blob@20 12 | sqlite3_bind_double=_sqlite3_bind_double@16 13 | sqlite3_bind_int64=_sqlite3_bind_int64@16 14 | sqlite3_bind_int=_sqlite3_bind_int@12 15 | sqlite3_bind_null=_sqlite3_bind_null@8 16 | sqlite3_bind_parameter_count=_sqlite3_bind_parameter_count@4 17 | sqlite3_bind_parameter_index=_sqlite3_bind_parameter_index@8 18 | sqlite3_bind_parameter_name=_sqlite3_bind_parameter_name@8 19 | sqlite3_bind_pointer=_sqlite3_bind_pointer@20 20 | sqlite3_bind_text16=_sqlite3_bind_text16@20 21 | sqlite3_bind_text64=_sqlite3_bind_text64@28 22 | sqlite3_bind_text=_sqlite3_bind_text@20 23 | sqlite3_bind_value=_sqlite3_bind_value@12 24 | sqlite3_bind_zeroblob64=_sqlite3_bind_zeroblob64@16 25 | sqlite3_bind_zeroblob=_sqlite3_bind_zeroblob@12 26 | sqlite3_blob_bytes=_sqlite3_blob_bytes@4 27 | sqlite3_blob_close=_sqlite3_blob_close@4 28 | sqlite3_blob_open=_sqlite3_blob_open@32 29 | sqlite3_blob_read=_sqlite3_blob_read@16 30 | sqlite3_blob_reopen=_sqlite3_blob_reopen@12 31 | sqlite3_blob_write=_sqlite3_blob_write@16 32 | sqlite3_busy_handler=_sqlite3_busy_handler@12 33 | sqlite3_busy_timeout=_sqlite3_busy_timeout@8 34 | sqlite3_cancel_auto_extension=_sqlite3_cancel_auto_extension@4 35 | sqlite3_changes=_sqlite3_changes@4 36 | sqlite3_changes64=_sqlite3_changes64@4 37 | sqlite3_clear_bindings=_sqlite3_clear_bindings@4 38 | sqlite3_close=_sqlite3_close@4 39 | sqlite3_close_v2=_sqlite3_close_v2@4 40 | sqlite3_collation_needed16=_sqlite3_collation_needed16@12 41 | sqlite3_collation_needed=_sqlite3_collation_needed@12 42 | sqlite3_column_blob=_sqlite3_column_blob@8 43 | sqlite3_column_bytes16=_sqlite3_column_bytes16@8 44 | sqlite3_column_bytes=_sqlite3_column_bytes@8 45 | sqlite3_column_count=_sqlite3_column_count@4 46 | sqlite3_column_database_name16=_sqlite3_column_database_name16@8 47 | sqlite3_column_database_name=_sqlite3_column_database_name@8 48 | sqlite3_column_decltype16=_sqlite3_column_decltype16@8 49 | sqlite3_column_decltype=_sqlite3_column_decltype@8 50 | sqlite3_column_double=_sqlite3_column_double@8 51 | sqlite3_column_int64=_sqlite3_column_int64@8 52 | sqlite3_column_int=_sqlite3_column_int@8 53 | sqlite3_column_name16=_sqlite3_column_name16@8 54 | sqlite3_column_name=_sqlite3_column_name@8 55 | sqlite3_column_origin_name16=_sqlite3_column_origin_name16@8 56 | sqlite3_column_origin_name=_sqlite3_column_origin_name@8 57 | sqlite3_column_table_name16=_sqlite3_column_table_name16@8 58 | sqlite3_column_table_name=_sqlite3_column_table_name@8 59 | sqlite3_column_text16=_sqlite3_column_text16@8 60 | sqlite3_column_text=_sqlite3_column_text@8 61 | sqlite3_column_type=_sqlite3_column_type@8 62 | sqlite3_column_value=_sqlite3_column_value@8 63 | sqlite3_commit_hook=_sqlite3_commit_hook@12 64 | sqlite3_compileoption_get=_sqlite3_compileoption_get@4 65 | sqlite3_compileoption_used=_sqlite3_compileoption_used@4 66 | sqlite3_complete16=_sqlite3_complete16@4 67 | sqlite3_complete=_sqlite3_complete@4 68 | sqlite3_context_db_handle=_sqlite3_context_db_handle@4 69 | sqlite3_create_collation16=_sqlite3_create_collation16@20 70 | sqlite3_create_collation=_sqlite3_create_collation@20 71 | sqlite3_create_collation_v2=_sqlite3_create_collation_v2@24 72 | sqlite3_create_filename=_sqlite3_create_filename@20 73 | sqlite3_create_function16=_sqlite3_create_function16@32 74 | sqlite3_create_function=_sqlite3_create_function@32 75 | sqlite3_create_function_v2=_sqlite3_create_function_v2@36 76 | sqlite3_create_module=_sqlite3_create_module@16 77 | sqlite3_create_module_v2=_sqlite3_create_module_v2@20 78 | sqlite3_create_window_function=_sqlite3_create_window_function@40 79 | sqlite3_database_file_object=_sqlite3_database_file_object@4 80 | sqlite3_data_count=_sqlite3_data_count@4 81 | sqlite3_db_cacheflush=_sqlite3_db_cacheflush@4 82 | sqlite3_db_filename=_sqlite3_db_filename@8 83 | sqlite3_db_handle=_sqlite3_db_handle@4 84 | sqlite3_db_mutex=_sqlite3_db_mutex@4 85 | sqlite3_db_name=_sqlite3_db_name@8 86 | sqlite3_db_readonly=_sqlite3_db_readonly@8 87 | sqlite3_db_release_memory=_sqlite3_db_release_memory@4 88 | sqlite3_db_status=_sqlite3_db_status@20 89 | sqlite3_declare_vtab=_sqlite3_declare_vtab@8 90 | sqlite3_deserialize=_sqlite3_deserialize@32 91 | sqlite3_drop_modules=_sqlite3_drop_modules@8 92 | sqlite3_enable_load_extension=_sqlite3_enable_load_extension@8 93 | sqlite3_enable_shared_cache=_sqlite3_enable_shared_cache@4 94 | sqlite3_errcode=_sqlite3_errcode@4 95 | sqlite3_errmsg16=_sqlite3_errmsg16@4 96 | sqlite3_errmsg=_sqlite3_errmsg@4 97 | sqlite3_error_offset=_sqlite3_error_offset@4 98 | sqlite3_errstr=_sqlite3_errstr@4 99 | sqlite3_exec=_sqlite3_exec@20 100 | sqlite3_expanded_sql=_sqlite3_expanded_sql@4 101 | sqlite3_extended_errcode=_sqlite3_extended_errcode@4 102 | sqlite3_extended_result_codes=_sqlite3_extended_result_codes@8 103 | sqlite3_file_control=_sqlite3_file_control@16 104 | sqlite3_filename_database=_sqlite3_filename_database@4 105 | sqlite3_filename_journal=_sqlite3_filename_journal@4 106 | sqlite3_filename_wal=_sqlite3_filename_wal@4 107 | sqlite3_finalize=_sqlite3_finalize@4 108 | sqlite3_free=_sqlite3_free@4 109 | sqlite3_free_filename=_sqlite3_free_filename@4 110 | sqlite3_free_table=_sqlite3_free_table@4 111 | sqlite3_get_autocommit=_sqlite3_get_autocommit@4 112 | sqlite3_get_auxdata=_sqlite3_get_auxdata@8 113 | sqlite3_get_clientdata=_sqlite3_get_clientdata@8 114 | sqlite3_get_table=_sqlite3_get_table@24 115 | sqlite3_hard_heap_limit64=_sqlite3_hard_heap_limit64@8 116 | sqlite3_initialize=_sqlite3_initialize@0 117 | sqlite3_interrupt=_sqlite3_interrupt@4 118 | sqlite3_is_interrupted=_sqlite3_is_interrupted@4 119 | sqlite3_keyword_check=_sqlite3_keyword_check@8 120 | sqlite3_keyword_count=_sqlite3_keyword_count@0 121 | sqlite3_keyword_name=_sqlite3_keyword_name@12 122 | sqlite3_last_insert_rowid=_sqlite3_last_insert_rowid@4 123 | sqlite3_libversion=_sqlite3_libversion@0 124 | sqlite3_libversion_number=_sqlite3_libversion_number@0 125 | sqlite3_limit=_sqlite3_limit@12 126 | sqlite3_load_extension=_sqlite3_load_extension@16 127 | sqlite3_malloc64=_sqlite3_malloc64@8 128 | sqlite3_malloc=_sqlite3_malloc@4 129 | sqlite3_memory_highwater=_sqlite3_memory_highwater@4 130 | sqlite3_memory_used=_sqlite3_memory_used@0 131 | sqlite3_msize=_sqlite3_msize@4 132 | sqlite3_mutex_alloc=_sqlite3_mutex_alloc@4 133 | sqlite3_mutex_enter=_sqlite3_mutex_enter@4 134 | sqlite3_mutex_free=_sqlite3_mutex_free@4 135 | sqlite3_mutex_leave=_sqlite3_mutex_leave@4 136 | sqlite3_mutex_try=_sqlite3_mutex_try@4 137 | sqlite3_next_stmt=_sqlite3_next_stmt@8 138 | sqlite3_normalized_sql=_sqlite3_normalized_sql@4 139 | sqlite3_open16=_sqlite3_open16@8 140 | sqlite3_open=_sqlite3_open@8 141 | sqlite3_open_v2=_sqlite3_open_v2@16 142 | sqlite3_os_end=_sqlite3_os_end@0 143 | sqlite3_os_init=_sqlite3_os_init@0 144 | sqlite3_overload_function=_sqlite3_overload_function@12 145 | sqlite3_prepare=_sqlite3_prepare@20 146 | sqlite3_prepare_v2=_sqlite3_prepare_v2@20 147 | sqlite3_prepare_v3=_sqlite3_prepare_v3@24 148 | sqlite3_prepare16=_sqlite3_prepare16@20 149 | sqlite3_prepare16_v2=_sqlite3_prepare16_v2@20 150 | sqlite3_prepare16_v3=_sqlite3_prepare16_v3@24 151 | sqlite3_progress_handler=_sqlite3_progress_handler@16 152 | sqlite3_randomness=_sqlite3_randomness@8 153 | sqlite3_realloc64=_sqlite3_realloc64@12 154 | sqlite3_realloc=_sqlite3_realloc@8 155 | sqlite3_release_memory=_sqlite3_release_memory@4 156 | sqlite3_reset=_sqlite3_reset@4 157 | sqlite3_reset_auto_extension=_sqlite3_reset_auto_extension@0 158 | sqlite3_result_blob64=_sqlite3_result_blob64@20 159 | sqlite3_result_blob=_sqlite3_result_blob@16 160 | sqlite3_result_double=_sqlite3_result_double@12 161 | sqlite3_result_error16=_sqlite3_result_error16@12 162 | sqlite3_result_error=_sqlite3_result_error@12 163 | sqlite3_result_error_code=_sqlite3_result_error_code@8 164 | sqlite3_result_error_nomem=_sqlite3_result_error_nomem@4 165 | sqlite3_result_error_toobig=_sqlite3_result_error_toobig@4 166 | sqlite3_result_int64=_sqlite3_result_int64@12 167 | sqlite3_result_int=_sqlite3_result_int@8 168 | sqlite3_result_null=_sqlite3_result_null@4 169 | sqlite3_result_subtype=_sqlite3_result_subtype@8 170 | sqlite3_result_text16=_sqlite3_result_text16@16 171 | sqlite3_result_text16be=_sqlite3_result_text16be@16 172 | sqlite3_result_text16le=_sqlite3_result_text16le@16 173 | sqlite3_result_text64=_sqlite3_result_text64@24 174 | sqlite3_result_text=_sqlite3_result_text@16 175 | sqlite3_result_value=_sqlite3_result_value@8 176 | sqlite3_result_pointer=_sqlite3_result_pointer@16 177 | sqlite3_result_zeroblob64=_sqlite3_result_zeroblob64@12 178 | sqlite3_result_zeroblob=_sqlite3_result_zeroblob@8 179 | sqlite3_rollback_hook=_sqlite3_rollback_hook@12 180 | sqlite3_serialize=_sqlite3_serialize@16 181 | sqlite3_rtree_geometry_callback=_sqlite3_rtree_geometry_callback@16 182 | sqlite3_rtree_query_callback=_sqlite3_rtree_query_callback@20 183 | sqlite3_set_authorizer=_sqlite3_set_authorizer@12 184 | sqlite3_set_auxdata=_sqlite3_set_auxdata@16 185 | sqlite3_set_clientdata=_sqlite3_set_clientdata@16 186 | sqlite3_set_last_insert_rowid=_sqlite3_set_last_insert_rowid@12 187 | sqlite3_shutdown=_sqlite3_shutdown@0 188 | sqlite3_sleep=_sqlite3_sleep@4 189 | sqlite3_soft_heap_limit64=_sqlite3_soft_heap_limit64@8 190 | sqlite3_soft_heap_limit=_sqlite3_soft_heap_limit@4 191 | sqlite3_sourceid=_sqlite3_sourceid@0 192 | sqlite3_sql=_sqlite3_sql@4 193 | sqlite3_str_new=_sqlite3_str_new@4 194 | sqlite3_str_finish=_sqlite3_str_finish@4 195 | sqlite3_str_append=_sqlite3_str_append@12 196 | sqlite3_str_appendall=_sqlite3_str_appendall@8 197 | sqlite3_str_appendchar=_sqlite3_str_appendchar@12 198 | sqlite3_str_reset=_sqlite3_str_reset@4 199 | sqlite3_str_errcode=_sqlite3_str_errcode@4 200 | sqlite3_str_length=_sqlite3_str_length@4 201 | sqlite3_str_value=_sqlite3_str_value@4 202 | sqlite3_status64=_sqlite3_status64@16 203 | sqlite3_status=_sqlite3_status@16 204 | sqlite3_step=_sqlite3_step@4 205 | sqlite3_stmt_busy=_sqlite3_stmt_busy@4 206 | sqlite3_stmt_explain=_sqlite3_stmt_explain@8 207 | sqlite3_stmt_isexplain=_sqlite3_stmt_isexplain@4 208 | sqlite3_stmt_readonly=_sqlite3_stmt_readonly@4 209 | sqlite3_stmt_status=_sqlite3_stmt_status@12 210 | sqlite3_strglob=_sqlite3_strglob@8 211 | sqlite3_stricmp=_sqlite3_stricmp@8 212 | sqlite3_strlike=_sqlite3_strlike@12 213 | sqlite3_strnicmp=_sqlite3_strnicmp@12 214 | sqlite3_system_errno=_sqlite3_system_errno@4 215 | sqlite3_table_column_metadata=_sqlite3_table_column_metadata@36 216 | sqlite3_threadsafe=_sqlite3_threadsafe@0 217 | sqlite3_total_changes64=_sqlite3_total_changes64@4 218 | sqlite3_total_changes=_sqlite3_total_changes@4 219 | sqlite3_trace_v2=_sqlite3_trace_v2@16 220 | sqlite3_txn_state=_sqlite3_txn_state@8 221 | sqlite3_update_hook=_sqlite3_update_hook@12 222 | sqlite3_uri_boolean=_sqlite3_uri_boolean@12 223 | sqlite3_uri_int64=_sqlite3_uri_int64@16 224 | sqlite3_uri_key=_sqlite3_uri_key@8 225 | sqlite3_uri_parameter=_sqlite3_uri_parameter@8 226 | sqlite3_user_data=_sqlite3_user_data@4 227 | sqlite3_value_blob=_sqlite3_value_blob@4 228 | sqlite3_value_bytes16=_sqlite3_value_bytes16@4 229 | sqlite3_value_bytes=_sqlite3_value_bytes@4 230 | sqlite3_value_double=_sqlite3_value_double@4 231 | sqlite3_value_dup=_sqlite3_value_dup@4 232 | sqlite3_value_encoding=_sqlite3_value_encoding@4 233 | sqlite3_value_free=_sqlite3_value_free@4 234 | sqlite3_value_frombind=_sqlite3_value_frombind@4 235 | sqlite3_value_int64=_sqlite3_value_int64@4 236 | sqlite3_value_int=_sqlite3_value_int@4 237 | sqlite3_value_pointer=_sqlite3_value_pointer@8 238 | sqlite3_value_numeric_type=_sqlite3_value_numeric_type@4 239 | sqlite3_value_nochange=_sqlite3_value_nochange@4 240 | sqlite3_value_subtype=_sqlite3_value_subtype@4 241 | sqlite3_value_text16=_sqlite3_value_text16@4 242 | sqlite3_value_text16be=_sqlite3_value_text16be@4 243 | sqlite3_value_text16le=_sqlite3_value_text16le@4 244 | sqlite3_value_text=_sqlite3_value_text@4 245 | sqlite3_value_type=_sqlite3_value_type@4 246 | sqlite3_vfs_find=_sqlite3_vfs_find@4 247 | sqlite3_vfs_register=_sqlite3_vfs_register@8 248 | sqlite3_vfs_unregister=_sqlite3_vfs_unregister@4 249 | sqlite3_vtab_collation=_sqlite3_vtab_collation@8 250 | sqlite3_vtab_distinct=_sqlite3_vtab_distinct@4 251 | sqlite3_vtab_in=_sqlite3_vtab_in@12 252 | sqlite3_vtab_in_first=_sqlite3_vtab_in_first@8 253 | sqlite3_vtab_in_next=_sqlite3_vtab_in_next@8 254 | sqlite3_vtab_nochange=_sqlite3_vtab_nochange@4 255 | sqlite3_vtab_on_conflict=_sqlite3_vtab_on_conflict@4 256 | sqlite3_vtab_rhs_value=_sqlite3_vtab_rhs_value@12 257 | sqlite3_wal_autocheckpoint=_sqlite3_wal_autocheckpoint@8 258 | sqlite3_wal_checkpoint=_sqlite3_wal_checkpoint@8 259 | sqlite3_wal_checkpoint_v2=_sqlite3_wal_checkpoint_v2@20 260 | sqlite3_wal_hook=_sqlite3_wal_hook@12 261 | sqlite3_win32_is_nt=_sqlite3_win32_is_nt@0 262 | sqlite3_win32_mbcs_to_utf8=_sqlite3_win32_mbcs_to_utf8@4 263 | sqlite3_win32_set_directory=_sqlite3_win32_set_directory@8 264 | sqlite3_win32_set_directory8=_sqlite3_win32_set_directory8@8 265 | sqlite3_win32_set_directory16=_sqlite3_win32_set_directory16@8 266 | sqlite3_win32_sleep=_sqlite3_win32_sleep@4 267 | sqlite3_win32_utf8_to_mbcs=_sqlite3_win32_utf8_to_mbcs@4 268 | sqlite3_win32_write_debug=_sqlite3_win32_write_debug@8 269 | sqlite3_regexp_init=_sqlite3_regexp_init@12 270 | cdecl_sqlite3_config=sqlite3_config 271 | cdecl_sqlite3_db_config=sqlite3_db_config 272 | cdecl_sqlite3_log=sqlite3_log 273 | cdecl_sqlite3_mprintf=sqlite3_mprintf 274 | cdecl_sqlite3_snprintf=sqlite3_snprintf 275 | cdecl_sqlite3_vmprintf=sqlite3_vmprintf 276 | cdecl_sqlite3_vsnprintf=sqlite3_vsnprintf 277 | cdecl_sqlite3_vtab_config=sqlite3_vtab_config 278 | cdecl_sqlite3_str_appendf=sqlite3_str_appendf 279 | cdecl_sqlite3_str_vappendf=sqlite3_str_vappendf 280 | -------------------------------------------------------------------------------- /Lib/sqlite3win32helper.c: -------------------------------------------------------------------------------- 1 | // # pragma warning (disable : 4018) // signed/unsigned mismatch 2 | # pragma warning (disable : 4022) // pointer mismatch for actual parameter x 3 | # pragma warning (disable : 4028) // formal parameter x different from declaration 4 | # pragma warning (disable : 4047) // 'void ** ' differs in levels of indirection from 'long *' 5 | # pragma warning (disable : 4049) // terminating line number emission 6 | // # pragma warning (disable : 4056) // overflow in floating-point constant arithmetic 7 | # pragma warning (disable : 4090) // 'function' : different 'volatile' qualifiers 8 | // # pragma warning (disable : 4100) // unreferenced formal parameter 9 | // # pragma warning (disable : 4101) // unreferenced local variable 10 | // # pragma warning (disable : 4115) // named type definition in parentheses 11 | // # pragma warning (disable : 4127) // conditional expression is constant 12 | // # pragma warning (disable : 4132) // const object should be initialized 13 | // # pragma warning (disable : 4232) // address of dllimport 'x' is not static, identity not guaranteed 14 | // # pragma warning (disable : 4244) // conversion from 'int ' to 'char ', possible loss of data 15 | // # pragma warning (disable : 4305) // truncation from 'int ' to 'short ' 16 | # pragma warning (disable : 4550) // expression evaluates to a function which is missing an argument list 17 | // # pragma warning (disable : 4701) // 'xxx' may be used without having been initialized 18 | // # pragma warning (disable : 4702) // unreachable code 19 | // # pragma warning (disable : 4706) // assignment within conditional expression 20 | // # pragma warning (disable : 4756) // overflow in constant arithmetic 21 | # pragma warning (disable : 4761) // integral size mismatch in argument; conversion supplied 22 | # pragma warning (disable : 4229) // anachronism used: modifiers on data are ignored 23 | # pragma warning (disable : 4005) // macro redefinition 24 | 25 | #define SQLITE_API 26 | #define SQLITE_STDCALL __stdcall 27 | #define SQLITE_CDECL __cdecl 28 | #define SQLITE_WIN32_MALLOC 1 29 | #define SQLITE_WIN32_HEAP_CREATE 1 30 | #define SQLITE_THREADSAFE 1 31 | #define SQLITE_DEFAULT_CACHE_SIZE -8000 32 | // #define SQLITE_USE_URI 1 33 | #define SQLITE_SOUNDEX 1 34 | #define SQLITE_OMIT_DEPRECATED 1 35 | #define SQLITE_OMIT_AUTOINIT 1 36 | #define SQLITE_ENABLE_FTS3 1 37 | #define SQLITE_ENABLE_FTS3_PARENTHESIS 1 38 | #define SQLITE_ENABLE_FTS4 1 39 | #define SQLITE_ENABLE_RTREE 1 40 | #define SQLITE_ENABLE_UNLOCK_NOTIFY 1 41 | #define SQLITE_ENABLE_COLUMN_METADATA 1 42 | // #define SQLITE_ENABLE_DESERIALIZE 1 43 | #define SQLITE_ENABLE_NORMALIZE 1 44 | #define SQLITE_ENABLE_MATH_FUNCTIONS 1 45 | #define SQLITE_DQS 0 46 | #define HAVE_LOG2 0 47 | 48 | #if defined(_MSC_VER) && _MSC_VER<1300 49 | typedef unsigned long ULONG_PTR; 50 | #endif 51 | 52 | #include "sqlite3\sqlite3.c" 53 | #if defined(SQLITE_CORE) 54 | #include "sqlite3\ext\regexp.c" 55 | #endif -------------------------------------------------------------------------------- /Lib/sqlite3win32stubs.cpp: -------------------------------------------------------------------------------- 1 | # pragma warning (disable : 4229) // anachronism used: modifiers on data are ignored 2 | # pragma warning (disable : 4005) // macro redefinition 3 | 4 | #define SQLITE_API extern "C" 5 | #define SQLITE_STDCALL __stdcall 6 | #define SQLITE_CDECL __cdecl 7 | #define SQLITE_WIN32_MALLOC 1 8 | #define SQLITE_WIN32_HEAP_CREATE 1 9 | #define SQLITE_THREADSAFE 1 10 | #define SQLITE_DEFAULT_CACHE_SIZE -8000 11 | // #define SQLITE_USE_URI 1 12 | #define SQLITE_SOUNDEX 1 13 | #define SQLITE_OMIT_DEPRECATED 1 14 | #define SQLITE_OMIT_AUTOINIT 1 15 | #define SQLITE_ENABLE_FTS3 1 16 | #define SQLITE_ENABLE_FTS3_PARENTHESIS 1 17 | #define SQLITE_ENABLE_FTS4 1 18 | #define SQLITE_ENABLE_RTREE 1 19 | #define SQLITE_ENABLE_UNLOCK_NOTIFY 1 20 | #define SQLITE_ENABLE_COLUMN_METADATA 1 21 | // #define SQLITE_ENABLE_DESERIALIZE 1 22 | #define SQLITE_ENABLE_NORMALIZE 1 23 | #define SQLITE_ENABLE_MATH_FUNCTIONS 1 24 | #define SQLITE_DQS 0 25 | #define HAVE_LOG2 0 26 | 27 | #include 28 | #include "sqlite3\sqlite3.h" 29 | 30 | SQLITE_API int SQLITE_STDCALL sqlite3_win32_is_nt(void); 31 | SQLITE_API void SQLITE_STDCALL sqlite3_win32_sleep(DWORD milliseconds); 32 | SQLITE_API char *SQLITE_STDCALL sqlite3_win32_utf8_to_mbcs(const char *zFilename); 33 | SQLITE_API char *SQLITE_STDCALL sqlite3_win32_mbcs_to_utf8(const char *zFilename); 34 | SQLITE_API void SQLITE_STDCALL sqlite3_win32_write_debug(const char *zBuf, int nBuf); 35 | SQLITE_API void SQLITE_STDCALL sqlite3_regexp_init(sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi); 36 | 37 | #define MODULE sqlite3win32stubs 38 | 39 | #define DECLFUNC(Name) void __stdcall stub_sqlite3_##Name(void); 40 | #define DEFFUNC(Name) __declspec(naked) void __stdcall MODULE::stub_sqlite3_##Name() { __asm { jmp sqlite3_##Name } } 41 | 42 | class MODULE 43 | { 44 | DECLFUNC(aggregate_context) 45 | DECLFUNC(auto_extension) 46 | DECLFUNC(autovacuum_pages) 47 | DECLFUNC(backup_finish) 48 | DECLFUNC(backup_init) 49 | DECLFUNC(backup_pagecount) 50 | DECLFUNC(backup_remaining) 51 | DECLFUNC(backup_step) 52 | DECLFUNC(bind_blob64) 53 | DECLFUNC(bind_blob) 54 | DECLFUNC(bind_double) 55 | DECLFUNC(bind_int64) 56 | DECLFUNC(bind_int) 57 | DECLFUNC(bind_null) 58 | DECLFUNC(bind_parameter_count) 59 | DECLFUNC(bind_parameter_index) 60 | DECLFUNC(bind_parameter_name) 61 | DECLFUNC(bind_pointer) 62 | DECLFUNC(bind_text16) 63 | DECLFUNC(bind_text64) 64 | DECLFUNC(bind_text) 65 | DECLFUNC(bind_value) 66 | DECLFUNC(bind_zeroblob64) 67 | DECLFUNC(bind_zeroblob) 68 | DECLFUNC(blob_bytes) 69 | DECLFUNC(blob_close) 70 | DECLFUNC(blob_open) 71 | DECLFUNC(blob_read) 72 | DECLFUNC(blob_reopen) 73 | DECLFUNC(blob_write) 74 | DECLFUNC(busy_handler) 75 | DECLFUNC(busy_timeout) 76 | DECLFUNC(cancel_auto_extension) 77 | DECLFUNC(changes) 78 | DECLFUNC(changes64) 79 | DECLFUNC(clear_bindings) 80 | DECLFUNC(close) 81 | DECLFUNC(close_v2) 82 | DECLFUNC(collation_needed16) 83 | DECLFUNC(collation_needed) 84 | DECLFUNC(column_blob) 85 | DECLFUNC(column_bytes16) 86 | DECLFUNC(column_bytes) 87 | DECLFUNC(column_count) 88 | DECLFUNC(column_database_name16) 89 | DECLFUNC(column_database_name) 90 | DECLFUNC(column_decltype16) 91 | DECLFUNC(column_decltype) 92 | DECLFUNC(column_double) 93 | DECLFUNC(column_int64) 94 | DECLFUNC(column_int) 95 | DECLFUNC(column_name16) 96 | DECLFUNC(column_name) 97 | DECLFUNC(column_origin_name16) 98 | DECLFUNC(column_origin_name) 99 | DECLFUNC(column_table_name16) 100 | DECLFUNC(column_table_name) 101 | DECLFUNC(column_text16) 102 | DECLFUNC(column_text) 103 | DECLFUNC(column_type) 104 | DECLFUNC(column_value) 105 | DECLFUNC(commit_hook) 106 | DECLFUNC(compileoption_get) 107 | DECLFUNC(compileoption_used) 108 | DECLFUNC(complete16) 109 | DECLFUNC(complete) 110 | DECLFUNC(context_db_handle) 111 | DECLFUNC(create_collation16) 112 | DECLFUNC(create_collation) 113 | DECLFUNC(create_collation_v2) 114 | DECLFUNC(create_filename) 115 | DECLFUNC(create_function16) 116 | DECLFUNC(create_function) 117 | DECLFUNC(create_function_v2) 118 | DECLFUNC(create_module) 119 | DECLFUNC(create_module_v2) 120 | DECLFUNC(create_window_function) 121 | DECLFUNC(database_file_object) 122 | DECLFUNC(data_count) 123 | DECLFUNC(db_cacheflush) 124 | DECLFUNC(db_filename) 125 | DECLFUNC(db_handle) 126 | DECLFUNC(db_mutex) 127 | DECLFUNC(db_name) 128 | DECLFUNC(db_readonly) 129 | DECLFUNC(db_release_memory) 130 | DECLFUNC(db_status) 131 | DECLFUNC(declare_vtab) 132 | DECLFUNC(deserialize) 133 | DECLFUNC(drop_modules) 134 | DECLFUNC(enable_load_extension) 135 | DECLFUNC(enable_shared_cache) 136 | DECLFUNC(errcode) 137 | DECLFUNC(errmsg16) 138 | DECLFUNC(errmsg) 139 | DECLFUNC(error_offset) 140 | DECLFUNC(errstr) 141 | DECLFUNC(exec) 142 | DECLFUNC(expanded_sql) 143 | DECLFUNC(extended_errcode) 144 | DECLFUNC(extended_result_codes) 145 | DECLFUNC(file_control) 146 | DECLFUNC(filename_database) 147 | DECLFUNC(filename_journal) 148 | DECLFUNC(filename_wal) 149 | DECLFUNC(finalize) 150 | DECLFUNC(free) 151 | DECLFUNC(free_filename) 152 | DECLFUNC(free_table) 153 | DECLFUNC(get_autocommit) 154 | DECLFUNC(get_auxdata) 155 | DECLFUNC(get_clientdata) 156 | DECLFUNC(get_table) 157 | DECLFUNC(hard_heap_limit64) 158 | DECLFUNC(initialize) 159 | DECLFUNC(interrupt) 160 | DECLFUNC(is_interrupted) 161 | DECLFUNC(keyword_check) 162 | DECLFUNC(keyword_count) 163 | DECLFUNC(keyword_name) 164 | DECLFUNC(last_insert_rowid) 165 | DECLFUNC(libversion) 166 | DECLFUNC(libversion_number) 167 | DECLFUNC(limit) 168 | DECLFUNC(load_extension) 169 | DECLFUNC(malloc64) 170 | DECLFUNC(malloc) 171 | DECLFUNC(memory_highwater) 172 | DECLFUNC(memory_used) 173 | DECLFUNC(msize) 174 | DECLFUNC(mutex_alloc) 175 | DECLFUNC(mutex_enter) 176 | DECLFUNC(mutex_free) 177 | DECLFUNC(mutex_leave) 178 | DECLFUNC(mutex_try) 179 | DECLFUNC(next_stmt) 180 | DECLFUNC(normalized_sql) 181 | DECLFUNC(open16) 182 | DECLFUNC(open) 183 | DECLFUNC(open_v2) 184 | DECLFUNC(os_end) 185 | DECLFUNC(os_init) 186 | DECLFUNC(overload_function) 187 | DECLFUNC(prepare) 188 | DECLFUNC(prepare_v2) 189 | DECLFUNC(prepare_v3) 190 | DECLFUNC(prepare16) 191 | DECLFUNC(prepare16_v2) 192 | DECLFUNC(prepare16_v3) 193 | DECLFUNC(progress_handler) 194 | DECLFUNC(randomness) 195 | DECLFUNC(realloc64) 196 | DECLFUNC(realloc) 197 | DECLFUNC(release_memory) 198 | DECLFUNC(reset) 199 | DECLFUNC(reset_auto_extension) 200 | DECLFUNC(result_blob64) 201 | DECLFUNC(result_blob) 202 | DECLFUNC(result_double) 203 | DECLFUNC(result_error16) 204 | DECLFUNC(result_error) 205 | DECLFUNC(result_error_code) 206 | DECLFUNC(result_error_nomem) 207 | DECLFUNC(result_error_toobig) 208 | DECLFUNC(result_int64) 209 | DECLFUNC(result_int) 210 | DECLFUNC(result_null) 211 | DECLFUNC(result_subtype) 212 | DECLFUNC(result_text16) 213 | DECLFUNC(result_text16be) 214 | DECLFUNC(result_text16le) 215 | DECLFUNC(result_text64) 216 | DECLFUNC(result_text) 217 | DECLFUNC(result_value) 218 | DECLFUNC(result_pointer) 219 | DECLFUNC(result_zeroblob64) 220 | DECLFUNC(result_zeroblob) 221 | DECLFUNC(rollback_hook) 222 | DECLFUNC(serialize) 223 | DECLFUNC(rtree_geometry_callback) 224 | DECLFUNC(rtree_query_callback) 225 | DECLFUNC(set_authorizer) 226 | DECLFUNC(set_auxdata) 227 | DECLFUNC(set_clientdata) 228 | DECLFUNC(set_last_insert_rowid) 229 | DECLFUNC(shutdown) 230 | DECLFUNC(sleep) 231 | DECLFUNC(soft_heap_limit64) 232 | DECLFUNC(soft_heap_limit) 233 | DECLFUNC(sourceid) 234 | DECLFUNC(sql) 235 | DECLFUNC(str_new) 236 | DECLFUNC(str_finish) 237 | DECLFUNC(str_append) 238 | DECLFUNC(str_appendall) 239 | DECLFUNC(str_appendchar) 240 | DECLFUNC(str_reset) 241 | DECLFUNC(str_errcode) 242 | DECLFUNC(str_length) 243 | DECLFUNC(str_value) 244 | DECLFUNC(status64) 245 | DECLFUNC(status) 246 | DECLFUNC(step) 247 | DECLFUNC(stmt_busy) 248 | DECLFUNC(stmt_explain) 249 | DECLFUNC(stmt_isexplain) 250 | DECLFUNC(stmt_readonly) 251 | DECLFUNC(stmt_status) 252 | DECLFUNC(strglob) 253 | DECLFUNC(stricmp) 254 | DECLFUNC(strlike) 255 | DECLFUNC(strnicmp) 256 | DECLFUNC(system_errno) 257 | DECLFUNC(table_column_metadata) 258 | DECLFUNC(threadsafe) 259 | DECLFUNC(total_changes64) 260 | DECLFUNC(total_changes) 261 | DECLFUNC(trace_v2) 262 | DECLFUNC(txn_state) 263 | DECLFUNC(update_hook) 264 | DECLFUNC(uri_boolean) 265 | DECLFUNC(uri_int64) 266 | DECLFUNC(uri_key) 267 | DECLFUNC(uri_parameter) 268 | DECLFUNC(user_data) 269 | DECLFUNC(value_blob) 270 | DECLFUNC(value_bytes16) 271 | DECLFUNC(value_bytes) 272 | DECLFUNC(value_double) 273 | DECLFUNC(value_dup) 274 | DECLFUNC(value_encoding) 275 | DECLFUNC(value_free) 276 | DECLFUNC(value_frombind) 277 | DECLFUNC(value_int64) 278 | DECLFUNC(value_int) 279 | DECLFUNC(value_pointer) 280 | DECLFUNC(value_numeric_type) 281 | DECLFUNC(value_nochange) 282 | DECLFUNC(value_subtype) 283 | DECLFUNC(value_text16) 284 | DECLFUNC(value_text16be) 285 | DECLFUNC(value_text16le) 286 | DECLFUNC(value_text) 287 | DECLFUNC(value_type) 288 | DECLFUNC(vfs_find) 289 | DECLFUNC(vfs_register) 290 | DECLFUNC(vfs_unregister) 291 | DECLFUNC(vtab_collation) 292 | DECLFUNC(vtab_distinct) 293 | DECLFUNC(vtab_in) 294 | DECLFUNC(vtab_in_first) 295 | DECLFUNC(vtab_in_next) 296 | DECLFUNC(vtab_nochange) 297 | DECLFUNC(vtab_on_conflict) 298 | DECLFUNC(vtab_rhs_value) 299 | DECLFUNC(wal_autocheckpoint) 300 | DECLFUNC(wal_checkpoint) 301 | DECLFUNC(wal_checkpoint_v2) 302 | DECLFUNC(wal_hook) 303 | DECLFUNC(win32_is_nt) 304 | DECLFUNC(win32_mbcs_to_utf8) 305 | DECLFUNC(win32_set_directory) 306 | DECLFUNC(win32_set_directory8) 307 | DECLFUNC(win32_set_directory16) 308 | DECLFUNC(win32_sleep) 309 | DECLFUNC(win32_utf8_to_mbcs) 310 | DECLFUNC(win32_write_debug) 311 | DECLFUNC(regexp_init) 312 | }; 313 | 314 | DEFFUNC(aggregate_context) 315 | DEFFUNC(auto_extension) 316 | DEFFUNC(autovacuum_pages) 317 | DEFFUNC(backup_finish) 318 | DEFFUNC(backup_init) 319 | DEFFUNC(backup_pagecount) 320 | DEFFUNC(backup_remaining) 321 | DEFFUNC(backup_step) 322 | DEFFUNC(bind_blob64) 323 | DEFFUNC(bind_blob) 324 | DEFFUNC(bind_double) 325 | DEFFUNC(bind_int64) 326 | DEFFUNC(bind_int) 327 | DEFFUNC(bind_null) 328 | DEFFUNC(bind_parameter_count) 329 | DEFFUNC(bind_parameter_index) 330 | DEFFUNC(bind_parameter_name) 331 | DEFFUNC(bind_pointer) 332 | DEFFUNC(bind_text16) 333 | DEFFUNC(bind_text64) 334 | DEFFUNC(bind_text) 335 | DEFFUNC(bind_value) 336 | DEFFUNC(bind_zeroblob64) 337 | DEFFUNC(bind_zeroblob) 338 | DEFFUNC(blob_bytes) 339 | DEFFUNC(blob_close) 340 | DEFFUNC(blob_open) 341 | DEFFUNC(blob_read) 342 | DEFFUNC(blob_reopen) 343 | DEFFUNC(blob_write) 344 | DEFFUNC(busy_handler) 345 | DEFFUNC(busy_timeout) 346 | DEFFUNC(cancel_auto_extension) 347 | DEFFUNC(changes) 348 | DEFFUNC(changes64) 349 | DEFFUNC(clear_bindings) 350 | DEFFUNC(close) 351 | DEFFUNC(close_v2) 352 | DEFFUNC(collation_needed16) 353 | DEFFUNC(collation_needed) 354 | DEFFUNC(column_blob) 355 | DEFFUNC(column_bytes16) 356 | DEFFUNC(column_bytes) 357 | DEFFUNC(column_count) 358 | DEFFUNC(column_database_name16) 359 | DEFFUNC(column_database_name) 360 | DEFFUNC(column_decltype16) 361 | DEFFUNC(column_decltype) 362 | DEFFUNC(column_double) 363 | DEFFUNC(column_int64) 364 | DEFFUNC(column_int) 365 | DEFFUNC(column_name16) 366 | DEFFUNC(column_name) 367 | DEFFUNC(column_origin_name16) 368 | DEFFUNC(column_origin_name) 369 | DEFFUNC(column_table_name16) 370 | DEFFUNC(column_table_name) 371 | DEFFUNC(column_text16) 372 | DEFFUNC(column_text) 373 | DEFFUNC(column_type) 374 | DEFFUNC(column_value) 375 | DEFFUNC(commit_hook) 376 | DEFFUNC(compileoption_get) 377 | DEFFUNC(compileoption_used) 378 | DEFFUNC(complete16) 379 | DEFFUNC(complete) 380 | DEFFUNC(context_db_handle) 381 | DEFFUNC(create_collation16) 382 | DEFFUNC(create_collation) 383 | DEFFUNC(create_collation_v2) 384 | DEFFUNC(create_filename) 385 | DEFFUNC(create_function16) 386 | DEFFUNC(create_function) 387 | DEFFUNC(create_function_v2) 388 | DEFFUNC(create_module) 389 | DEFFUNC(create_module_v2) 390 | DEFFUNC(create_window_function) 391 | DEFFUNC(database_file_object) 392 | DEFFUNC(data_count) 393 | DEFFUNC(db_cacheflush) 394 | DEFFUNC(db_filename) 395 | DEFFUNC(db_handle) 396 | DEFFUNC(db_mutex) 397 | DEFFUNC(db_name) 398 | DEFFUNC(db_readonly) 399 | DEFFUNC(db_release_memory) 400 | DEFFUNC(db_status) 401 | DEFFUNC(declare_vtab) 402 | DEFFUNC(deserialize) 403 | DEFFUNC(drop_modules) 404 | DEFFUNC(enable_load_extension) 405 | DEFFUNC(enable_shared_cache) 406 | DEFFUNC(errcode) 407 | DEFFUNC(errmsg16) 408 | DEFFUNC(errmsg) 409 | DEFFUNC(error_offset) 410 | DEFFUNC(errstr) 411 | DEFFUNC(exec) 412 | DEFFUNC(expanded_sql) 413 | DEFFUNC(extended_errcode) 414 | DEFFUNC(extended_result_codes) 415 | DEFFUNC(file_control) 416 | DEFFUNC(filename_database) 417 | DEFFUNC(filename_journal) 418 | DEFFUNC(filename_wal) 419 | DEFFUNC(finalize) 420 | DEFFUNC(free) 421 | DEFFUNC(free_filename) 422 | DEFFUNC(free_table) 423 | DEFFUNC(get_autocommit) 424 | DEFFUNC(get_auxdata) 425 | DEFFUNC(get_clientdata) 426 | DEFFUNC(get_table) 427 | DEFFUNC(hard_heap_limit64) 428 | DEFFUNC(initialize) 429 | DEFFUNC(interrupt) 430 | DEFFUNC(is_interrupted) 431 | DEFFUNC(keyword_check) 432 | DEFFUNC(keyword_count) 433 | DEFFUNC(keyword_name) 434 | DEFFUNC(last_insert_rowid) 435 | DEFFUNC(libversion) 436 | DEFFUNC(libversion_number) 437 | DEFFUNC(limit) 438 | DEFFUNC(load_extension) 439 | DEFFUNC(malloc64) 440 | DEFFUNC(malloc) 441 | DEFFUNC(memory_highwater) 442 | DEFFUNC(memory_used) 443 | DEFFUNC(msize) 444 | DEFFUNC(mutex_alloc) 445 | DEFFUNC(mutex_enter) 446 | DEFFUNC(mutex_free) 447 | DEFFUNC(mutex_leave) 448 | DEFFUNC(mutex_try) 449 | DEFFUNC(next_stmt) 450 | DEFFUNC(normalized_sql) 451 | DEFFUNC(open16) 452 | DEFFUNC(open) 453 | DEFFUNC(open_v2) 454 | DEFFUNC(os_end) 455 | DEFFUNC(os_init) 456 | DEFFUNC(overload_function) 457 | DEFFUNC(prepare) 458 | DEFFUNC(prepare_v2) 459 | DEFFUNC(prepare_v3) 460 | DEFFUNC(prepare16) 461 | DEFFUNC(prepare16_v2) 462 | DEFFUNC(prepare16_v3) 463 | DEFFUNC(progress_handler) 464 | DEFFUNC(randomness) 465 | DEFFUNC(realloc64) 466 | DEFFUNC(realloc) 467 | DEFFUNC(release_memory) 468 | DEFFUNC(reset) 469 | DEFFUNC(reset_auto_extension) 470 | DEFFUNC(result_blob64) 471 | DEFFUNC(result_blob) 472 | DEFFUNC(result_double) 473 | DEFFUNC(result_error16) 474 | DEFFUNC(result_error) 475 | DEFFUNC(result_error_code) 476 | DEFFUNC(result_error_nomem) 477 | DEFFUNC(result_error_toobig) 478 | DEFFUNC(result_int64) 479 | DEFFUNC(result_int) 480 | DEFFUNC(result_null) 481 | DEFFUNC(result_subtype) 482 | DEFFUNC(result_text16) 483 | DEFFUNC(result_text16be) 484 | DEFFUNC(result_text16le) 485 | DEFFUNC(result_text64) 486 | DEFFUNC(result_text) 487 | DEFFUNC(result_value) 488 | DEFFUNC(result_pointer) 489 | DEFFUNC(result_zeroblob64) 490 | DEFFUNC(result_zeroblob) 491 | DEFFUNC(rollback_hook) 492 | DEFFUNC(serialize) 493 | DEFFUNC(rtree_geometry_callback) 494 | DEFFUNC(rtree_query_callback) 495 | DEFFUNC(set_authorizer) 496 | DEFFUNC(set_auxdata) 497 | DEFFUNC(set_clientdata) 498 | DEFFUNC(set_last_insert_rowid) 499 | DEFFUNC(shutdown) 500 | DEFFUNC(sleep) 501 | DEFFUNC(soft_heap_limit64) 502 | DEFFUNC(soft_heap_limit) 503 | DEFFUNC(sourceid) 504 | DEFFUNC(sql) 505 | DEFFUNC(str_new) 506 | DEFFUNC(str_finish) 507 | DEFFUNC(str_append) 508 | DEFFUNC(str_appendall) 509 | DEFFUNC(str_appendchar) 510 | DEFFUNC(str_reset) 511 | DEFFUNC(str_errcode) 512 | DEFFUNC(str_length) 513 | DEFFUNC(str_value) 514 | DEFFUNC(status64) 515 | DEFFUNC(status) 516 | DEFFUNC(step) 517 | DEFFUNC(stmt_busy) 518 | DEFFUNC(stmt_explain) 519 | DEFFUNC(stmt_isexplain) 520 | DEFFUNC(stmt_readonly) 521 | DEFFUNC(stmt_status) 522 | DEFFUNC(strglob) 523 | DEFFUNC(stricmp) 524 | DEFFUNC(strlike) 525 | DEFFUNC(strnicmp) 526 | DEFFUNC(system_errno) 527 | DEFFUNC(table_column_metadata) 528 | DEFFUNC(threadsafe) 529 | DEFFUNC(total_changes64) 530 | DEFFUNC(total_changes) 531 | DEFFUNC(trace_v2) 532 | DEFFUNC(txn_state) 533 | DEFFUNC(update_hook) 534 | DEFFUNC(uri_boolean) 535 | DEFFUNC(uri_int64) 536 | DEFFUNC(uri_key) 537 | DEFFUNC(uri_parameter) 538 | DEFFUNC(user_data) 539 | DEFFUNC(value_blob) 540 | DEFFUNC(value_bytes16) 541 | DEFFUNC(value_bytes) 542 | DEFFUNC(value_double) 543 | DEFFUNC(value_dup) 544 | DEFFUNC(value_encoding) 545 | DEFFUNC(value_free) 546 | DEFFUNC(value_frombind) 547 | DEFFUNC(value_int64) 548 | DEFFUNC(value_int) 549 | DEFFUNC(value_pointer) 550 | DEFFUNC(value_numeric_type) 551 | DEFFUNC(value_nochange) 552 | DEFFUNC(value_subtype) 553 | DEFFUNC(value_text16) 554 | DEFFUNC(value_text16be) 555 | DEFFUNC(value_text16le) 556 | DEFFUNC(value_text) 557 | DEFFUNC(value_type) 558 | DEFFUNC(vfs_find) 559 | DEFFUNC(vfs_register) 560 | DEFFUNC(vfs_unregister) 561 | DEFFUNC(vtab_collation) 562 | DEFFUNC(vtab_distinct) 563 | DEFFUNC(vtab_in) 564 | DEFFUNC(vtab_in_first) 565 | DEFFUNC(vtab_in_next) 566 | DEFFUNC(vtab_nochange) 567 | DEFFUNC(vtab_on_conflict) 568 | DEFFUNC(vtab_rhs_value) 569 | DEFFUNC(wal_autocheckpoint) 570 | DEFFUNC(wal_checkpoint) 571 | DEFFUNC(wal_checkpoint_v2) 572 | DEFFUNC(wal_hook) 573 | DEFFUNC(win32_is_nt) 574 | DEFFUNC(win32_mbcs_to_utf8) 575 | DEFFUNC(win32_set_directory) 576 | DEFFUNC(win32_set_directory8) 577 | DEFFUNC(win32_set_directory16) 578 | DEFFUNC(win32_sleep) 579 | DEFFUNC(win32_utf8_to_mbcs) 580 | DEFFUNC(win32_write_debug) 581 | DEFFUNC(regexp_init) 582 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | The initial concept and core of this was developed by 'wqweto'. (https://github.com/wqweto/vbsqlite) 2 | 3 | Out of this an Ax-DLL COM-Wrapper was created. (https://github.com/Kr00l/VBSQLite) 4 | 5 | The fork of this has the following differences: 6 | - Updated sqlite3 c source from 3011001 (2016-03-03) to 3047002 (2024-12-07). 7 | - Win32 flags (SQLITE_WIN32_MALLOC, SQLITE_WIN32_HEAP_CREATE) are used in the c++ sources. 8 | - Statically linking to the regexp c extension to enable the REGEXP operator. Use the exported function sqlite3_regexp_init() for registering it. 9 | Example: "rc = sqlite3_regexp_init(hDB, 0, 0)" (pass zero in the second and third parameter as not used) 10 | - All callback functions are __stdcall. Even those used for the overloading of the SQL functions or aggregates. 11 | 12 | What is the same: 13 | - __stdcall convention applied in each exported function so that it can be easily used by VB6/VBA. 14 | --------------------------------------------------------------------------------